You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jim Walls <k6...@earthlink.net> on 2003/06/06 05:55:20 UTC

[users@httpd] Virtual hosts problem

I know that problems with virtual hosts gets discussed regularly and 
this may be answered in the archives, but after looking at what felt 
like almost every E-Mail on this lists that includes virtualhost in it 
(there are HUNDREDS).

I have a small Apache based web site here at my house that has been 
operating just fine a http://www.k6ccc.org  I have another site I am 
trying to set up using name-based virtual host.  This is Apache version 
2.40 (yes, I know I need to upgrade that) under Windows 2000 Pro as a 
service.  Following the instructions almost verbatum from the manual for 
virtual hosts, I added the following to httpd.conf file.  After stopping 
  the Apache service and restarting it (using the Apache Service Monitor 
dialog box), I get an error message in a popup box that says "The 
requested operation has failed!".  There are no messages in any log file 
about it.  If I copy the backup version of the original to httpd.conf, 
the Apache service starts just fine so I'm assuming that I screwed 
something up when I created the virtual hosts.

Anyone see what I messed up on this?

----- excerpt from httpd.conf -----
# Ensure that Apache listens on port 80
Listen 80

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

<VirtualHost *>
   ServerName www.k6ccc.org
   ServerAlias k6ccc.org *.k6ccc.org
   DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/k6ccc.org"
</VirtualHost>

<VirtualHost *>
   ServerName www.w6sce.org
   ServerAlias w6sce.org *.w6sce.org
   DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/w6sce.org"
</VirtualHost>
----- end of excerpt -----

Thanks
-----------------------
Jim Walls - K6CCC
k6ccc@amsat.org
http://home.earthlink.net/~k6ccc/
626-302-8515    FAX  626-302-7501
AMSAT member 32537 / WSWSS member 395
To send me PGP encrypted E-Mail, use:
http://home.earthlink.net/~k6ccc/PublicKey.html


---------------------------------------------------------------------
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


Re: [users@httpd] Virtual hosts problem

Posted by Jim Walls <k6...@earthlink.net>.
Rich Bowen wrote:
> The config looks fine. You need to 1) look in the error log and
> 2) try to start Apache from the command line, and see what errors
> (if any) you get.

That was a very useful suggestion as it displayed a real error message. 
  Turns out that I had added a second Listen 80 statement (following the 
example in the manual) and Apache did not like that.  No surprise there

-----------------------
Jim Walls - K6CCC
k6ccc@amsat.org
http://home.earthlink.net/~k6ccc/
626-302-8515    FAX  626-302-7501
AMSAT member 32537 / WSWSS member 395
To send me PGP encrypted E-Mail, use:
http://home.earthlink.net/~k6ccc/PublicKey.html


---------------------------------------------------------------------
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


Re: [users@httpd] Virtual hosts problem

Posted by Rich Bowen <rb...@rcbowen.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 5 Jun 2003, Jim Walls wrote:

> I know that problems with virtual hosts gets discussed regularly and
> this may be answered in the archives, but after looking at what felt
> like almost every E-Mail on this lists that includes virtualhost in it
> (there are HUNDREDS).
>
> I have a small Apache based web site here at my house that has been
> operating just fine a http://www.k6ccc.org  I have another site I am
> trying to set up using name-based virtual host.  This is Apache version
> 2.40 (yes, I know I need to upgrade that) under Windows 2000 Pro as a
> service.  Following the instructions almost verbatum from the manual for
> virtual hosts, I added the following to httpd.conf file.  After stopping
>   the Apache service and restarting it (using the Apache Service Monitor
> dialog box), I get an error message in a popup box that says "The
> requested operation has failed!".  There are no messages in any log file
> about it.  If I copy the backup version of the original to httpd.conf,
> the Apache service starts just fine so I'm assuming that I screwed
> something up when I created the virtual hosts.
>
> Anyone see what I messed up on this?
<snip>

The config looks fine. You need to 1) look in the error log and
2) try to start Apache from the command line, and see what errors
(if any) you get.

