httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Virtualhost
Date Wed, 01 Sep 2004 09:29:11 GMT
> -----Original Message-----
> From: Luis Moreira [mailto:luis.moreira@esinnovation.pt]
> Sent: Mittwoch, 1. September 2004 10:58
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Virtualhost
> 
> 
> You have three VHs, all pointing to the same IP/port

I guess you mean "you have three domain-names, all pointing to the same
IP/port"
                                 ^^^^^^^^^^^^   

> When Apache gets a request, it will go to the first one that matches.
> You need to either have different IPs, different ports or 
> different names.

Exactly.

> 
> Assuming you keep port 80, thismeans something like
> 
> <VirtualHost A-site:80>
>     DocumentRoot /home/A/www
> </VirtualHost>

Not so wise... If you mean to put a domain-name in as "A-site" then this
is not the way to do it. A-site, B-site etc will resolve to the same IP
address (eg 192.168.1.1) and so it will be as if you had written:

<VirtualHost 192.168.1.1:80>
    DocumentRoot /home/A/www
</VirtualHost>

<VirtualHost 192.168.1.1:80>
    DocumentRoot /home/B/www
</VirtualHost>

ie, all VHs are the same and so apache serves the first one.

In any case, it is a bad idea to use a domain name in a VH definition
since it makes apache depend on DNS at start-up. If DNS is down for
whatever reason, apache will not start. Also, it's slow...

If all domains have the same IP then you must use name-based
virtual-hosting:

NameVirtualHost 192.168.1.1

<VirtualHost 192.168.1.1:80>
    ServerName A-site
    DocumentRoot /home/A/www
</VirtualHost>

<VirtualHost 192.168.1.1:80>
    ServerName B-site
    DocumentRoot /home/B/www
</VirtualHost>

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 



