huanix

chown -R huanix /

huanix header image 2

mod proxy redirect url to a backend server on a lan on apache2 and ubuntu gutsy

October 27th, 2007 · No Comments

I will not lie. I struggled for the better part of 3 hours trying to get my virtualhost set properly to allow me to redirect incoming internet traffic from my main server to a server on my lan, all using port 80. Here’s what worked for me.

  1. Enable mod proxy and mod http_proxy with:
    sudo a2enmod proxy
    sudo a2enmod http_proxy
  2. Create a blank virtual host in your sites-available:
    sudo touch /etc/apache2/sites-available/neatserver
  3. Open the virtual server (i use ssh into a graphical desktop - it allows copy & paste!):
    sudo nano /etc/apache2/sites-available
  4. here’s the virutal host info (note: this is my WHOLE virtual host for this site on the forwarding server!):
    NameVirtualHost *
    <VirtualHost>
    ServerName www.neatserver.com
    DocumentRoot /var/www/neatserver
    ProxyRequests Off
     
    <proxy> 
    Order deny,allow
    Allow from all 
    </proxy>
     
    ProxyPass / http://192.168.1.101/
    ProxyPassReverse / http://192.168.1.101/
    </VirtualHost>
  5. enable the site in apache
    sudo a2ensite neatserver
  6. Restart Apache, and it Should (might) work!
    sudo apache2 -k restart

Tags: Uncategorized

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment