![]() |
Apache won't start
Hello all, I've been around these forums but never signed up. Anyway, thats not my problem. For some odd reason, whenever I do
sudo apachectl start it ask for my password, so I enter it correctly, put I still get this error. Code:
/usr/sbin/apachectl: permission denied: /etc/httpd [71]This is odd, as the day i installed 10.1, I was running Apache fine. I ran apache configtest, I still get a permissions error. I also did a ls -ld on /etc/httpd Code:
drwxr-xr-x 11 root wheel 330 Jul 15 19:04Mac OS 10.1.5 |
First, can you use sudo for other commands successfully? Maybe the authentication isn't working correctly*. When I try to run just apachectl graceful, I get permission denied errors (as well as "httpd is not running, trying to start" even though it is running).
Second, what does ls -l /usr/sbin/httpd say**? I have the same result on my /etc/httpd directory that you do. * I've seen this happen before, so if this is the case you could search the forums and probably find the solution. ** Assuming that which httpd returns /usr/sbin/httpd on 10.1.5, I'm on 10.3.5 so things may have changed (but I doubt it). |
Thanks for your reply.
Yes, I can use sudo for other things, such as editing files and such. ls -l /usr/sbin/httpd returns: Code:
-rwxr-xr-x 1 root wheel 397048 Jul 31 2002 /usr/sbin/httpd |
Hmm. I'm not sure if the potential version difference is the reason for the size difference, but my httpd is listed as
Code:
-rwxr-xr-x 1 root wheel 398492 26 May 20:09 /usr/sbin/httpdAny recent changes to your httpd.conf file? Wild guessing here... what do you get with ps -aux | grep http ? |
I'm running 1.3.26.
I haven't even been in terminal after the last time I had Apache running. ps -aux | grep http returns this. Code:
daejuanj 476 0.0 0.1 1412 316 std S+ 0:00.01 grep http |
1) To double-check that 'sudo' is working properly, please show us the results of the following command:
sudo id 2) /usr/sbin/apachectl is just a shell script so you can look at it and maybe see why it is going wrong. Or maybe add some extra debugging lines in the script to help understand what is happening. Or just manually execute the commands that the script does and see what happens. |
Quote:
Code:
uid=0(root) gid=0(wheel) groups=0(wheel), 1(daemon), 2(kmem), 3(sys), 4(tty), 5(operator), 20(staff), 31(guest), 80(admin) |
Consider taking a look at the errorlog:
open /private/var/log/httpd/error_log.log You can also say: apachectl configtest for a report on the configuration. -- Gnarlie |
Have you tried repairing disk permissions? I'm not sure if it affects the files in /etc, but it's worth a shot.
|
Quote:
Code:
/usr/sbin/apachectl: permission denied: /etc/httpd [145]Quote:
Quote:
|
Quote:
ls -ld /etc ls -ld /etc/httpd ls -l /etc/httpd Quote:
|
Ok, from ls -ld /etc
Code:
lrwxrwxr-t 1 root admin 11 Aug 27 15:03 /etc -> private/etcCode:
drwxr-xr-x 11 root wheel 330 Jul 15 19:04 /etc/httpdCode:
total 448Quote:
|
Quote:
It is remotely possible that there is a leftover run file that it can't delete. Check for the existence of /var/run/http.pid Also, apachectl is a sh script to make life easier. It would be interesting to see the output of httpd -t the equivalent of apachectl configtest. |
Quote:
Code:
Syntax error on line 281 of /etc/httpd/httpd.conf:As for the other files, they didn't exsist. (/var/run/http.pid & var/log/error_log) Code:
httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName |
Quote:
Anyway, have you done the "Repair Permissions" from Disk Utility on your hard disk when booted normally? The listings you provided of /etc/httpd look fine. I would investigate starting httpd manually following the command that the apachectl script uses. That should show you what part is failing and why. |
Quote:
Take a close look at your httpd.conf and make sure both mod_php lines are commented out (or not commented out, depending on your situation) and run the config test again again. As for the run and error logs, there lack of existence is not necessarily a bad thing. |
Quote:
Do you mean that you get exactly the same error message from 'httpd -t' before and after editing the httpd.conf file? Or what? Quote:
|
Quote:
Quote:
Code:
/var/log/httpd/error_logCode:
[Thu Jul 15 19:12:42 2004] [notice] caught SIGTERM, shutting downQuote:
|
Quote:
So - is it true that 'httpd -t' now gives your config file a clean bill of health? Quote:
Tell us in full detail what happens when you run Disk Utility from your hard drive, then select your disk in its window, and press "Repair Permissions". |
Quote:
Code:
Processing config directory: /private/etc/httpd/usersLink |
Quote:
http://docs.info.apple.com/article.html?artnum=106900 |
Quote:
Arg!!, I ran the program, and it went through my 23k+ files, and said everything went ok. Code:
2004-08-27 17:30:52 -0500 - The privileges have been repaired on the volume 'Macintosh HD'Code:
/usr/sbin/apachectl: permission denied: /etc/httpd [71] |
Quote:
Code:
# the path to your httpd binary, including options if necessaryHave a look and see what is different in your version of the apachectl script. |
My mistake on the error log path.
My memory does not go back to 10.1, but just for fun, which httpd should give you the path to your apache binary, and if it does, sudo httpd should start it since httpd -t gave you a clean bill of health. You will want to fix the errors with apachectl to make life easier. |
Quote:
Quote:
BTW, I wanna thank everyone for their help. :cool: EDIT: Yeah, you were right on the mark. I had Code:
HTTPD=/etc/httpdCode:
HTTPD=/usr/sbin/httpd |
| All times are GMT -5. The time now is 10:36 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.