Tutorials Build Server #3 || How to Configure Proxy Server to Blocked Porn Website || Bagaimana cara mengkonfigurasikan proxy server untuk memblokir situs porno

in #utopian-io7 years ago (edited)

13.jpg

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

2.PNG

Next we can do squid configuration process by using command:

nano /etc/squid/squid.conf

3.PNG

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

4.PNG

Then this view after we edit by add to "transparent" and remove the "#" can use the command:

http_port 3128 transparent

6.PNG

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

7.PNG

then edit like this view and remove to "#".

9.PNG

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

10.PNG

then edit and add web identity or admin email address. with the command:

cache_mgr [email protected]

12.PNG

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

13.PNG

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

15.PNG

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

16.PNG

The 1st script :
17.PNG

The 2nd script :

20.PNG

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

23.PNG

Then go into the file url , using the command :

nano url

24.PNG

then we add any sites we want to block as an example :
we will block porn websites .

porn.com
xxx.com

25.PNG

After we configure and save with command Ctrl+X > Save > Enter .
Then go into the file key, using the command:

nano key

27.PNG

then on this key file we enter any keywords that will be in block:

porn
xxx

28.PNG
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

31.PNG

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

32.PNG

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

34.PNG

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

36.PNG

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

37.png

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.

91.png

90.png

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

Sort:  

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]

Thanks @arie.steem I will make a good contribution again

Hey @fandimuhammad11 I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59538.61
ETH 2658.79
USDT 1.00
SBD 2.45