Apache 2 config problem--did I screw up the folders ?

michaelsanford

Translator, Web Developer
http://nimbus.sytes.net/

Now, I have two hard disks on trogdor, one that has the system, swap, bootloader, and root partition, the other disk, the /home mount point. The second disk is newer, a little faster, and slightly more reliable, which is why I want to keep the files on it, since the system can be re-installed in a few hours but recovering the data and user folders would be a huge hassle.

I originally made a symlink /var/www -> /home/www, and moved ./cgi-bin, ./html and ./icons over to /home/www/.

I don't know where /error should reside, but it is now in /etc/httpd/ (which is my ServerRoot folder). I've also changed DocumentRoot to /home/www.

Problem 1: I can't feed the error pages correctly to the client (as you can see from the "Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request" on the server root page). There is currently no index.* file, so it should serve error/noindex.html, but it doesn't (presumably because it can't find it). It seems however that I can serve a page from /home/www/html/, it's just the error pages that don't work.

Problem 2: Once I edit httpd..conf, I can't figure out how to restart apache (since apachectl doesn't seem to exist with Apache 2 :rolleyes: )

Any help in re-building my Apache 2 folders would be greatly appreciated.
 
Can't see your site at present, I presume you've got your machine off.

Have you checked the error doc links part of the httpd.conf fiel, just to make sure it's all correct?

Your second problem should simply be apache2ctl start/restart/graceful etc. It should be in your Apache2 root folder's bin directory (such as /usr/local/apache2/bin/apache2ctl).
 
Woops, yeah the machine was off (but it's up now). I just checked the other aliases in httpd.conf and reformatted them (I didn't know they existed :rolleyes: ).

However, that hasn't solved any problems. The only apachectl I could find was in /usr/sbin/apachectl (which isn't in my path so I couldn't find it originally). However, when I issue apachectl graceful/restart I get this:
[amras@trogdor sbin]$ sudo ./apachectl restart
Warning: DocumentRoot [/var/www/html] does not exist


The thing is that the string "/var/www" does not exist anywhere in /etc/httpd/conf/httpd.conf ! What the heck is going on ??
 
So what are you telling httpd.conf where your DocumentRoot is then? At /var/www, or at /home/www, or at /home/www/html (or at /var/www/html)?

I'm not too hot on symLinks. I'd remove them until you've got Apache working. Also, that apachectl could be another install of Apache (v1.3?) and is using a different Apache to start up (hence the unexplained /var/www/html).

Where is the directory of your Apache 2 install?
 
Sorry I should have put that in my last reply, let me clarify. I originally had a symlink, but have since deleted the symlink, re-made the original /var/www folder, and re-pointed DocumentRoot to /home/www/html (and in the "VirtualHost *" container that seems to have been made by apacheconf).

I installed Apache from the RH9 CDs, and updated everything with up2date (so I only assume that up2date updated Apache as well, but it may have been Apache 2 from the get-go, I'm not sure what RedHat ships with). I haven't compiled any other Apaches, and these are all the apache files I found on the system:
[root@trogdor conf]# find / -name apache
/var/cache/alchemist/apache
/etc/alchemist/namespace/apache

[root@trogdor conf]# find / -name *.conf
/etc/httpd/conf/httpd.conf


[root@trogdor conf]# find / -name apache2*
(none)


So, I think I have only one installation of Apache (i.e., that up2date didn't build another apache somewhere else). But you're right, the conclusion that it's using another startup conf seems logical, even though I can't find it.

Additionally, we would assume that /usr/sbin/apachectl is using the 'wrong' config file, but it's not :
[root@trogdor conf]# /usr/sbin/apachectl -V
Server version: Apache/2.0.40
...
-D HTTPD_ROOT="/etc/httpd"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
 
When I checked your site yesterday, it gave a permissions error. This indicated to me that there was a server running (otherwise, I'd get the no connection Safari error window).

Therefore, check permissions on the directory and files within first (then I can have another look).

Just to clarify.

1. You have the DocRoot within httpd.conf pointing to /var/www/html?
2. The DocumentRoot /var/www/html actually exists?
3. Are you using a VirtualHost directive for your root directory? (If so, and this is the only directory you have, you might as well not use a VirtualHost directive until you've got everything running fine).
4. Have you checked your error logs? They should be in the httpd-apache root folder (not the doc root, the actual apache root with an error directory (perhaps in /etc/httpd)). These normally give a good indication of any problems at server start-up or restart.

Like I said though, I am guessing you have a permissions problem since my browser did acknowledge a server present when I checked.
 
No, actually the DocRoot is /home/www/html/ which is the puzzlign part.

Thanks very much for your help, but I've had to re-install the OS last night because there were bad blocks on my hard disk (possibly the cause of this problem?). So it seems to be working correctly now.
 
Normally, I've found pre-installed versions of Apache/MySQL to be a problem (even in OS X) when you want to tinker around more than usual. Both Linux (Suse/RH) and Apple want to install it their way, rather than the community way.

As long as you know where everything is though, no problem.
 
Back
Top