[TriLUG] apache: different DocumentRoot for different IPs

Joseph Mack NA3T jmack at wm7d.net
Sun May 13 09:34:15 EDT 2012


One my routers at home. I have an httpd (apache-2.x) 
listening on the internal IPs. I'd like to have an httpd 
listening on the external IP as well.

The external IP will show webcams, but I want a different 
DocumentRoot, so that people coming in from the outside 
don't have access to my inside stuff.

The DocumentRoot at the top of the httpd.conf is

DocumentRoot /usr/local/etc/httpd/htdocs

I added a para, with a different DocumentRoot listening to 
the external IP, to my httpd.conf like this

Listen DEFAULT_GW_IP:80
<VirtualHost webcams.mack.net>
         ServerName webcams.mack.net
         DocumentRoot /usr/local/etc/httpd/htdocs/webcams
         ServerAdmin root at dennis.mack.net
         ErrorLog /var/log/error_log
         TransferLog /var/log/access_log
</VirtualHost>

This added para has "/webcams" added at the end of 
DocumentRoot. I expected that when I surf to $DEFAULT_GW_IP 
to get the new DocumentRoot, but I get the DocumentRoot at 
the top of the httpd.conf file.

Looking at apachectl, it doesn't seem that I can have to 
separate httpd.conf files and hence two httpds listening on 
separate IPs.

Any suggestions on how to get a different DocumentRoot for 
the httpd listening on DEFAULT_GW_IP?

Thanks
Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list