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.
- Enable mod proxy and mod http_proxy with:
sudo a2enmod proxy
sudo a2enmod http_proxy
- Create a blank virtual host in your sites-available:
sudo touch /etc/apache2/sites-available/neatserver
- Open the virtual server (i use ssh into a graphical desktop - it allows copy & paste!):
sudo nano /etc/apache2/sites-available
- 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>
- enable the site in apache
sudo a2ensite neatserver
- Restart Apache, and it Should (might) work!
sudo apache2 -k restart

0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment