Okay so I love Apache and at every chance I will use it over Microsoft IIS or any other web serving service, unless a specific application is only written for Microsoft IIS – such as (Citrix Web Interface) !!
So in the case of only having one public IP and Citrix Web Interface behind it but wanting to host on Apache, I had to set up an Apache box to proxy all traffic for a certain domain name to the IIS box. Did I explain that well, probably not, … lets draw a picture!
mod_proxy is the Apache module for redirecting web pages, it isn’t just one module but rather a collection of them:
Installing Apache mod_proxy
This assumes you have Apache installed and running, if not just run the following to install:
apt-get update && apt-get upgrade apt-get install apache2
Install Essential Build Tools
The package is required to install from source code
apt-get install -y build-essential
Install Module and Dependancies
apt-get install -y libapache2-mod-proxy-html libxml2-dev
Activating the Modules
We need to enable the necessary modules before configuring Apache, to check to see what modules are available, run the following:
Input the following modules to load:
service apache2 restart
Configuring Apache vHosts for mod_proxy
In this example I will be using “citrix.example.com” to a webserver at 192.168.0.11 as a domain and IP to get mod_proxy to redirect to, you will need to change this to suit your needs.
Create a vhost
Copy and paste the following into the conf file
<VirtualHost *:80> ProxyPreserveHost On ProxyPass / http://192.168.0.11/ ServerName citrix.example.com </VirtualHost>
Save and quit (:wq)
Enable the site by running the following:
Finally, restart Apache web server
service apache2 reload