Posted under » Linux on 27 Feb 2019
So you have a SOCKS5 proxy server and have played around with sopcast but you feel lucky and want a http proxy server now?
First edit the config file /etc/squid/squid.conf
If you wish to allow only one IP address to access the internet through your new proxy server, you will need to define new acl (access control list) in the configuration file.
acl localnet src XX.XX.XX.XX
To allow users to authenticate before using the proxy, you need to enable basic http authentication in the configuration file, but before that you need to install apache2-utils package using following command.
apt install apache2-utils
Now create a file called “passwd” that will later store the username for the authentication. Squid runs with user “proxy” so the file should be owned by that user.
$ sudo touch /etc/squid/passwd $ sudo chown proxy: /etc/squid/passwd $ ls -l /etc/squid/passwd
Now we will create a new user called “anoneh” and setup its password. This is the same with subversion authentication.
$ sudo htpasswd /etc/squid/passwd anoneh
Now to enable basic http authentication open the configuration file (/etc/squid/squid.conf).
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd auth_param basic children 5 auth_param basic realm Squid Basic Authentication auth_param basic credentialsttl 2 hours acl auth_users proxy_auth REQUIRED http_access allow auth_users
Restart your squid and your done.
systemctl restart squidFor more info.