If you can tell us what the error log said, that will be more helpful
than Windows popup error messages.

- -- 
Pilgrim, how you journey on the road you chose
To find out where the winds die and where the stories go
 --Pilgrim (Enya - A Day Without Rain)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE+4IBgXP03+sx4yJMRAr9MAJwL9nxZUNJauhtHhkY96VOm5+3mswCePuzj
vgVwuZDVm1B0R3MczL5bcOc=
=tp2d
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
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


Re: [users@httpd] Virtual hosts problem

Posted by Joseph A Nagy Jr <jo...@charter.net>.
Jim Walls wrote:
> Joseph A Nagy Jr wrote:
> 
>>
>> What about file permissions on the new directory?
>>
>>
> 
> Permissions are exactly the same as in C:/Program Files/Apache 
> Group/Apache2/htdocs where the original site was located.  I just 
> created a sub-directory under that directory for each web site, and at 
> least for testing, copied all the contents to each of them.
> 

Weird. *ponders*


-- 
Wielder of the mighty +1 LARTsaber of Unsubscribe Instructions At End of 
Message,
the +3 Clue-by-Four of No Attachments to a Mailing List,
and the -4 Shield of No Spell Checker


---------------------------------------------------------------------
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


Re: [users@httpd] Virtual hosts problem

Posted by Jim Walls <k6...@earthlink.net>.
Joseph A Nagy Jr wrote:
> 
> What about file permissions on the new directory?
> 
> 

Permissions are exactly the same as in C:/Program Files/Apache 
Group/Apache2/htdocs where the original site was located.  I just 
created a sub-directory under that directory for each web site, and at 
least for testing, copied all the contents to each of them.

-----------------------
Jim Walls - K6CCC
k6ccc@amsat.org
http://home.earthlink.net/~k6ccc/
626-302-8515    FAX  626-302-7501
AMSAT member 32537 / WSWSS member 395
To send me PGP encrypted E-Mail, use:
http://home.earthlink.net/~k6ccc/PublicKey.html


---------------------------------------------------------------------
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


Re: [users@httpd] Virtual hosts problem

Posted by Joseph A Nagy Jr <jo...@charter.net>.
Jim Walls wrote:
> I know that problems with virtual hosts gets discussed regularly and 
> this may be answered in the archives, but after looking at what felt 
> like almost every E-Mail on this lists that includes virtualhost in it 
> (there are HUNDREDS).
> 
> I have a small Apache based web site here at my house that has been 
> operating just fine a http://www.k6ccc.org  I have another site I am 
> trying to set up using name-based virtual host.  This is Apache version 
> 2.40 (yes, I know I need to upgrade that) under Windows 2000 Pro as a 
> service.  Following the instructions almost verbatum from the manual for 
> virtual hosts, I added the following to httpd.conf file.  After stopping 
>  the Apache service and restarting it (using the Apache Service Monitor 
> dialog box), I get an error message in a popup box that says "The 
> requested operation has failed!".  There are no messages in any log file 
> about it.  If I copy the backup version of the original to httpd.conf, 
> the Apache service starts just fine so I'm assuming that I screwed 
> something up when I created the virtual hosts.
> 
> Anyone see what I messed up on this?
> 
> ----- excerpt from httpd.conf -----
> # Ensure that Apache listens on port 80
> Listen 80
> 
> # Listen for virtual host requests on all IP addresses
> NameVirtualHost *
> 
> <VirtualHost *>
>   ServerName www.k6ccc.org
>   ServerAlias k6ccc.org *.k6ccc.org
>   DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/k6ccc.org"
> </VirtualHost>
> 
> <VirtualHost *>
>   ServerName www.w6sce.org
>   ServerAlias w6sce.org *.w6sce.org
>   DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/w6sce.org"
> </VirtualHost>
<snip>

What about file permissions on the new directory?


-- 
Wielder of the mighty +1 LARTsaber of Unsubscribe Instructions At End of 
Message,
the +3 Clue-by-Four of No Attachments to a Mailing List,
and the -4 Shield of No Spell Checker


---------------------------------------------------------------------
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


RE: [users@httpd] DocumentRoot directive changed.

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 9 Jun 2003, Pao-Hsi Huang wrote:
> In Apache1, I can set :
>
> 	DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/p.php"

That's not a supported configuration.  DocumentRoot takes a directory, not
a file.  (It may work, but that doesn't mean it is a good idea.)

A better idea is something along the lines:

Alias /  "C:/Program Files/Apache Group/Apache/htdocs/p.php"

Your problem with the DirectoryIndex directive is almost certainly that
there is another DirectoryIndex directive somewhere in the config
overriding that one.

Joshua.

---------------------------------------------------------------------
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


RE: [users@httpd] DocumentRoot directive changed.

Posted by Pao-Hsi Huang <do...@one4ok.com>.
My configuration below:

<VirtualHost *>
    ServerAdmin doggy01@one4ok.com
    DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"
    DirectoryIndex /p.php
    ServerName test.example.com
    ErrorLog logs/test.example.com-error_log
    CustomLog logs/test.example.com-access_log combined
</VirtualHost>

If I request http://test.example.com/ , then it's ok!

But if I request any other file or directory that are not existed.  It will
produce 404 Not Found.

In Apache1, I can set :

	DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/p.php"

Every request to this site, every REQUEST_URI will pass to the PHP script (
p.php ) as a PATH_INFO.  So I can do something with that.


In Apache 2, it works something wrong.  There is a warning message in
"logs/test.example.com-error_log".

	Warning: DocumentRoot [C:/Program Files/Apache
Group/Apache/htdocs/doggy/p.php] does not exist

And every request to this site, there are only one response that is 404 Not
Found.


Best regards,
Pao-Hsi Huang



-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca] 
Sent: Monday, June 09, 2003 10:20 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] DocumentRoot directive changed.



On Mon, 9 Jun 2003, Pao-Hsi Huang wrote:

> Hi All,
>
> In apache 1.3, the DocumentRoot directive can assign an PHP script as 
> an document root.  So all request will bypass to that PHP script.
>
> But in apache 2, the capability is gone.  Does anyone know how to 
> activate it?

The capability is not gone.  And nothing in this regard has changed sine
Apache 1.3: you use the DirectoryIndex directive to designate the files that
will be loaded when a request is made for any directory, including your
DocumentRoot.

If you need more help than that, you'll need to say what configuration you
are using and exactly what is going wrong.

Joshua.

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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


RE: [users@httpd] DocumentRoot directive changed.

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 9 Jun 2003, Pao-Hsi Huang wrote:

> Hi All,
>
> In apache 1.3, the DocumentRoot directive can assign an PHP script as an
> document root.  So all request will bypass to that PHP script.
>
> But in apache 2, the capability is gone.  Does anyone know how to activate
> it?

The capability is not gone.  And nothing in this regard has changed sine
Apache 1.3: you use the DirectoryIndex directive to designate the files
that will be loaded when a request is made for any directory, including
your DocumentRoot.

If you need more help than that, you'll need to say what configuration you
are using and exactly what is going wrong.

Joshua.

---------------------------------------------------------------------
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


RE: [users@httpd] DocumentRoot directive changed.

Posted by Pao-Hsi Huang <do...@one4ok.com>.
Hi All,

In apache 1.3, the DocumentRoot directive can assign an PHP script as an
document root.  So all request will bypass to that PHP script.

But in apache 2, the capability is gone.  Does anyone know how to activate
it?

Best regards,
Pao-His Huang


---------------------------------------------------------------------
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


[users@httpd] DocumentRoot directive changed.

Posted by Pao-Hsi Huang <do...@one4ok.com>.
Hi all,

In apache 1.3, the DocumentRoot directive can assign an PHP script as an
document root.  So all request will by pass to that PHP script.

But in apache 2, the capability is gone.  I don't know.  Is it an feature
request or bug?

Best regards,
Pao-His Huang


---------------------------------------------------------------------
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