On this occasion, i would like to posting about how to install LUSCA Head r14809 in Ubuntu Server 12.04. We need some of tools to install this proxy, like Ubuntu Server 12.04, Ubuntu Client, Internet, etc.

First, please install the ubuntu server to your PC.

Note: Now, i am installing all configuration in Virtualbox.

First, you must update your Ubuntu Server.
apt-get update && apt-get upgrade

Next, install all packet needed to install LUSCA Head r14809
apt-get install squid squidclient squid-cgi gcc build-essential sharutils ccze libzip-dev automake1.9 acpid

Next, download LUSCA Head r14809 from source-code:
wget https://lusca-cache.googlecode.com/files/LUSCA_HEAD-r14809.tar.gz

Next, extract LUSCA_HEAD-r14809.tar.gz:
tar -zxvf LUSCA_HEAD-r14809.tar.gz

Next, go to directory LUSCA_HEAD-r14809:
cd LUSCA_HEAD-r14809/

Next, compile with this command:
./configure --prefix=/usr/local/squid --exec-prefix=/usr/local/squid --enable-delay-pools --enable-cache-digests --enable-poll --enable-linux-netfilter --enable-removal-policies --with-maxfd=8192 --enable-storeio=aufs --disable-wccp --enable-x-accelerator-vary --enable-kill-parent-hack --enable-async-io=30 --disable-ident-lookups

Next, configuration is finished. And then type this command:
make all && make install

Next, we can check the squid version: :
/usr/local/squid/sbin/squid -v

Next, if the squid version is right, we go to directory squid configuration:
cd /usr/local/squid/etc

Next, delete original squid.conf, and then we create new squid.conf, and fill the new configuration
rm -rf squid.conf && touch squid.conf && nano squid.conf

Copy and paste from here:
http://pastebin.com/g8jVXQeh

After paste, press Ctrl+O for save, and exit press Ctrl+X

Next, create storeurl.pl file and edit with nano:
touch storeurl.pl && nano storeurl.pl

Copy and paste from here:
http://pastebin.com/tQ7D4Z6L

After paste, press Ctrl+O for save, and exit press Ctrl+X

Next, change squid.conf mode and storeurl.pl so you can read and write with LUSCA Head r14809
chown proxy:proxy squid.conf && chmod 777 squid.conf && chown proxy:proxy storeurl.pl && chmod a+x storeurl.pl

Next, we create and change owner from directory "/cache":
mkdir /cache && chown proxy:proxy /cache && chmod 777 /cache

Notes:
From configuration process and  compiler in the begining, Automatically, "/cache" directory is created. But, the owner is root, whereas,the owner must be "proxy:proxy" to running this configuration. If you need more directory for saving your cache

Next, we create directory to save "log":
mkdir /var/log/squid && chown proxy:proxy /var/log/squid && chmod 777 /var/log/squid

Move to that directory, and then create log file needed.
cd /var/log/squid && touch access.log cache.log store.log && chmod 777 access.log cache.log store.log && chown proxy:proxy access.log cache.log store.log

Next, create swap from the cache:
/usr/local/squid/sbin/squid -z

Last, running LUSCA Head r14809.
/usr/local/squid/sbin/squid -NDd1 &

To see all of activities (access.log) from LUSCA Head r14809, run this command:
tail -f /var/log/squid/access.log | ccze

If your Lusca Head r14809 always running when proxy server is restarting, run this command:
echo “/usr/local/squid/sbin/squid -NDd1 &” >> /etc/rc.local

