- 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.
Brad Coughlin
June 6, 2012 at 6:31 pm
That’s the beauty of the internet. I also needed that ‘a2enmod proxy_http’ to get my site running. Cheers!
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
web development kent
July 7, 2012 at 12:13 am
Useful post – thanks!
Cleydson
October 18, 2012 at 1:45 pm
a2enmod proxy
a2enmod proxy_http
a2enmod vhost_alias
Manish Goyal
June 3, 2014 at 12:01 am
Hi
if i don’t want my server-status page to use proxy or any other way to bypass server-status page from proxy statement?
Andreas Mueller
October 29, 2014 at 1:16 pm
still useful on 14.04, thanks
Dan Termani
August 25, 2016 at 1:28 pm
Still useful here in late 2016 when trying to run a node.js application on a specified port while using virtualmin with apache for a specific hosted domain. Thanks.
boriskuzmanovic
August 25, 2016 at 3:35 pm
Great. I’m glad it worked for you.
Richard Hayes
March 19, 2017 at 3:02 am
This is the shortest most useful post I’ve ever encountered