This aritcle describes squid installation & configuration on Cent OS 7.
🐞 Server Environment
OS: CentOS 7 Squid: Version 3.3.8
😎 Installation
$ sudo yum -y install vim-enhanced squid
🐰 Squid Configuration
You should change Squid configuration vim /etc/squid/squid.conf.
At frist, comment out default setting:
#http_access deny all #http_port 3128
Add customized configuration in last line:
# Host Name visible_hostname 29.29.29.29.nifty.com
# Port http_port 8080
# Basic auth # Ref http://arashmilani.com/post?id=49 auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/.passwd auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours auth_param basic casesensitive off
# Define ACL acl ncsa_users proxy_auth REQUIRED
# Set permission to ACL http_access allow ncsa_users
# Anonymization forwarded_for off request_header_access X-Forwarded-For deny all request_header_access Via deny all request_header_access Cache-Control deny all
# No Caching no_cache deny all
🐝 Basic Authorization
# Install apache tools to use htpasswd command $ yum install httpd-tools
# Set USER/PASSWORD to basic auth $ useradd $ sudo htpasswd -c /etc/squid/.passwd > New password: > Re-type new password:
🍮 Start Squid
# clear cache $ squid -z
# Start Squid $ service squid start
😸 firewall-cmd Configuration
# Allow your IP address $ firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="x.x.x.x" port protocol="tcp" port="8080" accept" # Allow all IP address # $ firewall-cmd --permanent --zone=public --add-port=8080/tcp $ firewall-cmd --reload
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!