Atlantic.Net Blog

How to Install and Configure Privoxy Server On Oracle Linux 8

Privoxy is a web proxy service that acts as a non-caching web proxy. It works as a mediator between a user and the Internet. When the user accesses the Internet, the web browser sends a request to Privoxy to get the objects or pages, then Privoxy filters the user request per the proxy configuration and gives the result to the end user. Generally, a Privoxy server is used for privacy and security and to improve efficiency through its advanced caching features.

In this post, we will show you how to install a Privoxy proxy server on Oracle Linux 8.

Step 1 – Install Privoxy Server

By default, the Privoxy package is not included in the Oracle Linux default repo, so you will need to add the EPEL repo to your server.

First, install the EPEL using the following command:

dnf install epel-release -y

Once the EPEL repo is installed, you can install Privoxy with the following command:

dnf install privoxy -y

Privoxy proxy stores all their configuration files at /etc/privoxy directory. You can see all of them with the following command:

ls -l /etc/privoxy/

You will get the following list:

-rw-r--r-- 1 root root  86277 Dec 16  2021 config
-rw-r--r-- 1 root root 111882 Dec 16  2021 default.action
-rw-r--r-- 1 root root  43970 Dec  8  2021 default.filter
-rw-r--r-- 1 root root    600 Dec  8  2021 match-all.action
-rw-r--r-- 1 root root  42637 Dec  8  2021 regression-tests.action
drwxr-xr-x 2 root root   4096 Jul 19 05:09 templates
-rw-r--r-- 1 root root   3565 Dec  8  2021 trust
-rw-r--r-- 1 root root   9012 Dec  8  2021 user.action
-rw-r--r-- 1 root root      0 Dec 16  2021 user.filter

Step 2 – Configure Privoxy Proxy

By default, the Privoxy server listens on port 8118 on the localhost, so you will need to configure it to listen to your server’s IP address.

To do so, edit the Privoxy configuration file:

nano /etc/privoxy/config

Find the following line:

listen-address  127.0.0.1:8118

Change it with the following line:

listen-address  your-server-ip:8118

Next, define the log directory path:

logdir /var/log/privoxy

Next, uncomment the following lines:

logfile logfile
debug     1 # Log the destination for each request. See also debug 1024.
debug     2 # show each connection status
debug     4 # show tagging-related messages
debug     8 # show header parsing
debug    16 # log all data written to the network
debug    32 # debug force feature
debug    64 # debug regular expression filters#
debug   128 # debug redirects
debug   256 # debug GIF de-animation
debug   512 # Common Log Format
debug  1024 # Log the destination for requests Privoxy didn't let through, and the reason why.
debug  2048 # CGI user interface#
debug  4096 # Startup banner and warnings.
debug  8192 # Non-fatal errors
debug 32768 # log all data read from the network
debug 65536 # Log the applying actions

Save and close the file, then start the Privoxy service with the following command:

systemctl start privoxy

You can check the status of Privoxy with the following command:

systemctl status privoxy

You should get the following output:

● privoxy.service - Privoxy Web Proxy With Advanced Filtering Capabilities
   Loaded: loaded (/usr/lib/systemd/system/privoxy.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2022-07-19 05:11:52 EDT; 4s ago
  Process: 30045 ExecStart=/usr/sbin/privoxy --pidfile /run/privoxy.pid --user privoxy /etc/privoxy/config (code=exited, status=0/SUCCESS)
 Main PID: 30046 (privoxy)
    Tasks: 1 (limit: 11409)
   Memory: 1.4M
   CGroup: /system.slice/privoxy.service
           └─30046 /usr/sbin/privoxy --pidfile /run/privoxy.pid --user privoxy /etc/privoxy/config

Jul 19 05:11:51 oraclelinux8 systemd[1]: Starting Privoxy Web Proxy With Advanced Filtering Capabilities...
Jul 19 05:11:52 oraclelinux8 systemd[1]: Started Privoxy Web Proxy With Advanced Filtering Capabilities.

You can also verify the Privoxy listening port using the following command:

ss -antpl | grep 8118

You will get the following output:

LISTEN 0      128    208.117.86.131:8118      0.0.0.0:*    users:(("privoxy",pid=30046,fd=7))

Step 3 – Configure Web Browser to Use Privoxy Proxy

After installing the Privoxy server, you will need to test it. To test it, you must configure your web browser to use the Privoxy server.

First, go to the client system, open your Firefox web browser => and click on Edit => Preferences. You should see the following page:
Firefox preferences page
Now, click on Network Settings => Settings. You should see the following page:
Firefox proxy page
Now, provide your Privoxy server IP and port and click on the Ok button to save the changes.

Now, open your web browser and access the URL https://www.whatismyip.com to check your public IP address. If everything is fine, you should see your Privoxy server IP on the following page:
verify proxy page

Conclusion

Congratulations! You have successfully installed and configured the Privoxy server on your Oracle Linux 8 virtual private server. You can now use some advanced filters on the Privoxy server and block your desired content. Get started with Privoxy on VPS hosting from Atlantic.Net!

Get a $250 Credit and Access to Our Free Tier!

Free Tier includes:
G3.2GB Cloud VPS a Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year