PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > how to configure the right ServerName?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

how to configure the right ServerName?

Réponse
 
LinkBack Outils de la discussion
Vieux 20/03/2005, 01h16   #1
laredotornado@zipmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how to configure the right ServerName?

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

  Réponse avec citation
Vieux 20/03/2005, 16h34   #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
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h04.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07253 seconds with 10 queries