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 > Virtual Hosts
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

Virtual Hosts

Réponse
 
LinkBack Outils de la discussion
Vieux 12/02/2008, 15h41   #1
pjg281@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Virtual Hosts

Before I start I have little experience in apache and am in need of
your sound advice.

I have 2 websites pointing to my 1 ip. Now I understand that I need to
create a virtual host and I believe i have done so but get the
following error
[Tue Feb 12 15:34:00 2008] [warn] _default_ VirtualHost overlap on
port 80, the first has precedence
[Tue Feb 12 15:34:00 2008] [warn] _default_ VirtualHost overlap on
port 80, the first has precedence

Now I am trying to point my second website into a folder in my htdocs.
I have set up the virtual hosts but it still doesnt work. I am using a
windows machine with xampp. Please advise on how to fix this.

I have heard of editing a file namevirtualhosts. That doesnt exist on
my computer.

Thanks for reading and thanks if you can .


Many Thanks

Paul
  Réponse avec citation
Vieux 12/02/2008, 16h01   #2
Davide Bianchi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

On 2008-02-12, pjg281@googlemail.com <pjg281@googlemail.com> wrote:
> I have 2 websites pointing to my 1 ip. Now I understand that I need to
> create a virtual host and I believe i have done so but get the
> following error


Your configuration ain't right. If it was, you wouldn't receive an error.

> Thanks for reading and thanks if you can .


Let's see your configuration.

Davide

--
I think I'd like to see a Simpsons episode start up with Bart Simpson
writing 'I will not attempt to undermine the Usenet cabal'.
--J.D. Falk
  Réponse avec citation
Vieux 12/02/2008, 16h18   #3
phantom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

<pjg281@googlemail.com> wrote in message
news:cbc6913b-1ab1-42ba-a5e1-b29f7b5ac5d6@s12g2000prg.googlegroups.com...
> Before I start I have little experience in apache and am in need of
> your sound advice.
>
> I have 2 websites pointing to my 1 ip. Now I understand that I need to
> create a virtual host and I believe i have done so but get the
> following error
> [Tue Feb 12 15:34:00 2008] [warn] _default_ VirtualHost overlap on
> port 80, the first has precedence
> [Tue Feb 12 15:34:00 2008] [warn] _default_ VirtualHost overlap on
> port 80, the first has precedence
>
> Now I am trying to point my second website into a folder in my htdocs.
> I have set up the virtual hosts but it still doesnt work. I am using a
> windows machine with xampp. Please advise on how to fix this.
>
> I have heard of editing a file namevirtualhosts. That doesnt exist on
> my computer.


It is not a file, it is an apache directive and is required to avoid the
'overlap'.
The NameVirtualHost directive needs to match the info used in the
VirtualHost sections, it basically tells apache to look out for name based
virtual hosting on that IP/PORT combination.

NameVirtualHost <IP>:<PORT>
<VirtualHost <IP>:<PORT>>

example1:

NameVirtualHost 1.2.3.4:80

<VirtualHost 1.2.3.4:80>
ServerName server1
...
</VirtualHost>

<VirtualHost 1.2.3.4:80>
ServerName server2
...
</VirtualHost>

or example2 with wildcarded ip address:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName server1
...
</VirtualHost>

<VirtualHost *:80>
ServerName server2
...
</VirtualHost>


  Réponse avec citation
Vieux 12/02/2008, 17h52   #4
pjg281@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

Here is my current config
<VirtualHost *:80>
ServerName www.1website.co.uk
DocumentRoot /xampp/htdocs/
ServerAlias www.1website.co.uk
<Directory /xampp/htdocs/>
Options Indexes ExecCGI
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName www.2website.co.uk
DocumentRoot /xampp/htdocs/clancok/
ServerAlias www.2website.co.uk
<Directory /xampp/htdocs/2website/>
Options Indexes ExecCGI
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>

  Réponse avec citation
Vieux 12/02/2008, 17h53   #5
pjg281@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

On Feb 12, 5:52pm, pjg...@googlemail.com wrote:
> Here is my current config
> <VirtualHost *:80>
> ServerName www.1website.co.uk
> DocumentRoot /xampp/htdocs/
> ServerAliaswww.1website.co.uk
> <Directory /xampp/htdocs/>
> Options Indexes ExecCGI
> AllowOverride All
> Order allow,deny
> Allow from All
> </Directory>
> </VirtualHost>
> <VirtualHost *:80>
> ServerName www.2website.co.uk
> DocumentRoot /xampp/htdocs/clancok/
> ServerAliaswww.2website.co.uk
> <Directory /xampp/htdocs/2website/>
> Options Indexes ExecCGI
> AllowOverride All
> Order allow,deny
> Allow from All
> </Directory>
> </VirtualHost>


