• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
apachectl restart
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

apachectl restart


  • Subject: apachectl restart
  • From: Mike Schrag <email@hidden>
  • Date: Tue, 25 Apr 2006 09:40:11 -0400

After getting tired of apachectl restart every time my network switches, I did some looking into having launchd do this for me ... I ended up with the following:

1) create a file (I used NetworkChangeApacheRestarter.plist) in / Library/LaunchAgents with the contents:

<?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>Label</key>
  <string>com.mdimension.NetworkChangeApacheRestarter</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/sbin/apachectl</string>
    <string>restart</string>
  </array>
  <key>WatchPaths</key>
  <array>
    <string>/Library/Preferences/SystemConfiguration</string>
  </array>
</dict>
</plist>

2) save and quit
3) run launchd
4) load /Library/LaunchAgents/NetworkChangeApacheRestarter.plist
5) start com.mdimension.NetworkChangeApacheRestarter
6) profit with all the extra free time you have from not having to run apachectl restart ever again


Note that this is a LITTLE aggressive, because it doesn't specifically watch for network changes, so any system configuration changes will apachectl restart, but that's a pretty non-invasive command all things considered.

ms
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Interfaces and Java Client
  • Next by Date: Re: multiple submit - possible workaround advice
  • Previous by thread: Re: Connecting to Mysql4.1 from EOModeler on WinXP
  • Next by thread: Sessions
  • Index(es):
    • Date
    • Thread