![]() |
Stuck with Personal Web Sharing
I'm using OS X 10.2.8, and I've recently been having trouble with Personal Web Sharing. Whenever I try to activate it in the Sharing system preferences, the icon and it gets stuck trying to start up with the icon greyed out and the progress bar continues to spin in place.
Everything else on the system is fine -- the computer doesn't crash or anything. If I quit system preferences and reopen it, Web Sharing is unchecked and has not been started. I tried using the Console viewer when starting it up, and it said: "/usr/sbin/apachectl start: httpd started" Not sure what the problem is. I also tried testing the httpd.conf file by typing "sudo /usr/sbin/httpd -t" in the Terminal, but it said "Syntax OK". It seems to think everything is good, but the Apache server is not starting. Could it have anything to do with my installation of Darwin Streaming Server? Do these two conflict? DSS is not currently active, but I think i've been having the problem since around the time I installed DSS. Any suggestions? --Josh |
What do the log files say....
Code:
/var/log/httpd/access_log |
They say "Permission denied".
/var/log/httpd/access_log: Permission denied. /var/log/httpd/error_log: Permission denied. Any solutions? Thanks for the quick response. --Josh |
Try
Code:
sudo cat /var/log/httpd/errorlog |
It had a lot of stuff in the error_log. Looks like this was the stuff dated today:
Processing config directory: /private/etc/httpd/users Processing config file: /private/etc/httpd/users/guest.conf Processing config file: /private/etc/httpd/users/josh.conf [Tue Jan 27 01:55:45 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80 |
The access log looks like it last had a GET request on Dec. 12:
10.0.1.16 - - [12/Dec/2003:12:05:57 -0500] "GET /~josh/avsys/index.html HTTP/1.1" 404 295 Seems about right, I noticed I was having trouble with it over a month ago. |
Code:
[Tue Jan 27 01:55:45 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80- either another httpd is already running, and when this one tries to start up it cannot listen on port 80 because the other one is already using port 80 - The httpd died quite recently (0-30 minutes about) and the socket is still marked as 'in use' so the new httpd cannot use it yet. Code:
Processing config directory: /private/etc/httpd/usersThat said, I would do the following to see if a daemon is hanging around: Code:
$ ps -auxww | grep httpdThe ps shows the usual 2 httpd processes, one running as root, which spawns the one running as www which is what you connect to. What does your system show? |
Here's what I get when I run those commands:
Code:
[josh:~] josh% ps -auxww |grep httpd |
Hmmm, suddenly web sharing works again. But, its not pointing to my personal website (Users/josh/Sites/index.html). Instead its pointing to the page at /Library/WebServer/Documents/index.html.en . Is there a way to correct this?
Here is a second try with the commands above, some of the info is now slightly different: Code:
[josh:~] josh% ps -auxww | grep httpdCode:
[Tue Jan 20 14:43:44 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80Code:
10.0.1.16 - - [12/Dec/2003:12:05:11 -0500] "GET /~josh/ HTTP/1.1" 200 4499 |
I think I fixed it. I copied my Sites folder and renamed it "public_html". Now when I go to:
http://localhost/~josh It is directed to the correct place. |
Something is weird on your system. httpd should be running as 'www' not 'nobody', and unless your system is under heavy load, thats a lot of daemons running...
What does this show you: Code:
$ egrep 'User |Group |MinS|MaxS|StartS' /etc/httpd/httpd.confCode:
$ nidump passwd / | egrep 'www|nobody'Try completely shutting down http: Code:
/usr/sbin/apachectl stopCode:
$ ps -auxww | grep httpCode:
$ /usr/sbin/apachectl startCode:
$ ps -auxww | grep httpedit: toss in some color |
Here's what I get with all that:
Code:
[josh:~] josh% egrep 'User |Group |MinS|MaxS|StartS' /etc/httpd/httpd.conf |
Here's what I get with all that. When I restart Apache from the command line it won't start. But then I can start it from Web Sharing in the Sys. Prefs.:
Code:
[josh:~] josh% egrep 'User |Group |MinS|MaxS|StartS' /etc/httpd/httpd.conf |
Whoops,
Code:
$ sudo /usr/sbin/apachectl start |
That started Apache successfully, but the Nobody users are back....I think it has something to do with an attempted installation of Qmail a while back. I didn't end up configuring and activating it, but I think it installed these Users somehow. I'm not sure how to uninstall Qmail.....Thanks for all your help thus far, by the way.
Code:
[josh:~] josh% sudo /usr/sbin/apachectl start |
Well, that looks better, you have the right number of servers based on what was in /etc/httpd/httpd.conf
I would edit /etc/httpd/httpd.conf and change the lines Code:
User nobodyCode:
User www |
Quote:
and you should get '/Users/josh/Sites/index.html' when you go to 'http://localhost/~josh/'. |
Yeah, that's what was happening...except I had to change "Sites" to "public_html". So its working again, albeit a little strange to see all these "Nobody" users.
Thanks for your help. |
Quote:
Code:
$ cat /etc/httpd/users/generic.conf |
That's what I get:
Code:
[josh:~] josh% sudo cat /etc/httpd/users/josh.confCode:
# UserDir: The name of the directory which is appended onto a user's home |
Interesting, mine shows:
Code:
#httpd.conf httpd.conf.defaultserver httpd.conf.10.2 httpd.conf.default (the 10.2 one I created as backup when going to 10.3) So I think it is supposed to be sites. Between that and the User/Group thing, I think your httpd.conf file has been changed somehow. You might like to try this: Code:
diff -b /etc/httpd/httpd.conf /etc/httpd/httpd.conf.default |
quite a few differences:
Code:
[josh:~] josh% sudo diff -b /etc/httpd/httpd.conf /etc/httpd/httpd.conf.default |
Looking at that I would probably shut down apache and copy the default file over your current on and restart, do you know where that file came from?
Code:
[josh:~] josh% sudo diff -b /etc/httpd/httpd.conf /etc/httpd/httpd.conf.defaultCode:
171c171Code:
The MaxRequestsPerChild directive sets the limit on the number ofCode:
239a240,241Code:
326,327c330,331Code:
334c338Code:
414c418Code:
848a853Anyway, like I said, I would probably replace your httpd.conf with the default one. |
That did the trick! I can now see my sites in Rendezvous too. I'm not sure how my Apache httpd.conf file got so screwed up??
Thanks for all your help! |
Hello to all of you!
I am so thankful to have found a thread where a probable solution to my problem lies. For the past several hours ( and it's now 2 am), I have been patiently and carefully following all the instructions here. By the way, I am using Mac OS ver 10.2.8 with Apache/1.3.29 and php-4.3.4 from enthrophy. My problem is almost identical to "jkinberg's", I am unable to start my Apache by: 1) going to the system preference and click the 'Personal Web Sharing' start button - icon greyed - Personal Web Sharing waiting to start (this does not happen before) 2) typing "sudo /usr/sbin/apachectl start" on the terminal - gives "Syntax error on line 2 of /etc/httpd/httpd.conf: Invalid command '.so', perhaps mis-spelled or defined by a module not included in the server configuration" /usr/sbin/apachectl start: httpd could not be started Tried replacing the httpd.conf with the httpd.conf.default and got this: "Syntax error on line 2 of /etc/httpd/httpd.conf: Invalid command 'od_status.so', perhaps mis-spelled or defined by a module not included in the server configuration" /usr/sbin/apachectl start: httpd could not be started Thanks in advance for you kind assistance. Jose |
So you are getting error messages about line 2 of http.conf
What does this line 2 look like? Show us. One idea: maybe the http.conf file has somehow got its line endings screwed up (e.g. if you edited it and saved with Mac or DOS line endings). Try running this Perl invocation on it: sudo perl -pi~ -e 's/\r\n?/\n/g' /etc/httpd/httpd.conf |
hayne,
Thanks for your input here. I really appreciate it. Well, lately I have been using dreamweaver mx to edit my httpd.conf file since my trial version of bbedit expired. I am not aware that this might mess up my file. But running the perl command that you suggested asked me for a password and then back to the prompt without giving out any specific messages. As for the line 2, below is a part of my httpd.conf file. ----------------------- 1## 2## httpd.conf -- Apache HTTP server configuration file 3## 4 5# 6# Based upon the NCSA server configuration files originally by Rob McCool. # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://www.apache.org/docs/> for detailed information about # the directives. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # After this file is processed, the server will look for and process # /usr/conf/srm.conf and then /usr/conf/access.conf # unless you have overridden these with ResourceConfig and/or # AccessConfig directives here. # # The configuration directives are grouped into three basic sections: # 1. Directives that control the operation of the Apache server process as a # whole (the 'global environment'). # 2. Directives that define the parameters of the 'main' or 'default' server, # which responds to requests that aren't handled by a virtual host. # These directives also provide default values for the settings # of all virtual hosts. # 3. Settings for virtual hosts, which allow Web requests to be sent to # different IP addresses or hostnames and have them handled by the # same Apache server process. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/foo.log" # with ServerRoot set to "/usr/local/apache" will be interpreted by the # server as "/usr/local/apache/logs/foo.log". # ### Section 1: Global Environment # # The directives in this section affect the overall operation of Apache, # such as the number of concurrent requests it can handle or where it # can find its configuration files. # # # ServerType is either inetd, or standalone. Inetd mode is only supported on # Unix platforms. # ServerType standalone # -------------- I hope this would be some more enlightenment. regards, Jose |
This is a followup post after another try.
When I try to type 'sudo /usr/sbin/httpd -t', I get this error message ***** "Syntax error on line 379 of /etc/httpd/httpd.conf: Invalid command '<Directory>', perhaps mis-spelled or defined by a module not included in the server configuration" ****** And this what I have on my line 379 of my httpd.conf file ****** <Directory> Options FollowSymLinks AllowOverride None </Directory> ***** Thanks! |
1) The Perl command I gave you is not supposed to give any output - it just silently fixes the line endings in yoru file to be the UNIX style (expected by Apache).
2) If you have been editing the httpd.conf file in Dreamweaver, I wouldn't be surprised if it has been corrupted somehow. It is not an HTML file and so Dreamweaver may have screwed it up. You should get some other text editor to use in editing config files. One that is already on your system is 'pico' (execute this from the Terminal command line and follow the directions at the bottom). You probably should get a fresh copy of the httpd.conf file from your OS X install CD or by downloading it from Apache. Test that Apache works with this fresh copy before changing anything. Then save a copy and never edit that copy so you always have something you can compare with later. |
Hayne,
I patiently tried your suggestion of installting a fresh httpd.conf file from an apache package. And with that, I tried restarting my computer and starting apache from the terminal but, I still get just about the same result that looks like this. "/usr/sbin/apachectl start Syntax error on line 2 of /etc/httpd/httpd.conf: Invalid command '.so', perhaps mis-spelled or defined by a module not included in the server configuration /usr/sbin/apachectl start: httpd could not be started " Always, there is something wrong with the line 2. The only thing that change is the word after "Invalid command. Either it's 'so' , 'ners' or 'dModule' . And this is when I install a different httpd.conf file. I really hope that this would help enlighten us where the problem is really coming from. Thanks a gain Hayne. |
can you post the results of:
Code:
$ od -c /etc/httpd/httpd.conf| head |
stetner,
fisrt of all thanks for your time in helping me out. earlier today i tried reinstalling my apache from the install disk of my osx and at the same time i tried reinstalling php which i got from enthropy. and with a bit of luck, i was able to run my apache once again. i tried running "od -c /etc/httpd/httpd.conf| head" and i got the same result as what you have posted. but with this problem solve, i know that there is still more to learn about apache and php. anyway, thank you all for the guidance and patience. jose |
The same problem, but different symptoms...
I tried following some online instructions on upgrading to Apache 1.3.29 a few days ago, but ever since, Personal Web Sharing refuses to start from System Preferences; it just greys-out when I click 'Start'.
At the end of the installation, it said it had been successfully installed: Code:
+--------------------------------------------------------+Code:
Mac:~ George$ /usr/sbin/apachectl startCode:
Mac:~ George$ httpd -v |
You might want to check your /etc/httpd/httpd.conf file to see if the hfs module is named right in it. Mine says:
Code:
$ grep hfs /etc/httpd/httpd.confAs well, what does Code:
$ ls -l /usr/libexec/httpd/mod_hfs_apple.soCode:
$ nm /usr/libexec/httpd/mod_hfs_apple.so |
Code:
Mac:~ George$ ls -l /usr/libexec/httpd/mod_hfs_apple.soCode:
Mac:~ George$ nm /usr/libexec/httpd/mod_hfs_apple.so |
Hi George, again we are seeing a difference between your files and mine, even though we are both on 10.3.3.
Code:
yoursI get the feeling that we may find ourselves in the same situation as the sudo issue, where re-installing the files from the source may be the solution. |
I think I clean installed on version 10.3.2, and I've been using software update on a regular basis, so all available updates are installed at the moment.
I've reinstalled, but I'm left with Apache version 1.3.28. Is there any recommended of installing the upgrade to 1.3.29? Your help is valued. |
Looking through my receipts under /Library/Receipts it appears that /usr/sbin/httpd was updated last in 10.3.3 and /usr/libexec/httpd/mod_hfs_apple.so came from my original 10.3 install.
Code:
using lsbom <package>.pkg/Contents/Archive.bom and grepping for sbin/httpd and mod_hfs |
| All times are GMT -5. The time now is 07:33 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.