Sorry forgot to add this. That is my current config file. I dont know
what I am doing wrong maybe you can see something and me
  Réponse avec citation
Vieux 12/02/2008, 18h27   #6
Luuk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

pjg281@googlemail.com schreef:
> Here is my current config
> <VirtualHost *:80>
> ServerName www.1website.co.uk
> DocumentRoot /xampp/htdocs/
> ServerAlias www.1website.co.uk
> <Directory /xampp/htdocs/>
> Options Indexes ExecCGI
> AllowOverride All
> Order allow,deny
> Allow from All
> </Directory>
> </VirtualHost>
> <VirtualHost *:80>
> ServerName www.2website.co.uk
> DocumentRoot /xampp/htdocs/clancok/
> ServerAlias www.2website.co.uk
> <Directory /xampp/htdocs/2website/>
> Options Indexes ExecCGI
> AllowOverride All
> Order allow,deny
> Allow from All
> </Directory>
> </VirtualHost>
>



the line "NameVirtualHost *:80" is missing at the start.

after changeing, try

$ sudo apachectl -S
to check if thing are OK

--
Luuk
  Réponse avec citation
Vieux 12/02/2008, 18h34   #7
pjg281@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

On Feb 12, 6:27pm, Luuk <L...@invalid.lan> wrote:
> pjg...@googlemail.com schreef:
>
>
>
>
>
> > Here is my current config
> > <VirtualHost *:80>
> > ServerName www.1website.co.uk
> > DocumentRoot /xampp/htdocs/
> > ServerAliaswww.1website.co.uk
> > <Directory /xampp/htdocs/>
> > Options Indexes ExecCGI
> > AllowOverride All
> > Order allow,deny
> > Allow from All
> > </Directory>
> > </VirtualHost>
> > <VirtualHost *:80>
> > ServerName www.2website.co.uk
> > DocumentRoot /xampp/htdocs/clancok/
> > ServerAliaswww.2website.co.uk
> > <Directory /xampp/htdocs/2website/>
> > Options Indexes ExecCGI
> > AllowOverride All
> > Order allow,deny
> > Allow from All
> > </Directory>
> > </VirtualHost>

>
> the line "NameVirtualHost *:80" is missing at the start.
>
> after changeing, try
>
> $ sudo apachectl -S
> to check if thing are OK
>
> --
> Luuk- Hide quoted text -
>
> - Show quoted text -


sorry to ask but it didnt seem to work could you add it to here please

<VirtualHost *:80>
ServerName www.1website.co.uk
DocumentRoot /xampp/htdocs/
ServerAlias www.1website.co.uk
<Directory /xampp/htdocs/>
Options Indexes ExecCGI
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>

That would be very much apreciated.
  Réponse avec citation
Vieux 12/02/2008, 18h38   #8
pjg281@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

On Feb 12, 6:27pm, Luuk <L...@invalid.lan> wrote:
> pjg...@googlemail.com schreef:
>
>
>
>
>
> > Here is my current config
> > <VirtualHost *:80>
> > ServerName www.1website.co.uk
> > DocumentRoot /xampp/htdocs/
> > ServerAliaswww.1website.co.uk
> > <Directory /xampp/htdocs/>
> > Options Indexes ExecCGI
> > AllowOverride All
> > Order allow,deny
> > Allow from All
> > </Directory>
> > </VirtualHost>
> > <VirtualHost *:80>
> > ServerName www.2website.co.uk
> > DocumentRoot /xampp/htdocs/clancok/
> > ServerAliaswww.2website.co.uk
> > <Directory /xampp/htdocs/2website/>
> > Options Indexes ExecCGI
> > AllowOverride All
> > Order allow,deny
> > Allow from All
> > </Directory>
> > </VirtualHost>

>
> the line "NameVirtualHost *:80" is missing at the start.
>
> after changeing, try
>
> $ sudo apachectl -S
> to check if thing are OK
>
> --
> Luuk- Hide quoted text -
>
> - Show quoted text -


Actualy got it sounded a stupid question after i figured it out lol.
Now it says everything is ok but when i type in the two seperate web
addresses it still goes to the first one why would that be?
  Réponse avec citation
Vieux 12/02/2008, 18h40   #9
Luuk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

