You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Richard Luckhurst <rl...@resmaster.com> on 2007/03/21 03:39:09 UTC

[users@httpd] Xampp Apache on win 2003. Problem with setting up a Virtual Host

Hi 

I have installed xampp on a windows 2003 box with no problems at all. I have the
security set so that there is now a .htaccess for the htdocs and I am challenged
for the username and password I set up when running the security step of the
xampp installation.

I am now trying to set up a virtual host on this Apache installation and am
having all sorts of problems. I have done this many times on linux without
problems so I am more than a bit confused.

In the httpd-vhosts.comf I have the following

NameVirtualHost 203.113.254.14:80

<VirtualHost print.book.resmaster.com>
ServerAdmin hostmaster@resmaster.com
DocumentRoot "C:/www/docs"
ServerName print.book.resmaster.com
DirectoryIndex index.html index.php index.htm

ErrorLog logs/print-error.log
CustomLog logs/print-access.log
</VirtualHost>

<Directory "C:/www/cgi-bin">
AddHandler cgi-script .cgi
AllowOverride Options FileInfo AuthConfig Limit
Options Indexes Includes ExecCGI MultiViews
Order allow,deny
Allow from all

</Directory>

The IP Address in NameVirtualHost is the same as the one in the httpd.conf
Listen directive and I have set this address up in the DNS Server to have the
name darth.resmaster.com and also print.book.resmaster.com

I have set up the directory C:\www with a docs and a cgi-bin subdirectory on the
Win2003 box and I have made it readable and executable to everyone.

When I try and start Apache it fails and refuses to start with nothing in the
log files.

If I comment out the <Directory></Directory> section and the ErrorLog and
CustomLog Apache will start but the main server darth.resmaster.com is now
reporting an Error 403

Access forbidden!
You don't have permission to access the requested directory.
There is either no index document or the directory is read-protected.

I see the same message if I try to browse print.book.resmaster.com the Virtual
Host.


In the error.log I see

[Wed Mar 21 13:09:54 2007] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Wed Mar 21 13:09:54 2007] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Wed Mar 21 13:09:57 2007] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Wed Mar 21 13:09:57 2007] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Wed Mar 21 13:10:03 2007] [warn] NameVirtualHost 203.223.254.14:80 has no VirtualHosts
[Wed Mar 21 13:10:08 2007] [warn] NameVirtualHost 203.223.254.14:80 has no VirtualHosts
[Wed Mar 21 13:16:56 2007] [notice] Child 3168: Acquired the start mutex.
[Wed Mar 21 13:16:56 2007] [notice] Child 3168: Starting 250 worker threads.
[Wed Mar 21 13:16:56 2007] [notice] Child 3168: Starting thread to listen on port 443.
[Wed Mar 21 13:16:56 2007] [notice] Child 3168: Starting thread to listen on port 80.
[Wed Mar 21 13:17:36 2007] [error] [client 203.113.254.15] client denied by server configuration: C:/www/docs/

I have no idea where the /dev/null is coming from.

Am I correct in assuming that if an access or error file does not exist then it
will be created, just like in a linux Apache installation?

I do not understand the no VirtualHosts message in the error log.

I also do not understand the client denied message.

It is quite likely that I am making some basic mistake setting up the name based
virtual host but for the life of me I can not see where. I would appreciate any
help in getting this virtual host going.


Regards,
Richard Luckhurst                      
Product Development
Exodus Systems - Sydney, Australia.
rluckhurst@resmaster.com
Tel: (+612) 4751-9633
Fax: (+612) 4751-9644
Web: www.resmaster.com 
=================================================
Exodus Systems - Smarter Systems, Better Business
=================================================


---------------------------------------------------------------------
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[2]: [users@httpd] Xampp Apache on win 2003. Problem with setting up a Virtual Host

Posted by Richard Luckhurst <rl...@resmaster.com>.
Hi Sander,

Thanks for your help and your explanations.


>> When I try and start Apache it fails and refuses to start with  
>> nothing in the log files.

ST> Look in the Applications section in the Windows Event Viewer. That is  
ST> where Apache logs before it opens its own log files.

There is nothing at all in the Application section of the Windows Event Viewer
related to Apache.

>>
>> [Wed Mar 21 13:09:54 2007] [crit] (22)Invalid argument: unable to  
>> replace stderr with error_log

ST> What is your ServerRoot? Does the logs directory exist under that  
ST> ServerRoot?

The Server Roor (in httpd.conf) is

ServerRoot "C:/Program Files/xampp/apache"

That does contain a logs folder and contains the standard error and access logs.
There is no sign of the logs created by the virtual host.

If I uncomment the logs in the Virtual Host then Apache will not start.


>> I do not understand the no VirtualHosts message in the error log.

ST> Your VirtualHost header needs to match the NameVirtualHosts  
ST> directive.  Try

ST> <VirtualHost 203.113.254.14:80>
ST>    ServerName print.book.resmaster.com
ST>    ...
ST> </VirtualHost>

Fair enough. I have changed the header as you suggest and when I restart Apache
I no longer see the message about no virtual hosts.

>> I also do not understand the client denied message.

ST> Once you commented out the <Directory> stanza, the Options Indexes  
ST> went away, and if directories higher in the hierarchy don't have  
ST> Indexes defined, it'll deny a request for the generated directory  
ST> index.  I would serve index.html, were there one.

OK. That makes sense.

I currently have the httpd-vhosts.conf as follows

NameVirtualHost 203.113.254.14:80

<VirtualHost 203.113.254.14:80>
ServerName print.book.resmaster.com
ServerAdmin hostmaster@resmaster.com
DocumentRoot "C:/www/docs"
ServerName print.book.resmaster.com
DirectoryIndex index.html index.php index.htm

#ErrorLog logs/print-error.log
#CustomLog logs/print-access.log
</VirtualHost>

<Directory "C:/www/cgi-bin">
AddHandler cgi-script .cgi
AllowOverride Options FileInfo AuthConfig Limit
Options Indexes Includes ExecCGI MultiViews
Order allow,deny
Allow from all

</Directory>


I can restart Apache like this and I get no errors or warnings other than

[Wed Mar 21 14:13:09 2007] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Wed Mar 21 14:13:09 2007] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Wed Mar 21 14:13:13 2007] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Wed Mar 21 14:13:13 2007] [crit] (2)No such file or directory: unable to replace stderr with /dev/null

If I try to access either darth.book.resmaster.com or print.book.resmaster.com I
get the 403 error

Access forbidden!
You don't have permission to access the requested directory.
There is either no index document or the directory is read-protected.

If I comment out the Include conf/extra/httpd-vhosts.conf directive and restart
Apache I can see the darth.resmaster.com site no problems.

I would appreciate any further help



Regards,
Richard Luckhurst
Product Development
Exodus Systems - Sydney, Australia.
rluckhurst@resmaster.com
Tel: (+612) 4751-9633
Fax: (+612) 4751-9644
Web: www.resmaster.com
=================================================
Exodus Systems - Smarter Systems, Better Business
=================================================


---------------------------------------------------------------------
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] Xampp Apache on win 2003. Problem with setting up a Virtual Host

Posted by Sander Temme <sc...@apache.org>.
On Mar 20, 2007, at 7:39 PM, Richard Luckhurst wrote:

> When I try and start Apache it fails and refuses to start with  
> nothing in the log files.

Look in the Applications section in the Windows Event Viewer. That is  
where Apache logs before it opens its own log files.

>
> [Wed Mar 21 13:09:54 2007] [crit] (22)Invalid argument: unable to  
> replace stderr with error_log

What is your ServerRoot? Does the logs directory exist under that  
ServerRoot?

> Am I correct in assuming that if an access or error file does not  
> exist then it
> will be created, just like in a linux Apache installation?

If their directory exists.  Apache won't make the logs directory.

> I do not understand the no VirtualHosts message in the error log.

Your VirtualHost header needs to match the NameVirtualHosts  
directive.  Try

<VirtualHost 203.113.254.14:80>
   ServerName print.book.resmaster.com
   ...
</VirtualHost>

> I also do not understand the client denied message.

Once you commented out the <Directory> stanza, the Options Indexes  
went away, and if directories higher in the hierarchy don't have  
Indexes defined, it'll deny a request for the generated directory  
index.  I would serve index.html, were there one.

S.

-- 
sctemme@apache.org            http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF