DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
< [Thu Oct 04 13:38:53 2007] [error] [client 127.0.0.1] File does not exist: /htdocs
< [Thu Oct 04 13:38:54 2007] [error] [client 127.0.0.1] File does not exist: /htdocs
< [Thu Oct 04 13:38:55 2007] [error] [client 127.0.0.1] File does not exist: /htdocs
< [Thu Oct 04 13:39:33 2007] [error] [client 127.0.0.1] File does not exist: /htdocs
this happens quite frequently and persists throughout the day. Google searches for this error show that there "should" be something wrong in my apache2.conf. I have no references to /htdocs in my conf, but this one strange output makes me think that this may be an apache2 default:
do I need to explicitly set an httpd root in the apache2.conf or is this handled in a virtual hosts entry. I'm working on a web server with over 20 sites on it, so each virtual host is given it's own DocumenRoot and I thought the
Code:
ServerRoot "/etc/apache2"
would point HTTPD_ROOT to something (this is the default from the install, i did not change it)
Just a WAG but do you have a "Document Root" directive for all of your virtual hosts? According to the Apache docs the default document root is "ServerRoot"/htdocs.
Also whatever is causing the error is accessing your server through the loop-back (127.0.0.1). What's up with that?
Also whatever is causing the error is accessing your server through the loop-back (127.0.0.1). What's up with that?
It seems to be that if you don't assign a specific IP to apache it does it's thing through the loopback.
Quote:
Just a WAG but do you have a "Document Root" directive for all of your virtual hosts? According to the Apache docs the default document root is "ServerRoot"/htdocs.
I have a DocumentRoot for each of my VHosts, yes. my ServerRoot is set to:
ServerRoot "/etc/apache2"
in Apache2.conf, but the:
-D HTTPD_ROOT=""
seems to be taking precedence.
I can get the error to stop by creating a /htdocs directory (based off /), but this is just a hack. This /htdocs directory is the only htdocs on my system (the one that I created).
I finally see what you are saying. The error is relative to the compiled-in ServerRoot not the ServerRoot in your config file. I tried unsuccessfully to replicate this error on a machine that I have.
Does your access log give you any clue about what is happening at the time of the error(s)?
usually the document root for apache(2) is /var/www isn't it ?
Code:
username@it-etch:~$ cd /var/www
username@it-etch:/var/www$ ls
apache2-default
username@it-etch:/var/www$ ls apache2-default
apache_pb22_ani.gif apache_pb22.png apache_pb.png
apache_pb22.gif apache_pb.gif index.html
Yep, /var/www on most systems I think, but it can be any directory.
What Scottley is pointing out, and it took two posts for me to get it, is that the server is trying to serve files from /htdocs. In his config file the statement
Code:
ServerRoot "/etc/apache2"
should tell the server to look in
Code:
/etc/apache2/htdocs
and this would only be the default case i.e. a virtual host with no DocumentRoot statement.
At least that is the way that I understand it. Could be wrong though.
I have 20 something sites hosted on this server (I'm not an apache noob, but this server was recently upgraded to apache2, which I Have less experience with). Each site has it's own DocumentRoot, ServerName, ServerAlias, and Directory directives (follow symLinks, etc).
the errors are so often and only related to the default VHost (which has a DocumentRoot of /var/www/), that I'm led to believe that it is a module, not Apache2 causing the error. I have openSSL and PHP installed on this server.
The Apache 2 install that I used was through apt-get. I did not compile this myself (probably my first mistake, but it's sooo easy).
I have made the errors stop by adding the directory /htdocs/, but I don't like this hack. I don't see any errors for something looking for a file in /htdocs/ (e.g. File Not Found /htdocs/<some file>).
I just had a thought....
Could this File not found /htdocs/ error be some kind of security check that Apache2 (or some loaded module) looking to see if it can access files in /htdocs?
This is probably a WAG, but it seems logical. A good analog to my hypothesis is in osCommerce, whenever a page is loaded, it touches /include/configure.php to see if it is protected or writeable and displays a warning bar stating that the configure.php is writeable
I have 20 something sites hosted on this server (I'm not an apache noob, but this server was recently upgraded to apache2, which I Have less experience with). Each site has it's own DocumentRoot, ServerName, ServerAlias, and Directory directives (follow symLinks, etc).
the errors are so often and only related to the default VHost (which has a DocumentRoot of /var/www/), that I'm led to believe that it is a module, not Apache2 causing the error. I have openSSL and PHP installed on this server.
The Apache 2 install that I used was through apt-get. I did not compile this myself (probably my first mistake, but it's sooo easy).
I have made the errors stop by adding the directory /htdocs/, but I don't like this hack. I don't see any errors for something looking for a file in /htdocs/ (e.g. File Not Found /htdocs/<some file>).
I just had a thought....
Could this File not found /htdocs/ error be some kind of security check that Apache2 (or some loaded module) looking to see if it can access files in /htdocs?
This is probably a WAG, but it seems logical. A good analog to my hypothesis is in osCommerce, whenever a page is loaded, it touches /include/configure.php to see if it is protected or writeable and displays a warning bar stating that the configure.php is writeable
I had this problem too, turned out the request was to a virtual host that didn't exist...
in my case, I had two ports open for apache, and the request was made to the second port for a virtual host that was only setup on the first port.
Ultimately, I think this is happening because its to a Virtual host that does not exist, or to an ip address.
just add a DocumentRoot=/path/to/web/files in your main apache2.conf, which will apply to all requests that don't match a configured virtual host. In debian, mine didn't have by default. I added it and it worked. In addition, if you don't want those requests to succeed, then deny all in the directory section:
<Directory /path/to/web/files>
deny from all
</Directory>
seems right that it tried /htdocs as that was the compiled default, and I'm guessing you had no other document root specified outside a vhost.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.