VirtualHost problem

Hi, I have read the documents but what the canges I made to
apache.conf have now broken it!

All I did was paste the following at the end of the apache.cong file:

# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost>

DocumentRoot /www/
ServerName www.mydomain.com

# Other directives here

</VirtualHost>

<VirtualHost>

DocumentRoot /www/myotherfolder
ServerName www.myotherdomain.com

# Other directives here

</VirtualHost>


whats wrong with this please?
william.hooper [ Fr, 12 Oktober 2007 15:02 ] [ ID #1843373 ]

Re: VirtualHost problem

<william.hooper [at] gmail.com> wrote in message
news:1192194147.057859.74200 [at] e9g2000prf.googlegroups.com...
> Hi, I have read the documents but what the canges I made to
> apache.conf have now broken it!
>
> All I did was paste the following at the end of the apache.cong file:
>
> # Ensure that Apache listens on port 80
> Listen 80
>
> # Listen for virtual host requests on all IP addresses
> NameVirtualHost *:80
>
> <VirtualHost>
<SNIP>

To start with, the VirtualHost entry needs to agree with the
NameVirtualHost -
<VirtualHost *:80>

Further than that, you may want to tell us what you mean by broken and maybe
give us some error messages to work with.
phantom [ Fr, 12 Oktober 2007 15:07 ] [ ID #1843374 ]

Re: VirtualHost problem

I have this qnap linux machine in a little box (no screen, keyboard
etc) that works as a media server and web server. I can't figure out
where the log files are and it does not give you error mesages. When I
made the changes it just refuses to start apache.

I don't understand what you mean about "To start with, the VirtualHost
entry needs to agree with the
NameVirtualHost - <VirtualHost *:80> ".

I just took this code from this eample:

http://httpd.apache.org/docs/1.3/vhosts/examples.html#purena me
william.hooper [ Fr, 12 Oktober 2007 15:21 ] [ ID #1843375 ]

Re: VirtualHost problem

<william.hooper [at] gmail.com> wrote in message
news:1192195298.048892.10290 [at] i38g2000prf.googlegroups.com...
>I have this qnap linux machine in a little box (no screen, keyboard
> etc) that works as a media server and web server. I can't figure out
> where the log files are and it does not give you error mesages. When I
> made the changes it just refuses to start apache.
>
> I don't understand what you mean about "To start with, the VirtualHost
> entry needs to agree with the
> NameVirtualHost - <VirtualHost *:80> ".
>
> I just took this code from this eample:
>
> http://httpd.apache.org/docs/1.3/vhosts/examples.html#purena me
>

that example is correct, what you had was wrong.

What I meant... If you have the line:
NameVirtualHost *:80

then the '*:80' bit NEEDS to apppear in your VirtualHost part, as in:
<VirtualHost *:80>
....
</VirtualHost>

not just
<VirtualHost>
....
</VirtualHost>

As for log files, have you tried looking in the usual place -
/var/log/httpd/ ?
phantom [ Fr, 12 Oktober 2007 16:23 ] [ ID #1843378 ]

Re: VirtualHost problem

<william.hooper [at] gmail.com> wrote in message
news:1192195298.048892.10290 [at] i38g2000prf.googlegroups.com...
>I have this qnap linux machine in a little box (no screen, keyboard
> etc) that works as a media server and web server. I can't figure out
> where the log files are and it does not give you error mesages. When I
> made the changes it just refuses to start apache.
>
> I don't understand what you mean about "To start with, the VirtualHost
> entry needs to agree with the
> NameVirtualHost - <VirtualHost *:80> ".
>
> I just took this code from this eample:
>
> http://httpd.apache.org/docs/1.3/vhosts/examples.html#purena me
>

having seen your other post, I'd guess that you ended up with a conf file
containing both

Port 80
and
Listen 80

You only need one, remove the other.
phantom [ Fr, 12 Oktober 2007 16:25 ] [ ID #1843379 ]

Re: VirtualHost problem

ah it's all done at last... i just post here to make the thread
complete in case someone ever reads it again on google groups etc.


http://forum.qnap.com/phpbb2/viewtopic.php?t=527&postdays=0& postorder=asc&start

it took me three days but i think i was unlucky.
william.hooper [ Sa, 13 Oktober 2007 17:49 ] [ ID #1844060 ]
Webserver » alt.apache.configuration » VirtualHost problem

Vorheriges Thema: Empty query string if containing letters
Nächstes Thema: $50 if you sort out my silly apache problem!