PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > Multi WebHosting....
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Multi WebHosting....

Réponse
 
LinkBack Outils de la discussion
Vieux 30/01/2007, 23h18   #1
StephaneM
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Multi WebHosting....

Hi,

I can see something weird happening at the moment :

My Httpd conf file is :

UseCanonicalName On
DocumentRoot "/var/www/html"
<Directory "/var/www/html/">
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory "/var/www/html">

Also

<VirtualHost *:80>
ServerName www.aaaa.com
ServerAlias aaaa.com www.aaaa.com
ServerAdmin webmaster@aaaa.com
DocumentRoot /home/aaaa
ErrorLog logs/www.aaaaa_error_log
CustomLog logs/aaaa.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerName www.bbbb.com
ServerAlias bbbbo.uk www.bbbb.com localhost
ServerAdmin webmaster@bbbb.com
DocumentRoot /home/bbbb
ErrorLog logs/www.bbbb.com_error_log
CustomLog logs/www.bbbb.com_log common
</VirtualHost>

--------------------------------------

Here is my conifg.

If put 'localhost' as written -> No problem => go to display : www.bbbb.com

If I move 'localhost' from the website : www.bbbb.com ->www.aaaa.com
No problem, http://localhost will display the right website.

Now, If I remove completely "localhost" I should go to /var/www/html !?
But I don't, I go to www.aaaa.com !!!!!!!
Any idea why ??

I am using CentOS v4.4

Thanks and regards,

Stephane
  Réponse avec citation
Vieux 30/01/2007, 23h54   #2
shimmyshack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Multi WebHosting....

On 30 Jan, 22:18, StephaneM <Steph...@M.com> wrote:
> Hi,
>
> I can see something weird happening at the moment :
>
> My Httpd conf file is :
>
> UseCanonicalName On
> DocumentRoot "/var/www/html"
> <Directory "/var/www/html/">
> Options FollowSymLinks
> AllowOverride None
> </Directory>
>
> <Directory "/var/www/html">
>
> Also
>
> <VirtualHost *:80>
> ServerNamewww.aaaa.com
> ServerAlias aaaa.comwww.aaaa.com
> ServerAdmin webmas...@aaaa.com
> DocumentRoot /home/aaaa
> ErrorLog logs/www.aaaaa_error_log
> CustomLog logs/aaaa.com-access_log common
> </VirtualHost>
> <VirtualHost *:80>
> ServerNamewww.bbbb.com
> ServerAlias bbbbo.ukwww.bbbb.comlocalhost
> ServerAdmin webmas...@bbbb.com
> DocumentRoot /home/bbbb
> ErrorLog logs/www.bbbb.com_error_log
> CustomLog logs/www.bbbb.com_logcommon
> </VirtualHost>
>
> --------------------------------------
>
> Here is my conifg.
>
> If put 'localhost' as written -> No problem => go to display :www.bbbb.com
>
> If I move 'localhost' from the website :www.bbbb.com->www.aaaa.com
> No problem,http://localhostwill display the right website.
>
> Now, If I remove completely "localhost" I should go to /var/www/html !?
> But I don't, I go towww.aaaa.com!!!!!!!
> Any idea why ??
>
> I am using CentOS v4.4
>
> Thanks and regards,
>
> Stephane


the browser sends the name of the host in the url to apache at request
time,
apache then uses that value and compares it to vhosts, if no match
serves first one no matter what its called.


its in the docs (see "main host goes away" half way down):
http://httpd.apache.org/docs/2.2/en/...ame-based.html

I personally have this as the first one:

<VirtualHost 192.168.5.5:80>
ServerName default
DocumentRoot path_to/vhosts/192.168.5.5/public
</VirtualHost>
where 192.168.5.5 is the IP address my server is bound to (I dont bind
to all IPs I have instead a Listen 192.168.5.5:80 at start of conf)
this means if any http/1.0 requests is made (which DONT send the value
of the host from the url with the request), apache will not match
anything and serve up the file in the IP address/public folder - which
just says hello or whatever. I dont support http/1.0


check out also the use of _default_
http://httpd.apache.org/docs/2.2/en/...tml#servername


  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 21h16.


Édité par : vBulletin®
Copyright ©2000 - 2009, 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,10698 seconds with 10 queries