- Install apache2. On Ubuntu type:
# apt-get install apache2
- Activate mod_proxy:
# a2enmod proxy
- Create a new file in /etc/apache2/sites-available, named metak (or whatever):
NameVirtualHost * <Virtualhost *> DocumentRoot "/var/www/metak" ServerName localhost ServerAdmin support@mycompany.com DirectoryIndex index.html index.phpProxyRequests On ProxyPreserveHost On ProxyVia full <proxy> Order deny,allow Allow from all </proxy> ProxyPass / http://www.metak.com ProxyPassReverse / http://www.metak.com </Virtualhost> - Enable the new site and restart apache2:
# a2ensite metak # /etc/init.d/apache2 reload
Apache's ProxyPass on Ubuntu
20
Oct

Stephan Wehner
June 26, 2008 at 1:35 am
Thanks that helped. It seems to me that
ProxyPass / http://www.metak.com
should have a slash at the end
ProxyPass / http://www.metak.com/
since otherwise links to a page page.html become http://www.metak.compage.html (slash missing).
Stephan
roger ruby gems rdocs
August 3, 2009 at 3:21 pm
I needed a2enmod proxy_http as well
brice
September 16, 2010 at 10:33 am
I confirm:
- end / needed for ProxyPass & ProxyPassReverse
- a2enmod proxy_http needed
… and it will work like a charm
kamal
June 16, 2011 at 7:18 am
Thanks for your post. This post is helpful.
You should proxy and proxy_http at the beginning then it will work easily and if you have default site in your available site folder , you need to disable the default site.
the code will be
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2dissite default
serbiancafe
June 17, 2011 at 9:46 am
I’m glad my notes are still helpful. It’s been almost 5 years since I blogged about this.
Miguel Ortiz
September 14, 2011 at 9:12 am
Thanks, really usefull !!! i didn’t figure out how to install it ’til read this.
ty!!
untoutseul05
November 5, 2011 at 10:14 am
Very useful. Thanks for having posted that.
boriskuzmanovic
November 5, 2011 at 8:36 pm
Glad you found it useful.
Will Laurance (@wlaurance)
November 29, 2011 at 4:44 pm
Still useful on ubuntu 11.04! Thanks
Larry
December 15, 2011 at 7:26 pm
I’m trying to use this on two machines. this on the second one, but it’s like having one foot in Hell, you can not get to heaven. So how can I set up the first machine? Larry
Larry
December 15, 2011 at 7:42 pm
From Larry also restarting apache2 on second machine
* Restarting web server apache2 apache2: Could not reliably determine the server’s fully qualified domain name, using 204.232.137.207 for ServerName
… waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 204.232.137.207 for ServerName