l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Apr 11 14:52

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Apache virtual host config
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Apache virtual host config

Lewis, thanks.

I kept looking at this.  I liked the fact that you used two virtual
hosts.  Previously, dirac.org was "global", and liberal.ws was a virtual
host.  I changed my configuration to look more like yours.

Still, it wouldn't work.

but then i noticed your IP address.  You obviously have DSL or cable and
have a machine performing masquerading as well as firewalling.  You used
your internal IP address.

I was using my external IP address.

I changed to:


   ServerAdmin p@dirac.org
   DocumentRoot "/www/p/linux"
   ServerName www.liberal.ws
   ServerAlias liberal.ws
   ErrorLog /var/log/apache/test_error
   LogLevel warn
   CustomLog /var/log/apache/test_access common

   ServerAdmin p@dirac.org
   DocumentRoot "/www"
   ServerName www.dirac.org
   ServerAlias dirac.org
   ErrorLog /var/log/apache/error.log
   LogLevel warn
   CustomLog /var/log/apache/access.log combined

and everything works as it should work.  Note that there were two

1. NameVirtualHost wants to be the internal IP address.
2. In <VirtualHost X>, X wants to be the internal IP address.  Hostname
   didn't work correctly.  External IP address didn't work correctly.

In hindsight, it only makes sense that apache cares about the internal
IP address, since that's the "real" address of the machine in question.
The external IP is only known by the router/firewall.

Lewis, thanks.  I've definitely learned something in the process...


On Sun 11 Apr 04,  9:19 AM, Lewis Perdue <lperdue@ideaworx.com> said:
>    make sure apache is configured for NAME-BASED virtual hosting, NOT
>    IP-BASED ...
>    make sure you have the _true_ document directory as opposed to virtual ...
>    pwd will not always show that
>    If your documents are relying on symbolic links, make sure the server
>    allows them
>    Below are a few lines from the httpd.conf file off the RH9/Apache2 server
>    we run off the LAN at home. They may help you. our IP's are all local
>    beause they are behind the router.
>    #
>    # Use name-based virtual hosting.
>    #
>    NameVirtualHost
>    <VirtualHost>
>        ServerAdmin william@williamperdue.com
>        DocumentRoot "/home/lperdue/public_html/perdueweb"
>        ServerName www.perdueweb.com
>        ServerAlias perdueweb.com
>        ErrorLog logs/perdueweb-error_log
>        TransferLog logs/perdueweb-error_log
>    </VirtualHost>
>    <VirtualHost>
>        ServerAdmin william@williamperdue.com
>        DocumentRoot "/home/lperdue/public_html/katherineperdue"
>        ServerName www.katherineperdue.com
>        ServerAlias katherineperdue.com
>        ErrorLog logs/katherineperdue-error_log
>        TransferLog logs/katherineperdue-error_log
>    </VirtualHost>
>    #
>    #
>    # DirectoryIndex: sets the file that Apache will serve if a directory
>    # is requested.
>    #
>    # The index.html.var file (a type-map) is used to deliver content-
>    # negotiated documents.  The MultiViews Option can be used for the
>    # same purpose, but it is much slower.
>    #
>    DirectoryIndex index.html index.html.var

Make everything as simple as possible, but no simpler.  -- Albert Einstein
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.