Apache ProxyPass and ProxyPassReverse Directives
A sample configuration from MDKP.GOV.MY Apache web server using the combination of ProxyPass and ProxyPassReverse for achieving "shared" port 80.
As we already know , Apache mainly runs at port 80 and while it does sometimes runs on diffrent port depend on it's configuration. Well here in MDKP (Local Council Of Kuala Pilah) faces a major problem. We want to run web server using internal hosting and also we're gonna have another server which called E-Aduan Awam (E-Public Complaint System) and both of these server runs Apache on the same port! that is port 80. This is due to the lack of Static IP since we can't afford yet to own a leased line with Static IP bundle with it. Right now we have to endure with 1 Static Public IP using SDSL connection from Telekom Malaysia. So here's the snippet of Apache 2.2.x on what we've already implement using Virtual Host container and the combination of ProxyPass and ProxyPassReverse Directives.
<VirtualHost 10.10.10.2:80> ServerName www.mdkp.gov.my ServerAdmin email@example.com DocumentRoot /home/webmaster/public_html/ CustomLog /var/log/httpd/access_log combined </VirtualHost>
<VirtualHost 10.10.10.2:80> ServerName eaduan.mdkp.gov.my ProxyPass / http://eaduan.mdkp.gov.my/ ProxyPassReverse / http://eaduan.mdkp.gov.my/ CustomLog /var/log/httpd/access_log combined ErrorLog /var/log/httpd/error_log </VirtualHost>
<VirtualHost 10.10.10.2:80> ServerName penguin.mdkp.gov.my ProxyPass / http://penguin.mdkp.gov.my/ ProxyPassReverse / http://penguin.mdkp.gov.my/ CustomLog /var/log/httpd/access_log combined ErrorLog /var/log/httpd/error_log </VirtualHost>