Re: natted apache2 virtual hosts

From: David Efflandt (efflandt_at_xnet.com)
Date: 05/24/04


Date: Mon, 24 May 2004 18:06:15 +0000 (UTC)

On Mon, 24 May 2004 05:10:54 GMT, dave <dmehler26@woh.rr.com> wrote:
> Hello,
> I've got an apache web server behind a natted firewall. The server's IP
> address is 192.168.0.3, my external IP is for example sake 111.222.333.444,
> my configuration is below. Both the server and the router are Freebsd 4.9
> systems.
> My problem is i ssh to a machine outside my network, a linux box, then use
> lynx like so:
> www.site2.com
> it makes the http request to 111.222.333.444 but instead of delivering my
> www.site2.com page, i get my primary site, the www.site2.com might as well
> not exist.
> The maintainer of site2.com has set up a dns pointer externally pointing to
> my system, and on my internal dns server i've got a zone for site2.com. If i
> do:
> host www.site2.com
> i get the IP address of 192.168.0.3. And from my internal network if i do
> lynx like so:
> lynx www.site2.com
> it works fine.
> Here is my configuration.
>
> vhost.conf (included in httpd.conf where virtual host definitions are
> stored.)

You might want to try wildcard NameVirtualHost * and <VirtualHost *>
sections (without specifying port, since it is default port). But you may
need UseCanonicalName off. You might also need to use bogus main
ServerName, but that may have been due to my nameless worm catching
default vhost (if main ServerName matched one of the name based vhosts,
things did not work right).

> NameVirtualHost 192.168.0.3:80
><VirtualHost 192.168.0.3:80>
> ServerName www.site1.com
> ServerAlias site1.com *.site1.com
> DocumentRoot /usr/local/www/data
></VirtualHost>
>
><VirtualHost 192.168.0.3:80>
> ServerName www.site2.com
> ServerAdmin webmaster@site2.com
> DocumentRoot /usr/local/www/site2.com/data
> ErrorLog /usr/local/www/site2.com/logs/error_log
> TransferLog /usr/local/www/site2.com/logs/access_log
> ScriptAlias /cgi-bin/ "/usr/local/www/site2.com/cgi-bin/"
><directory /usr/local/www/site2.com>
> options ExecCGI Indexes SymLinksIfOwnerMatch
> AllowOverride AuthConfig Limit
></directory>
></VirtualHost>
>
>
> #httpd -S
> VirtualHost configuration:
> 192.168.0.3:80 is a NameVirtualHost
> default server www.site1.com (/usr/local/etc/apache2/vhosts.conf:2)
> port 80 namevhost www.site1.com
> (/usr/local/etc/apache2/vhosts.conf:2)
> port 80 namevhost
> www.site2.com(/usr/local/etc/apache2/vhosts.conf:8)
> Syntax OK
>
>
> #apachectl -t
> Syntax OK
>
> Any help appreciated.
> Thanks.
> Dave.
>
>

-- 
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/


Relevant Pages

  • Re: apache virtual host configuration...
    ... The syntax for virtual hosts configuration seems to have changed... ... ServerName foo.bar ... I could make the virtual host foo.bar work again by ...
    (Debian-User)
  • Re: [Apache] Vhost with mod_rewrite
    ... I have looked the documentation of apache with your url and i created ... ServerName %0 ... Apache is down with this configuration... ...
    (Debian-User)
  • Extended MAPI Fun
    ... When creating the temporaryprofile and calling configureMsgService, ... i tripple checked and the servername is supplied. ... The mailboxname is correctly displayed in the configuration dialog, ... if Failedthen exit; ...
    (comp.lang.pascal.delphi.misc)
  • apache virtual host configuration...
    ... The syntax for virtual hosts configuration seems to have changed... ... ServerName foo.bar ... I could make the virtual host foo.bar work again by ...
    (Debian-User)
  • Re: [Apache] Vhost with mod_rewrite
    ... I don't want tu use a perl script or in any other language, ... don't want to relod apache each time i add a domain or a sub-domain. ... My goal is to do the configuration just one time and after never modify it. ... >> ServerName www.domaine.tld ...
    (Debian-User)