RSS

Apache's ProxyPass on Ubuntu

20 Oct
  1. Install apache2. On Ubuntu type:
     # apt-get install apache2
  2. Activate mod_proxy:
     # a2enmod proxy
  3. 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>
  4. Enable the new site and restart apache2:
    # a2ensite metak
    # /etc/init.d/apache2 reload
 
19 Comments

Posted by on October 20, 2006 in Linux, Ubuntu

 

19 responses to “Apache's ProxyPass on Ubuntu

  1. 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

     
  2. roger ruby gems rdocs

    August 3, 2009 at 3:21 pm

    I needed a2enmod proxy_http as well

     
  3. 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

     
  4. 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!

         
  5. 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!!

     
  6. untoutseul05

    November 5, 2011 at 10:14 am

    Very useful. Thanks for having posted that.

     
  7. Will Laurance (@wlaurance)

    November 29, 2011 at 4:44 pm

    Still useful on ubuntu 11.04! Thanks

     
  8. 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

     
  9. 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

     
  10. web development kent

    July 7, 2012 at 12:13 am

    Useful post – thanks!

     
  11. Cleydson

    October 18, 2012 at 1:45 pm

    a2enmod proxy
    a2enmod proxy_http
    a2enmod vhost_alias

     
  12. 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?

     
  13. Andreas Mueller

    October 29, 2014 at 1:16 pm

    still useful on 14.04, thanks

     
  14. 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.

     
  15. Richard Hayes

    March 19, 2017 at 3:02 am

    This is the shortest most useful post I’ve ever encountered

     

Leave a comment