The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   Stuck with Personal Web Sharing (http://hintsforums.macworld.com/showthread.php?t=20049)

jkinberg 01-27-2004 03:21 AM

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

stetner 01-27-2004 07:58 AM

What do the log files say....
Code:

/var/log/httpd/access_log
/var/log/httpd/error_log


jkinberg 01-27-2004 09:44 AM

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

stetner 01-27-2004 10:03 AM

Try
Code:

sudo cat /var/log/httpd/errorlog

jkinberg 01-27-2004 04:12 PM

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

jkinberg 01-27-2004 04:22 PM

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.

stetner 01-28-2004 08:33 AM

Code:

[Tue Jan 27 01:55:45 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
This means one of two things:

- 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/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

It also helps a lot NOT to edit what you find in the logs when you post here. What you may think is unimportant (even things like date/time stamps) could be the thing that gives someone a clue to your problem. You don't need to post the last two years of logs, but the last 'run' or two is usually helpful.

That said, I would do the following to see if a daemon is hanging around:
Code:

$ ps -auxww | grep httpd
root      481  0.0  0.3    32308  3116  ??  Ss    1:41PM  0:03.43 /usr/sbin/httpd
www      483  0.0  0.1    32308  1000  ??  S    1:41PM  0:00.02 /usr/sbin/httpd
stetner  2175  0.0  0.0    18172    344 std  S+  11:26PM  0:00.01 grep httpd
$ netstat -na | grep 80 | grep LISTEN
tcp4      0      0  *.80                  *.*                    LISTEN
$ netstat -a | grep http
tcp4      0      0  *.http                *.*                    LISTEN

(the first netstat command is quicker, but both provide the same info really)

The 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?

jkinberg 01-28-2004 10:20 AM

Here's what I get when I run those commands:

Code:

[josh:~] josh% ps -auxww |grep httpd
root    422  0.0  0.1    2628  1176  ??  Ss  10:12AM  0:00.04 /usr/sbin/httpd
nobody  429  0.0  0.0    2628    280  ??  S    10:12AM  0:00.00 /usr/sbin/httpd
nobody  430  0.0  0.0    2628    280  ??  S    10:12AM  0:00.00 /usr/sbin/httpd
nobody  431  0.0  0.0    2628    280  ??  S    10:12AM  0:00.00 /usr/sbin/httpd
nobody  432  0.0  0.0    2628    280  ??  S    10:12AM  0:00.01 /usr/sbin/httpd
nobody  433  0.0  0.0    2628    276  ??  S    10:12AM  0:00.00 /usr/sbin/httpd
josh    490  0.0  0.0    1416    308 std  S+  10:16AM  0:00.00 grep httpd
[josh:~] josh% netstat -na | grep 80 | grep LISTEN
tcp4      0      0  *.80                  *.*                    LISTEN
[josh:~] josh% netstat -a | grep http
tcp4      0      0  *.http                *.*                    LISTEN


jkinberg 01-28-2004 12:27 PM

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 httpd
root    889  0.0  0.1    2628  1148  ??  Ss  12:07PM  0:00.03 /usr/sbin/httpd
nobody  890  0.0  0.1    2884    796  ??  S    12:07PM  0:00.01 /usr/sbin/httpd
nobody  891  0.0  0.1    2628    592  ??  S    12:07PM  0:00.02 /usr/sbin/httpd
nobody  892  0.0  0.1    2628    620  ??  S    12:07PM  0:00.01 /usr/sbin/httpd
nobody  893  0.0  0.0    2628    272  ??  S    12:07PM  0:00.00 /usr/sbin/httpd
nobody  894  0.0  0.0    2628    272  ??  S    12:07PM  0:00.01 /usr/sbin/httpd
nobody  902  0.0  0.0    2628    268  ??  S    12:07PM  0:00.00 /usr/sbin/httpd
nobody  913  0.0  0.0    2628    268  ??  S    12:09PM  0:00.01 /usr/sbin/httpd
josh    925  0.0  0.0    1116      4 std  R+  12:13PM  0:00.00 grep httpd
[josh:~] josh% netstat -na | grep 80 | grep LISTEN
tcp4      0      0  *.80                  *.*                    LISTEN
[josh:~] josh% netstat -a | grep http
tcp4      0      0  *.http                *.*                    LISTEN

Also, I checked the error_log again, here is the output (its a lot of stuff, so I went back a week in the time stamps. A lot of it is repetitive):
Code:

[Tue Jan 20 14:43:44 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
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 20 15:41:12 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Thu Jan 22 02:47:52 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Thu Jan 22 12:48:59 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Sat Jan 24 21:24:49 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Sun Jan 25 22:33:05 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Mon Jan 26 02:42:13 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
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
[Mon Jan 26 13:31:11 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
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
[Mon Jan 26 13:51:43 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
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
[Mon Jan 26 13:54:48 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Mon Jan 26 15:16:45 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
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
[Mon Jan 26 16:54:44 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 00:29:43 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
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
[Tue Jan 27 02:30:19 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 02:36:39 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 02:41:46 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 02:44:08 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 02:47:15 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 03:17:10 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 03:17:58 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 03:18:30 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 03:25:57 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 09:41:38 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Tue Jan 27 16:08:14 2004] [crit] (48)Address already in use: make_sock: could not bind to port 80
[Wed Jan 28 02:20:06 2004] [notice] Apache/1.3.27 (Darwin) configured -- resuming normal operations
[Wed Jan 28 02:20:06 2004] [notice] Accept mutex: flock (Default: flock)
[Wed Jan 28 02:21:09 2004] [notice] caught SIGTERM, shutting down
[Wed Jan 28 10:12:39 2004] [notice] Apache/1.3.27 (Darwin) configured -- resuming normal operations
[Wed Jan 28 10:12:39 2004] [notice] Accept mutex: flock (Default: flock)

And the access_log:
Code:

10.0.1.16 - - [12/Dec/2003:12:05:11 -0500] "GET /~josh/ HTTP/1.1" 200 4499
10.0.1.16 - - [12/Dec/2003:12:05:11 -0500] "GET /~josh/stylesheet.css HTTP/1.1" 200 969
10.0.1.16 - - [12/Dec/2003:12:05:11 -0500] "GET /favicon.ico HTTP/1.1" 404 284
10.0.1.16 - - [12/Dec/2003:12:05:11 -0500] "GET /~josh/nav.html HTTP/1.1" 200 1910
10.0.1.16 - - [12/Dec/2003:12:05:15 -0500] "GET / HTTP/1.1" 200 1456
10.0.1.16 - - [12/Dec/2003:12:05:15 -0500] "GET /apache_pb.gif HTTP/1.1" 200 2326
10.0.1.16 - - [12/Dec/2003:12:05:48 -0500] "GET /~josh/thesis/index.html HTTP/1.1" 404 296
10.0.1.16 - - [12/Dec/2003:12:05:52 -0500] "GET /~josh/interface/index.html HTTP/1.1" 404 299
10.0.1.16 - - [12/Dec/2003:12:05:55 -0500] "GET /~josh/designing_ed/index.html HTTP/1.1" 404 302
10.0.1.16 - - [12/Dec/2003:12:05:57 -0500] "GET /~josh/avsys/index.html HTTP/1.1" 404 295
149.31.137.34 - - [28/Jan/2004:12:07:26 -0500] "GET / HTTP/1.1" 200 1456
149.31.137.34 - - [28/Jan/2004:12:07:26 -0500] "GET /apache_pb.gif HTTP/1.1" 200 2326
149.31.137.34 - - [28/Jan/2004:12:07:56 -0500] "GET / HTTP/1.1" 200 1456
149.31.137.34 - - [28/Jan/2004:12:07:56 -0500] "GET /apache_pb.gif HTTP/1.1" 200 2326
149.31.137.34 - - [28/Jan/2004:12:09:16 -0500] "GET /~josh HTTP/1.1" 404 278
127.0.0.1 - - [28/Jan/2004:12:09:21 -0500] "GET /~josh HTTP/1.1" 404 278
127.0.0.1 - - [28/Jan/2004:12:09:21 -0500] "GET /favicon.ico HTTP/1.1" 404 284
127.0.0.1 - - [28/Jan/2004:12:09:24 -0500] "GET /~josh HTTP/1.1" 404 278


jkinberg 01-28-2004 12:44 PM

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.

stetner 01-28-2004 05:40 PM

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.conf
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
MinSpareServers 1
MaxSpareServers 5
StartServers 1
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  when the value of (unsigned)Group is above 60000;
#  don't use Group "#-1" on these systems!
User www
Group www

and
Code:

$ nidump passwd / | egrep 'www|nobody'
nobody:*:-2:-2::0:0:Unprivileged User:/var/empty:/usr/bin/false
www:*:70:70::0:0:World Wide Web Server:/Library/WebServer:/usr/bin/false
$ nidump group / | egrep 'www|nobody'
nobody:*:-2:
www:*:70:

What I see is that you have 7 usable daemons running, and when you turn on web sharing, they all get a signal to reconfigure and then 1 of them gets the port and 6 of them complain that they can't get the port.

Try completely shutting down http:
Code:

/usr/sbin/apachectl stop
check for any http processes still kicking around and kill them
Code:

$ ps -auxww | grep http
$ sudo killall httpd
$ ps -auxww | grep http

If any are still there do a 'killall -9 httpd'. At this point you should now have no httpd running.do a
Code:

$ /usr/sbin/apachectl start
and then a
Code:

$ ps -auxww | grep http
what is running now?

edit: toss in some color

jkinberg 01-28-2004 06:13 PM

Here's what I get with all that:

Code:

[josh:~] josh% egrep 'User |Group |MinS|MaxS|StartS' /etc/httpd/httpd.conf
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
MinSpareServers 5
MaxSpareServers 10
StartServers 5
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  when the value of (unsigned)Group is above 60000;
#  don't use Group nobody on these systems!
User nobody
Group nobody
[josh:~] josh% nidump passwd / | egrep 'www|nobody'
nobody:*:-2:-2::0:0:Unprivileged User:/dev/null:/dev/null
www:*:70:70::0:0:World Wide Web Server:/Library/WebServer:/dev/null
[josh:~] josh% /usr/sbin/apachectl stop
/usr/sbin/apachectl stop: httpd (pid 3984?) not running
[josh:~] josh% ps -auxww | grep http
root    3984  0.0  0.1    2628  1168  ??  Ss    6:03PM  0:00.07 /usr/sbin/httpd
nobody  3987  0.0  0.0    2628    276  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
nobody  3988  0.0  0.0    2628    276  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
nobody  3989  0.0  0.0    2628    276  ??  S    6:03PM  0:00.01 /usr/sbin/httpd
nobody  3990  0.0  0.0    2628    276  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
nobody  3991  0.0  0.0    2628    272  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
josh    4027  0.0  0.0    1116      4 std  R+    6:10PM  0:00.00 grep http
[josh:~] josh% sudo killall httpd
Password:
[josh:~] josh% ps -auxww | grep http
josh    4030  0.0  0.0    1116      4 std  R+    6:11PM  0:00.00 grep http
[josh:~] josh% sudo killall -9 httpd
No matching processes were found
[josh:~] josh% /usr/sbin/apachectl start
fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl start: httpd could not be started
[josh:~] josh% ps -auxww | grep http
josh    4035  0.0  0.0    1116      4 std  R+    6:11PM  0:00.00 grep http


jkinberg 01-28-2004 06:16 PM

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
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
MinSpareServers 5
MaxSpareServers 10
StartServers 5
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  when the value of (unsigned)Group is above 60000;
#  don't use Group nobody on these systems!
User nobody
Group nobody
[josh:~] josh% nidump passwd / | egrep 'www|nobody'
nobody:*:-2:-2::0:0:Unprivileged User:/dev/null:/dev/null
www:*:70:70::0:0:World Wide Web Server:/Library/WebServer:/dev/null
[josh:~] josh% /usr/sbin/apachectl stop
/usr/sbin/apachectl stop: httpd (pid 3984?) not running
[josh:~] josh% ps -auxww | grep http
root    3984  0.0  0.1    2628  1168  ??  Ss    6:03PM  0:00.07 /usr/sbin/httpd
nobody  3987  0.0  0.0    2628    276  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
nobody  3988  0.0  0.0    2628    276  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
nobody  3989  0.0  0.0    2628    276  ??  S    6:03PM  0:00.01 /usr/sbin/httpd
nobody  3990  0.0  0.0    2628    276  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
nobody  3991  0.0  0.0    2628    272  ??  S    6:03PM  0:00.00 /usr/sbin/httpd
josh    4027  0.0  0.0    1116      4 std  R+    6:10PM  0:00.00 grep http
[josh:~] josh% sudo killall httpd
Password:
[josh:~] josh% ps -auxww | grep http
josh    4030  0.0  0.0    1116      4 std  R+    6:11PM  0:00.00 grep http
[josh:~] josh% sudo killall -9 httpd
No matching processes were found
[josh:~] josh% /usr/sbin/apachectl start
fopen: Permission denied
httpd: could not open error log file /private/var/log/httpd/error_log.
/usr/sbin/apachectl start: httpd could not be started
[josh:~] josh% ps -auxww | grep http
josh    4035  0.0  0.0    1116      4 std  R+    6:11PM  0:00.00 grep http


stetner 01-28-2004 06:21 PM

Whoops,
Code:

$ sudo /usr/sbin/apachectl start

jkinberg 01-28-2004 06:26 PM

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
Password:
Sorry, try again.
Password:
/usr/sbin/apachectl start: httpd started
[josh:~] josh% ps -auxww | grep http
root    4064  0.0  0.1    2628  1184  ??  Ss    6:24PM  0:00.05 /usr/sbin/httpd
nobody  4065  0.0  0.0    2628    276  ??  S    6:24PM  0:00.00 /usr/sbin/httpd
nobody  4066  0.0  0.0    2628    276  ??  S    6:24PM  0:00.00 /usr/sbin/httpd
nobody  4067  0.0  0.0    2628    276  ??  S    6:24PM  0:00.00 /usr/sbin/httpd
nobody  4068  0.0  0.0    2628    276  ??  S    6:24PM  0:00.00 /usr/sbin/httpd
nobody  4069  0.0  0.0    2628    276  ??  S    6:24PM  0:00.00 /usr/sbin/httpd
josh    4071  0.0  0.0    1116      4 std  R+    6:24PM  0:00.00 grep http


stetner 01-28-2004 06:35 PM

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 nobody
Group nobody

to
Code:

User www
Group www

stopping the server before you edit and starting it again afterwords of course. As far as I know 'www' is the standard setup on the Mac.

stetner 01-28-2004 06:38 PM

Quote:

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?
You should get '/Library/WebServer/Documents/' when you go to 'http://localhost/'
and you should get '/Users/josh/Sites/index.html' when you go to 'http://localhost/~josh/'.

jkinberg 01-28-2004 06:39 PM

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.

stetner 01-28-2004 06:54 PM

Quote:

Originally posted by jkinberg
except I had to change "Sites" to "public_html"
What does this show for your user?
Code:

$ cat /etc/httpd/users/generic.conf
<Directory "/Users/generic/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

IE for /etc/httpd/users/josh.conf

jkinberg 01-28-2004 07:00 PM

That's what I get:
Code:

[josh:~] josh% sudo cat /etc/httpd/users/josh.conf
<Directory "/Users/josh/Sites/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

I was looking at /etc/httpd/httpd.conf and found this on line 410-415:
Code:

# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
<IfModule mod_userdir.c>
    UserDir public_html
</IfModule>

Which made me think to change "Sites" to "public_html". I guess I could have changed httpd.conf too, but I didn't think I should mess with it.

stetner 01-28-2004 07:25 PM

Interesting, mine shows:
Code:

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
<IfModule mod_userdir.c>
    UserDir Sites
</IfModule>

And it is that way in all these files (most notably the httpd.conf.default file)

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
I have made some changes to mine, but if yours is supposed to be quite default, you should not see too many differences between these files.

jkinberg 01-28-2004 07:40 PM

quite a few differences:
Code:

[josh:~] josh% sudo diff -b /etc/httpd/httpd.conf /etc/httpd/httpd.conf.default
139,140c139,140
< MinSpareServers 5
< MaxSpareServers 10
---
> MinSpareServers 1
> MaxSpareServers 5
146c146
< StartServers 5
---
> StartServers 1
171c171
< MaxRequestsPerChild 0
---
> MaxRequestsPerChild 100000
239a240,241
> LoadModule hfs_apple_module  libexec/httpd/mod_hfs_apple.so
> LoadModule rendezvous_apple_module libexec/httpd/mod_rendezvous_apple.so
280a283,284
> AddModule mod_hfs_apple.c
> AddModule mod_rendezvous_apple.c
326,327c330,331
< User nobody
< Group nobody
---
> User www
> Group www
334c338
< ServerAdmin root@edo
---
> #ServerAdmin webmaster@example.com
352c356
< #ServerName edo
---
> #ServerName gump
414c418
<    UserDir public_html
---
>    UserDir Sites
421c425
< #<Directory /home/*/public_html>
---
> #<Directory /home/*/Sites>
848a853
>    AddType image/x-icon .ico
1055a1061,1067
>
> <IfModule mod_rendezvous_apple.c>
> RegisterUserSite all-users
> RegisterDefaultSite
> </IfModule>
>
> Include /private/etc/httpd/users


stetner 01-28-2004 08:22 PM

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.default
139,140c139,140
< MinSpareServers 5
< MaxSpareServers 10
---
> MinSpareServers 1
> MaxSpareServers 5
146c146
< StartServers 5
---
> StartServers 1

For a personal machine you probably don't need 5-10 servers
Code:

171c171
< MaxRequestsPerChild 0
---
> MaxRequestsPerChild 100000

Code:

The MaxRequestsPerChild directive sets the limit on the number of
requests that an individual child server process will handle. After MaxRequestsPerChild
requests, the child process will die. If MaxRequestsPerChild is 0, then the
process will never expire.

Hmm, I guess I would probably never get to 100000 requests on my home machine so this is probably moot.
Code:

239a240,241
> LoadModule hfs_apple_module  libexec/httpd/mod_hfs_apple.so
> LoadModule rendezvous_apple_module libexec/httpd/mod_rendezvous_apple.so
280a283,284
> AddModule mod_hfs_apple.c
> AddModule mod_rendezvous_apple.c

hfs should probably be in there, rendezvous probably does not matter.
Code:

326,327c330,331
< User nobody
< Group nobody
---
> User www
> Group www

Yep, that should probably change.
Code:

334c338
< ServerAdmin root@edo
---
> #ServerAdmin webmaster@example.com
352c356
< #ServerName edo
---
> #ServerName gump

who is root @ edo ?? you?
Code:

414c418
<    UserDir public_html
---
>    UserDir Sites
421c425
< #<Directory /home/*/public_html>
---
> #<Directory /home/*/Sites>

Yep, the reason you needed to create public_html...
Code:

848a853
>    AddType image/x-icon .ico
1055a1061,1067
>
> <IfModule mod_rendezvous_apple.c>
> RegisterUserSite all-users
> RegisterDefaultSite
> </IfModule>
>
> Include /private/etc/httpd/users

Should be there if the rendezvous module is.

Anyway, like I said, I would probably replace your httpd.conf with the default one.

jkinberg 01-29-2004 01:38 AM

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!

tymac 02-12-2004 02:20 PM

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

hayne 02-13-2004 12:56 AM

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

tymac 02-13-2004 02:11 AM

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

tymac 02-13-2004 02:20 AM

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!

hayne 02-13-2004 01:47 PM

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.

tymac 02-14-2004 08:15 PM

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.

stetner 02-15-2004 02:36 AM

can you post the results of:
Code:

$ od -c /etc/httpd/httpd.conf| head
0000000    #  #  \n  #  #      h  t  t  p  d  .  c  o  n  f
0000020        -  -      A  p  a  c  h  e      H  T  T  P   
0000040    s  e  r  v  e  r      c  o  n  f  i  g  u  r  a
0000060    t  i  o  n      f  i  l  e  \n  #  #  \n  \n  #  \n
0000100    #      B  a  s  e  d      u  p  o  n      t  h  e
0000120        N  C  S  A      s  e  r  v  e  r      c  o  n
0000140    f  i  g  u  r  a  t  i  o  n      f  i  l  e  s
0000160        o  r  i  g  i  n  a  l  l  y      b  y      R
0000200    o  b      M  c  C  o  o  l  .  \n  #  \n  #      T
0000220    h  i  s      i  s      t  h  e      m  a  i  n

It really sounds like you have some problem with the line endings on your file and this will show what they are.

tymac 02-15-2004 10:48 AM

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

George83 05-13-2004 05:47 PM

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:

+--------------------------------------------------------+
| You now have successfully built and installed the      |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the        |
| (initially created or preserved) configuration files  |
|                                                        |
|  /etc/httpd/httpd.conf
|                                                        |
| and then you should be able to immediately fire up    |
| Apache the first time by running:                      |
|                                                        |
|  /usr/sbin/apachectl start
|                                                        |
| Thanks for using Apache.      The Apache Group        |
|                                http://www.apache.org/  |
+--------------------------------------------------------+

Here are some commands and their outputs, which may help:

Code:

Mac:~ George$ /usr/sbin/apachectl start
dyld: /usr/sbin/httpd Undefined symbols:
_hfs_apple_module
/usr/sbin/apachectl: line 175:  737 Trace/BPT trap          $HTTPD
/usr/sbin/apachectl start: httpd could not be started

Code:

Mac:~ George$ httpd -v
Server version: Apache/1.3.29 (Darwin)
Server built:  Feb  4 2004 10:31:58

Seeing as I installed it a few days ago, surely the timestamp should be a date in May?

stetner 05-13-2004 07:14 PM

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.conf
LoadModule hfs_apple_module  libexec/httpd/mod_hfs_apple.so
AddModule mod_hfs_apple.c
$ /usr/sbin/httpd -v
Server version: Apache/1.3.29 (Darwin)
Server built:  Feb  4 2004 10:31:58

I seem to recall a naming change with this module a few versions back, but from what you posted it did not look like that.

As well, what does
Code:

$ ls -l /usr/libexec/httpd/mod_hfs_apple.so
-rwxr-xr-x  1 root  wheel  8888 13 Sep  2003 /usr/libexec/httpd/mod_hfs_apple.so*

Show? Oh yeah, this will show you the library symbols
Code:

$ nm /usr/libexec/httpd/mod_hfs_apple.so
        U __CurrentRuneLocale
        U ____tolower
        U _ap_make_array
        U _ap_pcalloc
        U _ap_pstrdup
        U _ap_push_array
        U _core_module
        U _free
00001004 D _hfs_apple_module
        U _malloc
        U _memcmp
        U _memset
        U _statfs
        U _strcat
        U _strcmp
        U _strcpy
        U _strlen
        U _strncmp


George83 05-13-2004 08:45 PM

Code:

Mac:~ George$ ls -l /usr/libexec/httpd/mod_hfs_apple.so
-rwxr-xr-x  1 root  wheel  9100 28 Jun  2001 /usr/libexec/httpd/mod_hfs_apple.so

There seems to be a considerable number of library symbols more than you:

Code:

Mac:~ George$ nm /usr/libexec/httpd/mod_hfs_apple.so
        U _FSGetCatalogInfo
        U _FSGetVolumeInfo
        U _FSPathMakeRef
        U __CurrentRuneLocale
        U ____tolower
0000069c t __dyld_func_lookup
00000000 t __mh_bundle_header
        U _ap_log_rerror
        U _ap_make_array
        U _ap_pcalloc
        U _ap_pstrcat
        U _ap_pstrdup
        U _ap_push_array
0000100c D _apple_hfs_module
        U _core_module
        U _free
        U _malloc
        U _strcasecmp
        U _strcmp
        U _strcpy
        U _strlen
        U _strncmp
0000066c t dyld_stub_binding_helper


stetner 05-13-2004 10:58 PM

Hi George, again we are seeing a difference between your files and mine, even though we are both on 10.3.3.

Code:

yours

-rwxr-xr-x  1 root  wheel  9100 28 Jun  2001 /usr/libexec/httpd/mod_hfs_apple.so

vs mine

-rwxr-xr-x  1 root  wheel  8888 13 Sep  2003 /usr/libexec/httpd/mod_hfs_apple.so*

How did you get to 10.3.3? upgrade or clean install? Have you installed the latest patches from software update?

I 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.

George83 05-14-2004 01:02 AM

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.

stetner 05-14-2004 01:53 AM

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
***** Essentials.pkg
./usr/libexec/httpd/mod_hfs_apple.so    100755  0/0    8888    4249249299
./usr/sbin/httpd        100755  0/0    398492  95398489
***** MacOSXUpdate10.3.3.pkg
./usr/sbin/httpd        100755  0/0    398492  3370360176
***** SecurityUpd2004-01-26Pan.pkg
./usr/sbin/httpd        100755  0/0    398492  2966414809


$ cksum /usr/libexec/httpd/mod_hfs_apple.so
4249249299 8888 /usr/libexec/httpd/mod_hfs_apple.so

$ cksum /usr/sbin/httpd
3370360176 398492 /usr/sbin/httpd

$ ll -drt Essentials.pkg MacOSXUpdate10.3.3.pkg SecurityUpd2004-01-26Pan.pkg
drwxr-xr-x  3 root    wheel  102 29 Oct  2003 Essentials.pkg/
drwxr-xr-x  3 stetner  wheel  102 27 Jan 21:47 SecurityUpd2004-01-26Pan.pkg/
drwxr-xr-x  3 stetner  wheel  102 16 Mar 16:46 MacOSXUpdate10.3.3.pkg/



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.