Re: [SLUG] Alias my Loopback?

From: Russ Wright (rwrigh10@tampabay.rr.com)
Date: Fri Jun 06 2003 - 09:33:44 EDT


Okay

Here is the relevant section from my httpd.conf. I don't think I did it
right. What do I need to change?

Regards
Russ

---------------

#
# Use name-based virtual hosting.
#
NameVirtualHost 127.0.0.1

# Where do we put the lock and pif files?
LockFile "/var/lock/httpd.lock"
CoreDumpDirectory "/etc/httpd"

# Defaults for virtual hosts

# Logs

#
# Virtual hosts
#

# Virtual host Default Virtual Host
<VirtualHost *>
         ServerName localhost

         ServerSignature email

        DirectoryIndex index.php index.html index.htm index.shtml

         ServerSignature email

         LogLevel warn
         HostNameLookups off

</VirtualHost>

# Virtual host arias.localhost
<VirtualHost 127.0.0.1>
         DocumentRoot /var/www/html/arias

         ServerAdmin webmaster@localhost.com
         ServerName http;//arias.localhost.com

         ServerSignature email

        DirectoryIndex index.php index.html index.htm index.shtml

         ServerSignature email

</VirtualHost>

On Thu, 2003-06-05 at 23:04, Andrew M Hoerter wrote:
> On 5 Jun 2003, Russ Wright wrote:
>
> > So I figure, I'll create virtual hosts and set up different Document
> > Roots for each of them...right? So I have multiple choices for virtual
> > hosts.I can have an IP based or a name based. However, both require an
> > IP address.
>
> You're on the right track, but it's a little less complicated than you
> seem to think. For each virtual host, have a stanza like this in your
> Apache config file:
>
> <VirtualHost *>
> ServerName www.foo.example.com
> DocumentRoot /some/where/else
> # other directives go here, bla bla bla
> </VirtualHost>
>
> Before all the VirtualHost entries, you want this directive:
>
> # Generic binding for anything not matched by a more specific entry
> NameVirtualHost *
>
> In effect, this stuff says to "listen" for virtual host connections on all
> available IP addresses, and then dispatch each request to an appropriate
> VirtualHost entry depending on the name in the HTTP request (name-based
> virtual hosting).
>
> Now, you only need to make sure that "www.foo.example.com" (or whatever
> your virtual host is) correctly resolves to an IP address that corresponds
> to your machine. This can be 127.0.0.1 if you want, assuming Apache is
> binding to your loopback address (which I'm pretty sure is the default).
> You could place an entry in your /etc/hosts file, in DNS, or whatever is
> appropriate for your situation. If other machines on a network will need
> to access these virtual hosts, then obviously you will want to put a real
> address in DNS.
>
> HTH.

-- 
Russ Wright <rwrigh10@tampabay.rr.com>



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 16:17:10 EDT