Apache’s ProxyPass on Ubuntu

  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

2 Comments »

  1. 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. I needed a2enmod proxy_http as well

RSS feed for comments on this post · TrackBack URI

Leave a Comment