Professional Documents
Culture Documents
Install Squid Proxy Server On CentOS
Install Squid Proxy Server On CentOS
enterprise Linux 5
Install Squid on CentOS / RHEL 5
Use yum command as follows:
Output:
init_cache_dir /var/spool/squid… Starting squid: . [ OK ]
Verify port 3128 is open:
# netstat -tulpn | grep 3128
Output:
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 20653/(squid)
Open TCP port 3128
Finally make sure iptables is allowing to access squid proxy server. Just open /etc/sysconfig/iptables file:
# vi /etc/sysconfig/iptables
Append configuration:
-A RH-Firewall-1-INPUT -m state –state NEW,ESTABLISHED,RELATED -m tcp -p tcp –dport 3128 -j
ACCEPT
Restart iptables based firewall:
# /etc/init.d/iptables restart
First create a NCSA password file using htpasswd command. htpasswd is used to create and update
the flat-files
used to store usernames and password for basic authentication of squid users.
# htpasswd /etc/squid/passwd user1
Output:
New password:
Re-type new password:
Adding password for user user1
Make sure squid can read passwd file:
# chmod o+r /etc/squid/passwd
# vi /etc/squid/squid.conf
auth_param basic casesensitive off : Specifies if usernames are case sensitive. It can be on or off
only
acl ncsa_users proxy_auth REQUIRED : The REQURIED term means that any authenticated user
will
match the ACL named ncsa_users
http_access allow ncsa_users : Allow proxy access only if user is successfully authenticated.
Restart squid:
# /etc/init.d/squid restart
# vi /etc/squid/iptables