Hi.

The big thing about ServerName in 2.0 is that it has taken over for the Port
directive from 1.3. So, the following config means that the server
listens on 127.0.0.1, port 8080, but reports itself as foo.com on port 80.

<VirtualHost 127.0.0.1:8080>
    ServerName foo.com:80
</VirtualHost>

That reporting is done whenever the server creates a self-referential
URL, which is done by mod_dir, and in all error pages among other
places in the code.

The ServerName directive NEVER controls the port that the server 
actuall listens on.

Ryan

On Wednesday 12 December 2001 10:16 am, HARADA,LIZA (HP-Cupertino,ex1) wrote:
> Hello there,
>
> I am trying to understand the VirtualHost directives for Apache 2.0,
> specifically with regards to specifying the port. With ServerName directive
> now able to specify ports, it brings another element into the picture. Does
> it make a difference if the port is specified in the <VirtualHost
> my.ip.addr.here:port> or in the ServerName my.domain.here:port ? What about
> if there are multiple ip addresses/ports specified in the Virtual Host? How
> does that affect the ServerName? Is it best to specify the multiple
> ports/ip in the VirtualHost directive and then leave the ServerName with
> only the domain.name and no port?
> I hope this makes sense.
>
> Here is an example :
>           ...
>           Listen 1.2.3.4:80
>           Listen 1.2.3.5:8080
>           ServerName server.domain.com
>
>           <VirtualHost 1.2.3.4:80>    #VHOST 1
>           DocumentRoot /www/domain
>           ServerName www.domain.com
>           ...
>           </VirtualHost>
>
>           <VirtualHost 1.2.3.5:8080>  # VHOST 2
>           ServerName other.domain.com
>           ...
>           </VirtualHost>
>
> Can VHOST 1 be specified instead:
>           <VirtualHost 1.2.3.4>    #VHOST 1
>           DocumentRoot /www/domain
>           ServerName www.domain.com:80
>           ...
>           </VirtualHost>
>
> or would it be legal to do this?:
>           <VirtualHost 1.2.3.4:80 1.2.3.5:8080>    #VHOST 1
>           DocumentRoot /www/domain
>           ServerName www.domain.com:??           #maybe no port specified?
>           ...
>           </VirtualHost>
>
> Thanks in advance,
> Liza

-- 

______________________________________________________________
Ryan Bloom                              [EMAIL PROTECTED]
Covalent Technologies                   [EMAIL PROTECTED]
--------------------------------------------------------------

Reply via email to