Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Background:

I use my Mac for web development, running copies of web sites locally. I recently installed the Snow Leopard update, which to all intents and purposes seems to have gone fine, except...

What's not working?

Web-sharing; more specifically I can't turn it on via preferences. The preference pane just hangs when I try to.

So Apache doesn't start on reboot. I can start Apache by hand, but I don't know enough to either setup apache to start with the computer, or to properly fix web sharing.

Further details

My Apache error log shows nothing on when the system boots up (as I would expect).

This is the error message when I try to start web sharing from the sharing preference pane.

28/09/2009 10:58:05 System Preferences[834]	setInetDServiceEnabled failed with 1 for org.apache.httpd

Here's the messages given when I start apache from the command line.

[Mon Sep 28 10:35:53 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon Sep 28 10:35:54 2009] [warn] mod_bonjour: Skipping user 'sams' - index file /Users/sams/Sites/index.html has zero length.
[Mon Sep 28 10:35:54 2009] [notice] Digest: generating secret for digest authentication ...
[Mon Sep 28 10:35:54 2009] [notice] Digest: done
[Mon Sep 28 10:35:54 2009] [notice] Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k DAV/2 PHP/5.3.0 Phusion_Passenger/2.2.5 configured -- resuming normal operations

Please let me know if you need any further details on this.

Any help would be greatly appreciated.

UPDATE

I have added an answer of my own below - I was able to solve it thanks to being pointed in the right direction by the comments below, so thanks very much. But I'm still not totally clear as to what caused the problem or how my solution addressed it, so I'm leaving the question open for now.

share|improve this question
    
In Leopard did you modify any of the Apache configuration files? Can you post a crash log? –  Chealion Sep 25 '09 at 15:45
    
Are there any Apache-related messages in the console? (run /Applications/Utilities/Console) –  Doug Harris Sep 25 '09 at 18:49
    
BTW: Error log by default in /private/var/log/apache2/error_log –  Doug Harris Sep 25 '09 at 18:51

2 Answers 2

up vote 2 down vote accepted

It's a bit of both. The disabled flag (removed when launchctl load -w /PATH/TO/PLIST is run - runs automatically when you check off "Web Sharing" in the Sharing Preference Pane) says it's not to be run. However because of that one line being outside of the dict it is appearing as a malformed file. Put the back into the with the previous values or delete it all together (see below).

An example working (but disabled) .plist from Snow Leopard

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <true/>
    <key>Label</key>
    <string>org.apache.httpd</string>
    <key>ProgramArguments</key>
    <array>
    	<string>/usr/sbin/httpd</string>
    	<string>-D</string>
    	<string>FOREGROUND</string>
    </array>
    <key>OnDemand</key>
    <false/>
    <key>SHAuthorizationRight</key>
    <string>system.preferences</string>
</dict>
</plist>
share|improve this answer
    
Thankyou, I think that clarified it nicely. –  Sam Murray-Sutton Oct 1 '09 at 15:06

Please feel free to add some clarity to the following answer. I'm not especially techincal, so most of my solution involves hacking between the two files. :)

Following on from the error messages above, I checked the org.apache.httpd.plist file. I then checked it against the plist file from before I installed Snow Leopard. The files differed in these points:

Snow Leopard config (Doesn't work)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Disabled</key>
    <true/>
    <key>Label</key>
    <string>org.apache.httpd</string>
    <key>EnvironmentVariables</key>
   <dict>
     <key>PATH</key>
   </dict>
     <string>/opt/local/bin:/usr/local/mysql/bin</string>
    <key>ProgramArguments</key>
    <array>

Previous Config (Works)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>EnvironmentVariables</key>
    <dict>
    	<key>PATH</key>
    	<string>/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>
    <key>KeepAlive</key>
    <false/>
    <key>Label</key>
    <string>org.apache.httpd</string>
    <key>OnDemand</key>
    <false/>
    <key>ProgramArguments</key>

There seem to be 3 problems here:

The following - I presume disables httpd? Or the file. Not totally sure.

<key>Disabled</key>
<true/>

This next line is different, so I'm assuming it points to the wrong location.

<string>/opt/local/bin:/usr/local/mysql/bin</string>

and this whole block seems like it's not properly formatted - i.e. the string element should be within the dict block.

   <dict>
     <key>PATH</key>
   </dict>
     <string>/opt/local/bin:/usr/local/mysql/bin</string>

So, could be any one of those. I wish I understood it better, but at least it's working now.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.