httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony G. Atkielski" <>
Subject Re: [users@httpd] Accessing web pages on tthe server by domain name.
Date Tue, 25 Jan 2005 20:17:23 GMT
ugunja ugunja wrote:

>I have apache running on FC1 and I acan access the web pages by ip address
>of the server http://192.168.0.x but I am unable to configure the server so
>that I can access the web pages by domain name e.g.
>Any help how to configure it?

Use NameVirtualHost to specify the IP address(es) on which you want to
handle name-based hosts, like this:


You can put an asterisk if you want to accept named-based requests on
all IP addresses.

You then specify specific addresses in <VirtualHost> sections for each
domain name, and you use ServerName to say which host is served by which
section.  For example (this is how my configuration does it):

NameVirtualHost *:80  [anything on port 80 can be name based]
<VirtualHost *:80>  [first domain to be served]
ServerName  [domain name to be served]

<VirtualHost *:80>  [second domain to be served]
ServerName  [domain name to be served]

The first virtual host is the one that gets served if Apache can't find
a match on the server name for any virtual host.  In the above
configuration, Apache accepts any request on any IP address, provided
it's for port 80.  It then looks down the list of virtual hosts and
picks the one that has a ServerName or ServerAlias that matches the
domain name provided by the calling client, and serves that (if none
match, the first virtual host is served).


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message