I have ServerName and ServerAlias directives, inside the VirtualHost
directives. I use <VirtualHost _default_:8080> or <VirtualHost
192.168.3.125:8080>, they both work. I never put <VirtualHost
servername.com:8080>. To be more specific, I use
listen 192.168.3.125:8080
listen 192.168.3.126:8080
<VirtualHost _default_:8080>
Port 80
ServerName www.servername.com
ServerAlias servername.com mail.servername.com
</VirtualHost>
<VirtualHost 192.168.3.126:8080>
Port 80
ServerName www.servername2.com
ServerAlias servername2.com mail.servername2.com
</VirtualHost>
[repeat for ssl sites]
To resond to the second part, apache "knows" about port 80 and so requests get
rewritten like this:
http://servername2.com/graphics
becomes
http://www.servername2.com/graphics/
NOT
http://www.servername2.com:80/graphics/
apache ignores/drops the ':80' cause its implied (how nice)
Hope this helps,
Chris
"Gary Reid (cars-sold)" wrote:
> do you have the servername directive in your virtual host directive plus the
> server alias in there too or just the main servername? as putting in virtual
> host it should work whether port 80 or 8080 - this would then cover both www
> and none www requests without the trailing slash - I would imagine adding
> Port 80 (which I think is a different issue to the missing trailing slash
> rewrite) to the virtual host without the servername and server alias would
> just result in rewriting to http://servername.com:80/graphics/ if the
> trailing slash wasn't added
>
> gary
>
> > You are partly correct, the servername directive is important, however i
> > have that specified already. Here is the fix to redirecting to the
> > [real] port:
> >
> > add this line to your virtual host:
> > Port 80
> >
> > and this to your ssl virtual:
> > Port 443
> >
> > mine are right above the ServerName.
> <SNIP>