> 
> <VirtualHost B-site:80>
>     DocumentRoot /home/B/www
> </VirtualHost>
> 
> <VirtualHost C-site:80>
>     DocumentRoot /home/C/www
> </VirtualHost>
> 
> The names "A-site", "B-site" and "C-site" would then point to 
> the same IP
> 
> 
> I think you can also use "redirect", but I don't know how.
> Anyway, RTFM (F stands for Friendly) :-)
> 
> Hope this helps
> 
> 
> Luis
> 
> 
> asiani@wanadoo.fr wrote:
> 
> > Hello !
> >
> > Don't forget me !
> > I don't understand why it does not run :))
> >
> > Alain
> >
> >>
> >> Hello
> >>
> >> I created 3 domain at ulimit.com
> >>
> >> A.euro.st
> >> B.euro.st
> >> C.fr.st
> >>
> >> ===================================
> >> I created 3 users on my Fedora linux box
> >>
> >> A
> >> B
> >> C
> >>
> >> ===================================
> >> I set right with :
> >>
> >> chmod -R 750 ...
> >> chown -R A.apache...etc...
> >>
> >> ===================================
> >> I added to the end of httpd.conf
> >>
> >> <Directory /home/*/www>
> >>  Options Indexes FollowSymLinks
> >>  <IfModule mod_access.c>
> >>   Order allow,deny
> >>   Allow from all
> >>  </IfModule>
> >> </Directory>
> >> Include conf/vhost.conf
> >> ===================================
> >>
> >> I created vhost.conf
> >>
> >>
> >> NameVirtualHost 80.10.20.30:80
> >>
> >> <VirtualHost 80.10.20.30:80>
> >>     ServerAdmin asiani@free.fr <mailto:asiani@free.fr>
> >>     DocumentRoot /home/A/www
> >>     ServerName www.A.euro.st <http://www.A.euro.st>
> >>     ServerPath /A
> >>     ErrorLog logs/A-error_log
> >>     ServerAlias A.euro.st
> >> </VirtualHost>
> >>
> >> <VirtualHost 80.10.20.30:80>
> >>     ServerAdmin asiani@free.fr <mailto:asiani@free.fr>
> >>     DocumentRoot /home/B/www
> >>     ServerName www.B.euro.st <http://www.B.euro.st>
> >>     ServerPath /B
> >>     ErrorLog logs/B-error_log
> >>     ServerAlias B.euro.st
> >> </VirtualHost>
> >>
> >> <VirtualHost 80.10.20.30:80>
> >>     ServerAdmin asiani@free.fr <mailto:asiani@free.fr>
> >>     DocumentRoot /home/C/www
> >>     ServerName www.C.fr.st <http://www.C.fr.st>
> >>     ServerPath /C
> >>     ErrorLog logs/C-error_log
> >>     ServerAlias C.fr.st
> >> </VirtualHost>
> >>
> >>
> >> ===================================
> >>
> >> I restart httpd
> >>
> >> service httpd restart
> >>
> >> All is ok !
> >>
> >> ===================================
> >>
> >> I tried to go to my IP with internet explorer :
> >>
> >> http://80.10.20.30
> >>
> >> The domain A is opened
> >> access.log :
> >> 192.168.0.2 - - [31/Aug/2004:20:34:46 +0200] "GET / 
> HTTP/1.1" 200 11 
> >> "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FREE; .NET 
> >> CLR 1.1.4322)"
> >>
> >> I tried to go to : http://www.A.euro.st
> >> The domain A is opened
> >> access.log
> >> 192.168.0.2 - - [31/Aug/2004:20:35:49 +0200] "GET / 
> HTTP/1.1" 200 11 
> >> "http://www.A.euro.st" "Mozilla/4.0 (compatible; MSIE 6.0; 
> Windows NT 
> >> 5.1; FREE; .NET CLR 1.1.4322)"
> >>
> >> I tried to go to : http://www.B.euro.st
> >> The domain A is opened
> >> access.log
> >> 192.168.0.2 - - [31/Aug/2004:20:36:47 +0200] "GET / 
> HTTP/1.1" 200 11 
> >> "http://www.B.euro.st" "Mozilla/4.0 (compatible; MSIE 6.0; 
> Windows NT 
> >> 5.1; FREE; .NET CLR 1.1.4322)"
> >>
> >> I tried to go to : http://www.C.euro.st
> >> The domain A is opened
> >> access.log
> >> 192.168.0.2 - - [31/Aug/2004:20:37:38 +0200] "GET / 
> HTTP/1.1" 200 11 
> >> "http://www.C.fr.st" "Mozilla/4.0 (compatible; MSIE 6.0; 
> Windows NT 
> >> 5.1; FREE; .NET CLR 1.1.4322)"
> >>
> >>  
> >>
> >>
> >> configuration :
> >> Linux localhost.localdomain 2.4.22-1.2115.nptl #1 Wed Oct 
> 29 15:31:21 
> >> EST 2003 i686 athlon i386 GNU/Linux
> >>
> >> [root@localhost www]# httpd -v
> >> Server version: Apache/2.0.47
> >> Server built:   Oct 23 2003 06:48:44
> >>
> >>  
> >>
> >> I would like to go on the right domain !!!
> >> Please help me !
> >> Thanks,
> >> Alain S.
> >>
> >>
> >>
> >> 
> --------------------------------------------------------------
> --------------------------------------------------------------
> ------------------ 
> >>
> >>
> >>     > Message du 31/08/04 16:36
> >>     > De : "Robert Andersson"
> >>     > A : users@httpd.apache.org
> >>     > Copie à :
> >>     > Objet : Re: [users@httpd] Virtualhost
> >>     > [When starting a new topic, don't reply to another mail]
> >>     >
> >>     > asiani@wanadoo.fr wrote:
> >>     > > i tried with apache documentation, with lea-linux.org
> >>     documentation
> >>     > > it seems to be very simple but it doesn't run !
> >>     >
> >>     > Ok, interesting to know...
> >>     >
> >>     > ...
> >>     >
> >>     > If you want help, you must provide information. What 
> do you want
> >>     to do? What
> >>     > did you try, and in what way did that not match your 
> expectaions?
> >>     >
> >>     > Regards,
> >>     > Robert Andersson
> >>     >
> >>     >
> >>     >
> >>     
> >> 
> ---------------------------------------------------------------------
> >>     > The official User-To-User support forum of the Apache HTTP
> >>     Server Project.
> >>     > See for more info.
> >>     > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >>     > " from the digest: users-digest-unsubscribe@httpd.apache.org
> >>     > For additional commands, e-mail: users-help@httpd.apache.org
> >>     >
> >>     >
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server 
> > Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
> 
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
e-mail is of a private and personal nature. It is not related to the
exchange or business activities of the SWX Group. Le présent e-mail est
un message privé et personnel, sans rapport avec l'activité boursière du
Groupe SWX.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message