httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jez Hancock <jez.hanc...@munk.nu>
Subject Re: [users@httpd] servername in VirtualHost
Date Tue, 09 Mar 2004 06:50:25 GMT
On Tue, Mar 09, 2004 at 12:06:58AM -0400, romeo wrote:
>  If I visit my local site with it's domain and a trailing slash
> ( example.com/b/ )all links are ok. It shows me a "fancy" index ( i have 
> no index file in there).
> 
> But if I visit example.com/b the links go to 127.0.0.1

This is no surprise, you're asking apache for the file called 'b' that
resides in the document root - unless you put a trailing '/' on the
request, you won't get the directory contents of 'b'.  


> I have one virtual host defined, I think that the server should use the 
> servername in the Vhost to create the autoreferencing link in the second 
> case. Right? Thanks in advance for your comments. Bye.
> 
> httpd.conf:
> 
> no listen directives
> no bindaddress
> 
> port 80

If you have virtual host entries set up you can remove this from the
main part of the config file:
> ServerName 127.0.0.1

In any event it doesn't make a lot of sense anyway - f you really want
something like this use: 

ServerName localhost

> UseCanonicalName Off
> 
> ### Section 3: Virtual Hosts
> 

Change this to the _IP address_ (NOT fully qualified domain name) you
want to do name based vhosting on:
> NameVirtualHost example.com

ie if you just want to use any available address:port, use:

NameVirtualHost *:*

Change this to the interface you want to host the vhost on:
> <VirtualHost example.com>

ie if you want to host it on any available address:port, use:

<VirtualHost *:*>

>     ServerAlias *.example.com
>     ServerAdmin admin@my.domain
>     DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"
>     ServerName example.com
> </VirtualHost>


-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - Another FreeBSD Diary
http://ipfwstats.sf.net/        - ipfw peruser traffic logging

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message