mardi 8 avril 2014

Comportement étrange des hôtes virtuels Apache - débordement de pile


I have a virtual - host file containing the following:


# lc.glsamcrm.com
#

<VirtualHost *:80>
ServerAdmin webmaster@lc.glsamcrm.com
ServerName lc.glsamcrm.com
ServerAlias glsamcrm.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm/htdocs/
ErrorLog /var/www/glsamcrm/logs/error.log
CustomLog /var/www/glsamcrm/logs/access.log combined

ServerAdmin webmaster@crm.glstest.com
ServerName crm.glstest.com
ServerAlias crm.glstest.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm_prod/htdocs/
ErrorLog /var/www/glsamcrm_prod/logs/error.log
CustomLog /var/www/glsamcrm_prod/logs/access.log combined
</VirtualHost>

when I point my browser to lc.glsamcrm.com all works fine. When I point my browser to crm.glstest.com, I get the "THIS WORKS" index page located in the etc/www/ folder. What is going on?




You need two separate VirtualHost directives. This is because you can only put one ServerName, DocumentRoot, and a few others per VirtualHost.


<VirtualHost *:80>
ServerAdmin webmaster@lc.glsamcrm.com
ServerName lc.glsamcrm.com
ServerAlias glsamcrm.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm/htdocs/
ErrorLog /var/www/glsamcrm/logs/error.log
CustomLog /var/www/glsamcrm/logs/access.log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@crm.glstest.com
ServerName crm.glstest.com
ServerAlias crm.glstest.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm_prod/htdocs/
ErrorLog /var/www/glsamcrm_prod/logs/error.log
CustomLog /var/www/glsamcrm_prod/logs/access.log combined
</VirtualHost>


I have a virtual - host file containing the following:


# lc.glsamcrm.com
#

<VirtualHost *:80>
ServerAdmin webmaster@lc.glsamcrm.com
ServerName lc.glsamcrm.com
ServerAlias glsamcrm.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm/htdocs/
ErrorLog /var/www/glsamcrm/logs/error.log
CustomLog /var/www/glsamcrm/logs/access.log combined

ServerAdmin webmaster@crm.glstest.com
ServerName crm.glstest.com
ServerAlias crm.glstest.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm_prod/htdocs/
ErrorLog /var/www/glsamcrm_prod/logs/error.log
CustomLog /var/www/glsamcrm_prod/logs/access.log combined
</VirtualHost>

when I point my browser to lc.glsamcrm.com all works fine. When I point my browser to crm.glstest.com, I get the "THIS WORKS" index page located in the etc/www/ folder. What is going on?



You need two separate VirtualHost directives. This is because you can only put one ServerName, DocumentRoot, and a few others per VirtualHost.


<VirtualHost *:80>
ServerAdmin webmaster@lc.glsamcrm.com
ServerName lc.glsamcrm.com
ServerAlias glsamcrm.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm/htdocs/
ErrorLog /var/www/glsamcrm/logs/error.log
CustomLog /var/www/glsamcrm/logs/access.log combined
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@crm.glstest.com
ServerName crm.glstest.com
ServerAlias crm.glstest.com
DirectoryIndex index.html
DocumentRoot /var/www/glsamcrm_prod/htdocs/
ErrorLog /var/www/glsamcrm_prod/logs/error.log
CustomLog /var/www/glsamcrm_prod/logs/access.log combined
</VirtualHost>

0 commentaires:

Enregistrer un commentaire