Afficher un message
Vieux 20/03/2005, 17h34   #2
David Efflandt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to configure the right ServerName?

On 19 Mar 2005, laredotornado@zipmail.com <laredotornado@zipmail.com> wrote:
> Hello, On my Fedora Core 2 Linux system, I have just installed Apache
> 1.3.33 and PHP 4. I would like calls to the PHP variable,
> "$_SERVER['SERVER_NAME']" to result in the name of my server, but right
> now, they're returning "localhost.localdomain."
>
> I do have the following configured in httpd.conf and I've restarted
> Apache a number of times with these options
>
> UseCanonicalName On
>
> # General setup for the virtual host
> DocumentRoot "/usr/local/apache/htdocs"
> ServerName myhost.mydomain.org
> ServerAdmin laredotornado@neko.no-ip.org
> ErrorLog /usr/local/apache/logs/error_log
> TransferLog /usr/local/apache/logs/access_log
>
> Are there other directives I need to insert/change? Thanks, - Dave


See docs for UseCanonicalName. Off is usually better for vhosts, so any
automatic redirects go to the requested host instead of main ServerName.

Since this virtual host appears to occupy the same system path as apache
default, what makes you think (or confirm) that your virtual host is
working? Is the IP specified in <VirtualHost IP> an IP actually on that
PC? If the IP is dynamic or the public side of a router, perhaps you need
wildcard NameVirtualHost * and <VirtualHost *>.
  Réponse avec citation
 
Page generated in 0,05034 seconds with 9 queries