Home > Cpanel/WHM, HA, Linux application Installations > Apache proxy redirect

Apache proxy redirect

SITUATION: Customer has a single website with four different web applications installed under four sub directories of the website. Now configure apache to serve all these four applications from four different ports.


1) OS – Ubuntu 11

2) Website name and documentroot,

Name: jackal777.com

DocumentRoot:  /home/jackal/public_html

3) Web application sub-directories and the ports going to be used,

/home/jackal/public_html/app1 : Port 7001
/home/jackal/public_html/app2 : Port 7002
/home/jackal/public_html/app3 : Port 7003
/home/jackal/public_html/app4 : Port 7004

4) Apache mod_proxy module is installed. You can install it using,

apt-get install libapache2-mod-proxy-html -y


1) Open up /etc/apache2/ports.conf and add the following directives,

Listen 80

2) Enable mod_proxy by copying the configuratons from ‘mods-available’ directory to ‘mods-enabled’

cp -pr /etc/apache2/mods-available/*proxy* /etc/apache2/mods-enabled/

3) Create a virtualhost file “/etc/apache2/sites-enabled/jackal777.com” for website with the following contents,

<VirtualHost *:80>
ServerName jackal777.com
DocumentRoot /home/jackal/public_html

ProxyPass /app1/
ProxyPass /app2/
ProxyPass /app3/
ProxyPass /app4/


DocumentRoot /home/jackal/public_html/app1

DocumentRoot /home/jackal/public_html/app2

DocumentRoot /home/jackal/public_html/app3

DocumentRoot /home/jackal/public_html/app4

4) Test configuration and gracefully restart apache.

apache2ctl -t
apache2ctl -k graceful

5) Now access the url’s,



SCOPE: Using mod_proxy, we could forward requests coming to different servers and make the applications running from several different servers.


Hope this info will be somewhat useful 🙂

  1. September 14, 2013 at 4:14 am

    Perfect 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: