Changes for page Development Tools-Running Through Apache
Last modified by Aaron Rosenzweig on 2011/05/09 01:46
From version 46.1
edited by Mike Schrag
on 2007/10/18 10:22
on 2007/10/18 10:22
Change comment:
There is no comment for this version
To version 48.1
edited by Kieran Kelleher
on 2007/10/18 08:07
on 2007/10/18 08:07
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. mschrag1 +XWiki.kieran - Content
-
... ... @@ -6,7 +6,7 @@ 6 6 7 7 When you turn on your web server, Apache will listen on the network interfaces that were configured when it starts. If you change networks, you may need to manually restart apache. You can do this by either stopping and restarting Personal Web Sharing, or you can run "apachectl restart" from the commandline as the root user. Because this can get annoying if you are working on a laptop, or periodically using VPN's, there are a couple ways to make this process easier. 8 8 9 -= OptionalExtraConfiguration#1: Explicitly Setting Your Hostname =9 += Restarting Apache Fix #1: Explicitly Setting Your Hostname = 10 10 11 11 {{info title="Useful Information"}} 12 12 ... ... @@ -18,7 +18,7 @@ 18 18 19 19 == Edit Apache Config == 20 20 21 -{{warning title="Bonjour, comment ça va? .... Trés bien, merci!"}}21 +{{warning title="Bonjour, comment ca va? .... Trés bien, merci!"}} 22 22 23 23 *Do NOT try to use the Bonjour / Rendezvous name of your machine in this step.* It will cause you grief. Accept this and don't even try. You have been warned. 24 24 ... ... @@ -40,16 +40,6 @@ 40 40 41 41 {{/code}} 42 42 43 -== Tell the adaptor to use localhost == 44 - 45 -Edit **/System/Library/WebObjects/Adaptors/Apache/apache.conf** to make sure that your enabled/uncommented WebObjectsConfig property looks like this: 46 - 47 -{{code}} 48 - 49 -WebObjectsConfig http://localhost:1085 10 50 - 51 -{{/code}} 52 - 53 53 == Tell wotaskd to Use Localhost Too == 54 54 55 55 Edit **/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources/Properties** ... ... @@ -92,15 +92,8 @@ 92 92 93 93 You may want to set this in your global WOLips settings so you don't have to set it every time you make a new launch configuration. You will need to go back and modify existing launch configurations with these settings even if you set it globally. Global settings only apply to newly created launch configurations. 94 94 95 -= Optional Extra Configuration#2:ApacheAutoKickstart =85 += Restarting Apache Fix #2: Kickstart = 96 96 97 -{{info title="Why would I need this?"}} 98 - 99 -If you have a laptop and you get an "Application cannot be found" or some such error in the browser after auto-switching networks (for example going from a work network to a home network), restarting apache can resolve the error condition most of the time. This section details how to automate that. 100 -If you already implemented the "localhost" explicit hostname setup above, then you will not need to bother with this section. 101 - 102 -{{/info}} 103 - 104 104 The alternative way to restart apache is to have a script run any time your network changes. It turns out that OS X supports such a capability already via Kickstart. 105 105 106 106 == Making a restart script == ... ... @@ -115,3 +115,47 @@ 115 115 /usr/sbin/apachectl start 116 116 117 117 {{/code}} 101 + 102 +== Modifying Kicker == 103 + 104 +1. Edit /System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/Kicker.xml 105 +1. At the end of the <array> section, add the following block of XML: 106 + 107 +{{code}} 108 + 109 +<dict> 110 + <key>execCommand</key> 111 + <string>/usr/local/bin/restartApache</string> 112 + <key>execUID</key> 113 + <integer>0</integer> 114 + <key>keys</key> 115 + <array> 116 + <string>State:/Network/Global/DNS</string> 117 + <string>State:/Network/Global/IPv4</string> 118 + <string>State:/Network/Global/IPv6</string> 119 + <string>State:/Network/Global/NetInfo</string> 120 + </array> 121 + <key>name</key> 122 + <string>restart_apache</string> 123 + </dict> 124 + 125 +{{/code}} 126 + 127 +== Restart == 128 + 129 +Restart your machine (you may be able to get away with just logging out and back in). Any network changes will now automatically restart Apache. 130 + 131 +== Extra Credit == 132 + 133 +I also like to have a growl notification fire when my Apache restarts. To do this: 134 + 135 +1. grab the growl shell script from [[http://www.macosxhints.com/dlfiles/growl_sh.txt]]. 136 +1. next, at the end of your /usr/local/bin/restartApache script, you can add: 137 + 138 +{{code}} 139 + 140 +export G_APPLICATION_ICON=EOModeler.app 141 +export G_TITLE=WebObjects 142 +/usr/local/bin/growl "Apache Restarted" 143 + 144 +{{/code}}