Friday, 30 March 2012

Squid 2.7 Installation from source on Centos 6


Steps :


This squid installation is done on Centos6 

1. Frist you need to install Development tools
#yum groupinstall "Development Tools"
2.  Get the  “squid 2.7 ” source. decompress it. 
#wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.gz
#tar -xzvf  squid-2.7.STABLE9.tar.gz
3. change directory to squid -2.7

root@xyz squid-2.7.STABLE9]#
check configure options by
#./configure  -help
4. Select your configuration
like
./configure --enable-gnuregex --enable-carp --with-pthreads --enable-heap-replacement --enable-icmp --enable-delay-pools  --enable-useragent-log --enable-htcp --with-openssl --enable-linux-netfilter  --disable-internal-dns --enable-auth=digest,ntlm,basic --enable-auth-baisc=PAM,NCSA,LDAP --enable-auth-basic=none --enable-basic-auth-helpers=PAM,NCSA,LDAP --enable-external-acl-helpers=unix_group,ldap_group --with-filedescriptors=8192  --enable-removal-policies=lru,heap
5.Make it.

#make
Installation
for installation you need to have root privileges .
# su

# make Install
if you get it without errors congratulate yourself.
and proceed to next step .
Your default installation directory is
#/usr/local/squid/
6.post-Installation
After compiling and installing squid, you should create the cache_dir, give it the rights permissions for the squid user/group and then run:
#/usr/sbin/squid -z
to initialize the cache_dir and create the necessary subdirs
If everything works as expected then try to start squid normally
   
Code:
   
#/usr/sbin/squid

7. Debug.
If you get any errors start squid in debug mode to get the errors on screen:
   
Code:
   
#/usr/sbin/squid -N -d 5

ERROR 407: Proxy Authentication Required ?




  If your Linux machine is behind a proxy server then to access the internet, proxy configuration will be required. The 'http_proxy' and 'ftp_proxy' environment variables hold the information about proxy server. Just hit the these commands-
#export http_proxy=http://proxy-server-ip:port
#export ftp_proxy=http://proxy-server-ip:port

If proxy server needs authentication then include username and password as follows-
#export http_proxy=http://user:password@proxy-server-ip:port
#export ftp_proxy=http://user:password@proxy-server-ip:port
  
These settings are remains vails for single session once you reboot the system they will get erased tomake them permenant  add them in ~/.bashrc file.