How to Install Apache with Pound on Ubuntu Linux

|

|

The post outlines a step-by-step guide for enhancing server performance via Pound, an open-source HTTP accelerator, implemented with Apache2. This arrangement considerably boosts server performance as Pound, acting as a front-end, stores web caches in system memory, thus allowing faster retrieval for subsequent requests for the same resource. Detailed steps are provided for installing both…

This article explains how to install Apache on Ubuntu Linux with Pound caching support.

Installing Apache with Pound caching support can significantly improve the performance of high-traffic websites and blogs. This is because Pound is an open-source HTTP accelerator that can store web caches in the system’s memory, ensuring faster retrieval in subsequent requests for the same resource.

By configuring Pound as a proxy server for Apache2, you can enhance the server’s performance, distribute loads across multiple web servers, and quickly serve HTTP/HTTPS requests.

Additionally, using Apache2 with Pound as a proxy server can help you handle caching website content through proxy servers, resulting in faster and more efficient browsing experiences for your users.

This is because Pound stores web caches in the system’s memory, ensuring faster retrieval in subsequent requests for the same resource.

To get this working, follow the steps below:

Install Apache2 HTTP Server

First, run the commands below to install the Apache2 webserver.

sudo apt-get update
sudo apt-get install apache2

After installing Apache2, the commands below can stop, start, and enable Apache2 always to start whenever the server boots up.

sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

The apache2 HTTP service is automatically bound to ports 80 and 443 for HTTPS by default. This

Install Pound Proxy Server

Now that Apache2 is installed run the commands below to install Pound

sudo apt-get install pound

After installing Pound, the commands below can be used to start, stop, and enable Varnish to always start up when the server boots

sudo systemctl stop pound.service
sudo systemctl start pound.service
sudo systemctl enable pound.service

Switch the Apache2 default post to 8080

Since we want Pound to listen for all traffic coming to port 80, which is Apache2’s default port, let’s configure Apache2 to use another port number. You can open the Apache2 default port configuration file at /etc/apache2/ports.conf and change the Listen value to 8080.

To quickly change the port, run the commands below to open the Apache2 default port configuration file.

sudo nano /etc/apache2/ports.conf

Then, make sure the file has these lines. Save when done.

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

NameVirtualHost 127.0.0.1:8080
Listen 127.0.0.1:8080

Next, open the Apache2 default virtual host config file.

sudo nano /etc/apache2/sites-available/000-default.conf

Then, make the highlighted change below.

<VirtualHost 127.0.0.1:8080>

Save the file and exit.

Then restart Apache2

sudo systemctl restart apache2.service

To access Apache2, enter the server IP or hostname followed by port # 8080.

ex. http://localhost:8080

Configure Pound to use Port 80

Now that port 80 is free let’s configure Pound to use that post instead. To assign port 80 to Varnish, run the commands below.

Pound default configure file is located at /etc/pound/pound.cfg

Open it by running the commands below:

sudo nano /etc/pound/pound.cfg

Then look for the config block under listen, redirect, and .. and make the highlighted changes as shown below. Use the server IP address and not the loopback (127.0.0.1)

User            "www-data"
Group           "www-data"
#RootJail       "/chroot/pound"
LogLevel        1

## check backend every X secs:
Alive           30
# poundctl control socket
Control "/var/run/pound/poundctl.socket"

######################################################################
## listen, redirect and . to:

## redirect all requests on port 8080 ("ListenHTTP") to the local webserver (see "Service" below):
ListenHTTP
        Address 192.168.43.133
        Port    80

        ## allow PUT and DELETE also (by default only GET, POST and HEAD)?:
        xHTTP           0

        Service
                BackEnd
                        Address 192.168.43.133
                        Port    8080
                End
        End
End

Save the file and close.

Next, run the commands to open the Pound default startup script config.

sudo nano /etc/default/pound

Then change the value to 1

# prevent startup with default configuration
# set the below varible to 1 in order to allow pound to start
startup=1

Save the file.
After that, restart both Apache2 and Varnish.

sudo systemctl restart apache2.service
sudo systemctl restart pound.service

If everything is set up correctly, Pound should be the default listener of port 80.

Congratulations! You’ve just installed Apache2 with Pound support.

If you followed the steps above and can’t get Pound to listen on port 80, run the commands below to create the Pound socket control directory if it’s not already there.

sudo mkdir /var/run/pound

During my test, the folder above was missing.

You may also like the post below:

Like this:



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.