|
|
The Mac Way
I don't know why Apache wouldn't be starting correctly after a power failure on a system with a journaled file system. But if this is a persistent issue then you need to use a more savvy method to restart it than a login item. The way Apache starts during boot on Mac OS X is through the script /System/Library/StartupItems/Apache/Apache. Whether or not it starts is controlled by the line WEBSERVER=-YES- in /etc/hostconfig. When you click the checkbox in the Sharing panel this line in /etc/hostconfig is set to -YES- and Apache is started with the command SystemStarter start "Web Server". If you are finding that Apache isn't starting after a power failure, one way to handle it is to make your own StartupItems bundle in the user-configurable /Library/StartupItems folder following Apple's methods (which may or may not work if it runs into the same problem). But the smartest method by far is to create a cron script that tests for the Apache process every five minutes and runs SystemStarter start "Web Server" as root if it finds no Apache running. In fact here's the script:
By the way the appropriate place to use apachectl graceful is when you're doing something like rolling the logs in a script or editing the httpd.conf file and you want to restart Apache without disrupting connected users. ---
The Mac Way (10.2)
I see your post referred to 10.2 and not 10.3, so I'm not sure if the SystemStarter works the same way. If not you can replace the systemstarter line in the cron script with apachectl start and it will work just fine. The main reason I suggest the SystemStarter method is that it shields you from the variety and version of web server.
---
The Mac Way
Nice post slur. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|