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 > NameVirtualHost doesn't work
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

NameVirtualHost doesn't work

Réponse
 
LinkBack Outils de la discussion
Vieux 29/03/2005, 23h25   #1 (permalink)
Shabam
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut NameVirtualHost doesn't work

Why won't this work? All I can get is the first virtual host to work.






NameVirtualHost 192.168.0.3


###################################### IMG.COM.test.com
##############################

<VirtualHost 192.168.0.3>

ServerName img.com.test.com
ServerAdmin webmaster@test.com
DocumentRoot /www/whatever/htdocs/com
CustomLog /www/whatever/logs/access_log combined
ErrorLog /www/whatever/logs/error_log

UseCanonicalName Off

<Directory /www/whatever/htdocs/com>
Options Indexes
DirectoryIndex index.html index.htm Index.htm Index.html INDEX.HTM
INDEX.HTML


</Directory>

</VirtualHost>

################################################## ##########################
##########


###################################### IMG.test.com
##################################

<VirtualHost 192.168.0.3>

ServerName img.test.com
ServerAdmin webmaster@test.com
DocumentRoot /www/whatever/htdocs
CustomLog /www/whatever/logs/access_log combined
ErrorLog /www/whatever/logs/error_log

UseCanonicalName Off

<Directory /www/whatever/htdocs>
Options Indexes
DirectoryIndex index.html index.htm Index.htm Index.html INDEX.HTM
INDEX.HTML

</Directory>

</VirtualHost>


################################################## ##########################
#########


  Réponse avec citation
Vieux 30/03/2005, 02h38   #2 (permalink)
David Efflandt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: NameVirtualHost doesn't work

On Tue, 29 Mar 2005 15:25:13 -0800, Shabam <chalupa@yomama-nospam.com> wrote:
> Why won't this work? All I can get is the first virtual host to work.


From where, another PC on your LAN? How does browser resolve the virtual
host names (hosts file on client, or local DNS)? Of course you should not
really use test.com because that is a real domain.

If you actually wanted to access these virtual hosts from internet with
names that resolve to your public IP and server on private behind NAT
router, you would likely need to use wildcard NameVirtualHost * and
<VirtualHost *> sections.

> NameVirtualHost 192.168.0.3


It may be best to put UseCanonicalName Off here in main section, to make
sure that automatic redirects would go to requested virtual host instead
of default (first) vhost.

> ###################################### IMG.COM.test.com
> ##############################
>
><VirtualHost 192.168.0.3>
>
> ServerName img.com.test.com
> ServerAdmin webmaster@test.com
> DocumentRoot /www/whatever/htdocs/com
> CustomLog /www/whatever/logs/access_log combined


Where do you define LogFormat for "combined"? You might instead try:
CustomLog /www/whatever/logs/access_log "%V %h %l %u %t \"%r\" %>s %b"

And see what requested virtual host shows up in first slot (%V)

> ErrorLog /www/whatever/logs/error_log
>
> UseCanonicalName Off
>
><Directory /www/whatever/htdocs/com>
> Options Indexes
> DirectoryIndex index.html index.htm Index.htm Index.html INDEX.HTM
> INDEX.HTML
>
>
></Directory>
>
></VirtualHost>
>
> ################################################## ##########################
> ##########
>
>
> ###################################### IMG.test.com
> ##################################
>
><VirtualHost 192.168.0.3>
>
> ServerName img.test.com
> ServerAdmin webmaster@test.com
> DocumentRoot /www/whatever/htdocs
> CustomLog /www/whatever/logs/access_log combined
> ErrorLog /www/whatever/logs/error_log
>
> UseCanonicalName Off
>
><Directory /www/whatever/htdocs>
> Options Indexes
> DirectoryIndex index.html index.htm Index.htm Index.html INDEX.HTM
> INDEX.HTML
>
></Directory>
>
></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 23h19.


Édité par : vBulletin® version 3.7.2
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
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08293 seconds with 10 queries