Apache Server configuration support - Help on Virtual Host

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > November 2007 > Help on Virtual Host





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Help on Virtual Host
Le Souricier Gris

2007-11-20, 7:37 am

Hello everybody,

I want to create some virtual hosts on my web server so I add theses
lines to my httpd.conf :

NameVirtualHost 192.168.1.1

<VirtualHost intranet.mycompany.com>
ServerAdmin me@mycompany.com
DocumentRoot /var/www/html
ServerName intranet.mycompany.com
ErrorLog logs/intranet-error_log
</VirtualHost>

<VirtualHost toto.mycompagny.com>
ServerAdmin me@mycompany.com
DocumentRoot /var/www/toto
ServerName toto.mycompagny.com
ErrorLog logs/toto-error_log
</VirtualHost>

<VirtualHost other.mycompagny.com>
ServerAdmin me@mycompany.com
DocumentRoot /var/www/other
ServerName other.mycompagny.com
ErrorLog logs/scalpel-error_log
</VirtualHost>


When I Open my Internet Navigator on http://intranet.mycompany.com,
I've got the web site toto.mycompagny.com !!!

When I Open my Internet Navigator on http://other.mycompany.com,
That's ok

When I Open my Internet Navigator on http://toto.mycompany.com, That's
ok

I don't undestand !

Thanks for you help.

Le Souricier Gris

2007-11-20, 1:29 pm

On 20 nov, 13:43, Le Souricier Gris <lesouricierg...@gmail.com> wrote:
> Hello everybody,
>
> I want to create some virtual hosts on my web server so I add theses
> lines to my httpd.conf :
>
> NameVirtualHost 192.168.1.1
>
> <VirtualHost intranet.mycompany.com>
> ServerAdmin m...@mycompany.com
> DocumentRoot /var/www/html
> ServerName intranet.mycompany.com
> ErrorLog logs/intranet-error_log
> </VirtualHost>
>
> <VirtualHost toto.mycompagny.com>
> ServerAdmin m...@mycompany.com
> DocumentRoot /var/www/toto
> ServerName toto.mycompagny.com
> ErrorLog logs/toto-error_log
> </VirtualHost>
>
> <VirtualHost other.mycompagny.com>
> ServerAdmin m...@mycompany.com
> DocumentRoot /var/www/other
> ServerName other.mycompagny.com
> ErrorLog logs/scalpel-error_log
> </VirtualHost>
>
> When I Open my Internet Navigator onhttp://intranet.mycompany.com,
> I've got the web site toto.mycompagny.com !!!
>
> When I Open my Internet Navigator onhttp://other.mycompany.com,
> That's ok
>
> When I Open my Internet Navigator onhttp://toto.mycompany.com, That's
> ok
>
> I don't undestand !
>
> Thanks for you help.


Ok I find my mistake
http://httpd.apache.org/docs/2.0/vhosts/examples.html

J'ai trouv=E9 en effet j'avais vraiment mal =E9crit, httpd -S m'a bien
aid=E9 et j'ai utilis=E9 le lien HTML dans le fichier de conf de Apache
(RTFM je me l'applique) :

#
# Use name-based virtual hosting.
#
NameVirtualHost *
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.

<VirtualHost *>
ServerAdmin eric.berthomier@justice.fr
DocumentRoot /var/www/html
ServerName intranet.macompagnie.com
ErrorLog logs/intranet-error_log
</VirtualHost>

<VirtualHost *>
ServerAdmin eric.berthomier@justice.fr
DocumentRoot /var/www/scalpel
ServerName scalpel.macompagnie.com
ErrorLog logs/scalpel-error_log
</VirtualHost>

<VirtualHost *>
ServerAdmin eric.berthomier@justice.fr
DocumentRoot /var/www/webstat
ServerName webstat.macompagnie.com
ErrorLog logs/webstat-error_log
</VirtualHost>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com