pjg281@googlemail.com schreef:
> On Feb 12, 6:27 pm, Luuk <L...@invalid.lan> wrote:
>> pjg...@googlemail.com schreef:
>>
>>
>>
>>
>>
>>> Here is my current config
>>> <VirtualHost *:80>
>>> ServerName www.1website.co.uk
>>> DocumentRoot /xampp/htdocs/
>>> ServerAliaswww.1website.co.uk
>>> <Directory /xampp/htdocs/>
>>> Options Indexes ExecCGI
>>> AllowOverride All
>>> Order allow,deny
>>> Allow from All
>>> </Directory>
>>> </VirtualHost>
>>> <VirtualHost *:80>
>>> ServerName www.2website.co.uk
>>> DocumentRoot /xampp/htdocs/clancok/
>>> ServerAliaswww.2website.co.uk
>>> <Directory /xampp/htdocs/2website/>
>>> Options Indexes ExecCGI
>>> AllowOverride All
>>> Order allow,deny
>>> Allow from All
>>> </Directory>
>>> </VirtualHost>

>> the line "NameVirtualHost *:80" is missing at the start.
>>
>> after changeing, try
>>
>> $ sudo apachectl -S
>> to check if thing are OK
>>
>> --
>> Luuk- Hide quoted text -
>>
>> - Show quoted text -

>
> sorry to ask but it didnt seem to work could you add it to here please
>
> <VirtualHost *:80>
> ServerName www.1website.co.uk
> DocumentRoot /xampp/htdocs/
> ServerAlias www.1website.co.uk
> <Directory /xampp/htdocs/>
> Options Indexes ExecCGI
> AllowOverride All
> Order allow,deny
> Allow from All
> </Directory>
> </VirtualHost>
>
> That would be very much apreciated.


it should go before the first "<VirtualHost *:80>"

for more info see:
http://httpd.apache.org/docs/2.0/mod...amevirtualhost

--
Luuk
  Réponse avec citation
Vieux 12/02/2008, 18h51   #10
pjg281@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Virtual Hosts

On Feb 12, 6:40pm, Luuk <L...@invalid.lan> wrote:
> pjg...@googlemail.com schreef:
>
>
>
>
>
> > On Feb 12, 6:27 pm, Luuk <L...@invalid.lan> wrote:
> >> pjg...@googlemail.com schreef:

>
> >>> Here is my current config
> >>> <VirtualHost *:80>
> >>> ServerName www.1website.co.uk
> >>> DocumentRoot /xampp/htdocs/
> >>> ServerAliaswww.1website.co.uk
> >>> <Directory /xampp/htdocs/>
> >>> Options Indexes ExecCGI
> >>> AllowOverride All
> >>> Order allow,deny
> >>> Allow from All
> >>> </Directory>
> >>> </VirtualHost>
> >>> <VirtualHost *:80>
> >>> ServerName www.2website.co.uk
> >>> DocumentRoot /xampp/htdocs/clancok/
> >>> ServerAliaswww.2website.co.uk
> >>> <Directory /xampp/htdocs/2website/>
> >>> Options Indexes ExecCGI
> >>> AllowOverride All
> >>> Order allow,deny
> >>> Allow from All
> >>> </Directory>
> >>> </VirtualHost>
> >> the line "NameVirtualHost *:80" is missing at the start.

>
> >> after changeing, try

>
> >> $ sudo apachectl -S
> >> to check if thing are OK

>
> >> --
> >> Luuk- Hide quoted text -

>
> >> - Show quoted text -

>
> > sorry to ask but it didnt seem to work could you add it to here please

>
> > <VirtualHost *:80>
> > ServerName www.1website.co.uk
> > DocumentRoot /xampp/htdocs/
> > ServerAliaswww.1website.co.uk
> > <Directory /xampp/htdocs/>
> > Options Indexes ExecCGI
> > AllowOverride All
> > Order allow,deny
> > Allow from All
> > </Directory>
> > </VirtualHost>

>
> > That would be very much apreciated.

>
> it should go before the first "<VirtualHost *:80>"
>
> for more info see:http://httpd.apache.org/docs/2.0/mod...amevirtualhost
>
> --
> Luuk- Hide quoted text -
>
> - Show quoted text -


Yeah i put ut there. thank you very much. What i done was copied it
all to the bottom of httpd.conf restared (it crashed) then i took it
out restarted server and it worked. even though i had previously
restarted it. Many thanks for your your all geniuses
  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 22h42.


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