Laran Evans
I develop software people love to use.
  • Home
  • About
  • Contact
  • Resume
  • Testimonials
Skip to content
  • Entrepreneurship
    • Leadership
    • Project Management
    • Team Development
    • Time Management
  • Puzzles
  • Software Architecture
    • Cloud Computing
  • Software Development
    • Algorithms
    • CSS
    • Java
    • Javascript
    • MySQL
    • PHP
    • Python
    • Ruby and Rails
    • System Administration
« 6 Must-Know Sys-Admin How-Tos for Web Developers
How to Upgrade MacPorts Without Deleting Everything »

Simple Fix for Apache on Snow Leopard

By laran | Published: 2009/12/27

After upgrading to Snow Leopard last week several things broke. One of the victims was Apache.

I like to keep my environment as “stock” as possible. Fewer customizations means having to work around fewer things as I make the changes that I absolutely need to make.

Since Snow Leopard comes bundled with updated versions of both Apache and PHP, I decided to use those versions instead of the MacPorts versions which I had to use on Leopard. However, after removing the MacPorts versions and enabling the default versions I still couldn’t get Apache to run properly.

The problem turned out to be what Apple probably considers a “feature”, though I think it’s broken even as such.

The problem is in the apache daemon configuration file: /System/Library/LaunchDaemons/org.apache.httpd.plist

The default version of this file (installed by Snow Leopard) looks like this:

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

The reason I’ve been unable to access content which Apache should have been serving was these two lines:

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

The reason I say that this is still a bug, and should be fixed by Apple is that the Disabled setting remained even after I disabled and then re-enabled the Web Sharing service in my System Preferences. Doing this should have changed that value.

So, in order to get Apache running properly again I had to comment out the Disabled setting, like so.

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

After making this change and restarting my system, everything worked.

This entry was posted in System Administration and tagged apache, osx, snow leopard. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
« 6 Must-Know Sys-Admin How-Tos for Web Developers
How to Upgrade MacPorts Without Deleting Everything »

Post a Comment

Click here to cancel reply.

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • About Me

    I've got a masters degree in computer science and over 10 years of experience building web-based systems using Java/J2EE, Ruby, Rails and PHP. I'm a strong believer in the effectiveness of Agile Methods. Read more »

  • Subscribe

  • Similar Posts
    • 6 Must-Know Sys-Admin How-Tos for Web Developers
    • How to Upgrade MacPorts Without Deleting Everything
    • Installing Magento on Dreamhost the easy way
    • What's running on port XXXX?
    • Debugging Cron on Ubuntu
Hello world
  • From Around the Web

    • Chopper Girl @ The 2010 Brass Balls Long Road Party (Uploads from BRASS BALLS BOBBERS)
    • Web App Business Models: User Needs and What People Pay For (Box UK Blog)
    • Blog Writing Tips from the World’s Most Famous Authors (Blogsessive.com)
    • How to get exponential success on your blog (CatsWhoBlog.com)
    • The Four Stages of Growing a Blog (Daily Blog Tips)
    Shared Items
  • Recent Posts

    • 80 pages of Ruby on Rails Performance Optimization Tips
    • Ruby Garbage Collection In-Depth
    • Binary Logic Basics
    • Kuali in Nacubo Magazine
    • Ruby Blocks, Procs, Lambda
  • Older Posts By Month

    Let's Talk

    Ask a question below. You'll be prompted for your name and email after you click the "Ask" button.

Know more. Accomplish more. Succeed.