Post a Comment

  1. squid.conf n storeurl.pl is same config ??? check both are same

    ReplyDelete
    Replies
    1. Sorry masterbeto, i fill the wrong code for squid.conf. But now, you can copy from here http://pastebin.com/g8jVXQeh.
      good luck.

      Delete
    2. i take this msg only n no work

      root@ubuntu:/var/log/squid# /etc/rc.local
      root@ubuntu:/var/log/squid# 2014/03/23 21:09:34| WARNING: Very large maximum_object_size_in_memory settings can have negative impact on performance
      2014/03/23 21:09:34| Starting Squid Cache version LUSCA_HEAD-r14809 for x86_64-unknown-linux-gnu...
      2014/03/23 21:09:34| Process ID 23683
      2014/03/23 21:09:34| NOTICE: Could not increase the number of filedescriptors
      2014/03/23 21:09:34| With 1024 file descriptors available
      2014/03/23 21:09:34| Using poll for the IO loop
      2014/03/23 21:09:34| Adding nameserver 192.168.1.2 from /etc/resolv.conf
      2014/03/23 21:09:34| Adding domain localdomain from /etc/resolv.conf
      2014/03/23 21:09:34| helperOpenServers: Starting 1 'storeurl.pl' processes
      2014/03/23 21:09:34| logfileOpen: opening log /var/log/squid/access.log
      2014/03/23 21:09:34| Unlinkd pipe opened on FD 11
      2014/03/23 21:09:34| Swap maxSize 26214400 + 8192 KB, estimated 2017122 objects
      2014/03/23 21:09:34| Target number of buckets: 100856
      2014/03/23 21:09:34| Using 131072 Store buckets
      2014/03/23 21:09:34| Max Mem size: 8192 KB
      2014/03/23 21:09:34| Max Swap size: 26214400 KB
      2014/03/23 21:09:34| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
      2014/03/23 21:09:34| logfileOpen: opening log /var/log/squid/store.log
      2014/03/23 21:09:34| AUFS: /cache: log '/cache/swap.state' opened on FD 13
      2014/03/23 21:09:34| AUFS: /cache: tmp log /cache/swap.state.new opened on FD 13
      2014/03/23 21:09:34| Rebuilding storage in /cache (DIRTY)
      2014/03/23 21:09:34| Using Least Load store dir selection
      2014/03/23 21:09:34| Set Current Directory to /cache/
      2014/03/23 21:09:34| Loaded Icons.
      2014/03/23 21:09:34| Accepting transparently proxied HTTP connections at 0.0.0.0, port 8080, FD 15.
      2014/03/23 21:09:34| Ready to serve requests.
      2014/03/23 21:09:34| Store rebuilding is 0.0% complete
      2014/03/23 21:09:34| WARNING: store_rewriter #1 (FD 5) exited
      2014/03/23 21:09:34| Too few store_rewriter processes are running
      FATAL: The store_rewriter helpers are crashing too rapidly, need help!

      i try with ubuntu-12.04.4-server-amd64.iso and ubuntu-13.10-server-amd64.iso get same msg n no work

      Delete
  2. go to squid.conf, and find this command:
    maximum_object_size_in_memory.

    please input the value of memory that you want, like 512, 1024..etc

    ReplyDelete
  3. root@lusca:/usr/local/squid/etc# 2014/07/23 18:58:23| Starting Squid Cache version LUSCA_HEAD-r14809 for i686-pc-linux-gnu...
    2014/07/23 18:58:23| Process ID 1556
    2014/07/23 18:58:23| NOTICE: Could not increase the number of filedescriptors
    2014/07/23 18:58:23| With 1024 file descriptors available
    2014/07/23 18:58:23| Using poll for the IO loop
    2014/07/23 18:58:23| Adding nameserver 192.168.20.1 from /etc/resolv.conf
    2014/07/23 18:58:23| helperOpenServers: Starting 1 'storeurl.pl' processes
    2014/07/23 18:58:23| logfileOpen: opening log /var/log/squid/access.log
    2014/07/23 18:58:23| Unlinkd pipe opened on FD 11
    2014/07/23 18:58:23| Swap maxSize 40960000 + 8192 KB, estimated 3151399 objects
    2014/07/23 18:58:23| Target number of buckets: 157569
    2014/07/23 18:58:23| Using 262144 Store buckets
    2014/07/23 18:58:23| Max Mem size: 8192 KB
    2014/07/23 18:58:23| Max Swap size: 40960000 KB
    2014/07/23 18:58:23| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
    2014/07/23 18:58:23| logfileOpen: opening log /var/log/squid/store.log
    2014/07/23 18:58:23| AUFS: /cache: log '/cache/swap.state' opened on FD 13
    2014/07/23 18:58:23| AUFS: /cache: tmp log /cache/swap.state.new opened on FD 13
    2014/07/23 18:58:23| Rebuilding storage in /cache (DIRTY)
    2014/07/23 18:58:23| Using Least Load store dir selection
    2014/07/23 18:58:23| Set Current Directory to /cache/
    2014/07/23 18:58:23| Loaded Icons.
    2014/07/23 18:58:23| commBind: Cannot bind socket FD 15 family 2 to 0.0.0.0 port 3128: (98) Address already in use
    FATAL: Cannot open HTTP Port

    :-?

    ReplyDelete

 
Top