linux-logo-300x300

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!

Apache mod_proxy

 

Apache mod_proxy

mod_proxy is the Apache module for redirecting web pages, it isn’t just one module but rather a collection of them:

  • mod_proxy
  • modproxyhttp
  • modproxyftp
  • modproxyconnect
  • modproxyajp
  • modproxywstunnel
  • modproxywstunnel
  • modproxybalancer
  • mod_cache
  • mod_headers
  • mod_deflate

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:

a2enmod

Input the following modules to load:

proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_htmla2enmod

 

Restart Apache

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

vi /etc/apache2/sites-available/citrix.example.com

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 Site

Enable the site by running the following:

a2ensite citrix.example.com

Restart Apache

Finally, restart Apache web server

service apache2 reload

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.