What is a Proxy Server..?
proxy server is a server computer that provides a service to forward any user requests to other servers contained on the internet and has a role as a liaison between a computer with the internet.
In addition, the proxy can also be used for Security, such as blocking access to a website.
How Do Proxy Servers Work?
The proxy server works by receiving requests from internal clients and sending them to the external network as if it were the client proxy itself. When a proxy server receives a response and a public server, it responds to the original client as if it were a public server. For Proxy Server configuration that can use the most popular and powerful applications SQUID. Here's how to configure SQUID.
Installation of Squid
The first step we have to do is to install the squid package that will be used for the proxy server, can use the command:
apt–get install squid
Next we can do squid configuration process by using command:
nano /etc/squid/squid.conf
In order to facilitate the configuration we can use the search facility (Ctrl + W) that is by searching the script on the squid file.
The first, search script http_port 3128 add "transparent" and remove the "#".
How to use the command ctrl + w (search) then type the script to be searched:
http_port 3128
Then this view after we edit by add to "transparent" and remove the "#" can use the command:
http_port 3128 transparent
The second, look for script cache_mem 8 mb then remove "#" to become enable.
how to use the command ctrl + w (search) then type the script to be searched:
cache_mem 8 mb
then edit like this view and remove to "#".
The third, search cache_mgr script then remove "#" and add web identity or admin email address.
how to use the command ctrl + w (search) then type the script to be searched :
cache_mgr
then edit and add web identity or admin email address. with the command:
cache_mgr [email protected]
the fourth, search the acl CONNECT script and add a Script like this:
how to use the command ctrl + w (search) then type the script to be searched:
acl_CONNECT
then edit it into something like this by adding some source code, like this picture:
acl url dstdomain “/etc/squid/url”
acl key url_regex –i “/etc/squid/url”
http_access deny url
http_access deny key
acl lan src 192.168.100.0/24
http_access allow lan
http_access allow all
the fifth section look for the script http_access deny all, then there are two similar scripts on the file : squid.conf. How to use the command Ctrl + w (search) and to add "#" for package disabled
Then type the script to be searched :
http_access deny all
The 1st script :
The 2nd script :
After we configure and save with command Ctrl+X > Save > Enter
Configure to Block website
Blocking the website the first step to do is create a file to register the sites and words to be blocked.
The trick can be done by logging into the squid directory with the command :
cd / etc/squid
Then go into the file url , using the command :
nano url
then we add any sites we want to block as an example :
we will block porn websites .
porn.com
xxx.com
After we configure and save with command Ctrl+X > Save > Enter .
Then go into the file key, using the command:
nano key
then on this key file we enter any keywords that will be in block:
porn
xxx
After we configure and save with command Ctrl+X > Save > Enter .
then to check whether the configuration is correct or not we can use the command :
squid –z
if it appears squid is already running! process ID 1180, then the configuration process is correct.
Configuration IP Tables
Then we configure it on iptables, to redirect port 80 (HTTP) to port 3128 (PROXY).
then enter into /etc/rc.local file, using command:
nano /etc/rc.local
then we add the source code to the file /etc/rc.local :
iptables –t nat –A PREROUTING –s 192.168.10.0/24 –p tcp --dport 80 –j REDIRECT --to-port 3128
After we configure and save with command Ctrl+X > Save > Enter .
Finally, restart the squid we have configured before we test.
/etc/init.d/squid restart
Testing Proxy
Testing we do on the client side windows. The Proxy server will become TRANSPARENT if there is a connection to the Internet.
But if used in the scope of Local Area Network (LAN), which is not the Internet, then we must configure MANUAL PROXY on the client side first .
Manual Proxy Configuration :
Here's how to configure Manual Proxy in Mozilla Firefox Web Browser.
Options -> General-> Network proxy -> Settings
then after we mengaktikan proxy manual, then we fill in the address we have created earlier whether blocked or not when it appears ERROR the requested URL could not be received.
porn sites have been successfully blocked.
note :
before testing make sure your computer is connected to the server.
if the site has not been successfully blocked check the proxy configuration again
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
next time please follow utopian format post in every category or we cant accepted.
and look new rules SOFT vs HARD
https://utopian.io/rules
You can contact us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks @arie.steem I will make a good contribution again
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey @fandimuhammad11 I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks @utopian-io
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
nice tutorial bro @fandimuhammad11
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit