Changes for page Development Tools-Running Through Apache
Last modified by Aaron Rosenzweig on 2011/05/09 01:46
From version 54.1
edited by Kieran Kelleher
on 2007/10/18 08:04
on 2007/10/18 08:04
Change comment:
There is no comment for this version
To version 62.1
edited by smmccraw
on 2007/07/08 10:29
on 2007/07/08 10:29
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -Development Tools-Running Through Apache 1 +Programming__WebObjects-Development Tools-Running Through Apache - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. kieran1 +XWiki.smmccraw - Content
-
... ... @@ -1,26 +1,13 @@ 1 -If you are accessing your application with URLs that look like [[http://localhost:45437/cgi-bin/WebObjects/AppName.woa/]](with the xxx:portnum instead of xxxx/-portnum) ... then you are using the [[Evil Direct Connect>>Web Applications-Development-Direct Connect]]. See that[[page>>WebApplications-Development-Direct Connect]]for why you don't want to be using Direct Connect. See this page for how to stop.1 +If you are accessing your application with URLs that look like http:~/~/localhost:45437/cgi-bin/WebObjects/AppName.woa/ (with the xxx:portnum instead of xxxx/-portnum) ... then you are using the [[Evil Direct Connect>>Programming__WebObjects-Web Applications-Development-Direct Connect]]. See that page for why you don't want to be using Direct Connect. See this page for how to stop. 2 2 3 -= Turn ingon Apache =3 +== Turn on Apache == 4 4 5 -Go to **System Preferences > Sharing > Services** and turn on **Personal Web Sharing** if it is not already on. 5 +Go to **System Preferences -> Sharing -> Services** and turn on **Personal Web Sharing** if it is not already on. 6 6 7 - Whenyou turn on your web server, Apache will listen on the network interfaces that were configuredwhenitstarts. If you change networks, you may need to manually restart apache.You cando this by either stopping and restarting Personal Web Sharing, or you can run "apachectl restart"from the commandline as the root user. Because this cangetannoyingif you are working on a laptop, or periodically using VPN's, there are a couple ways to make this process easier.7 +== Edit Apache Config == 8 8 9 - =RestartingApacheFix#1:ExplicitlySettingYourHostname=9 +Note: **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. 10 10 11 -{{info title="Useful Information"}} 12 - 13 -The changes in this section are only required if you want your hostname to be stable across network changes. While this simplifies many aspects of development (like testing cookies and https), it may cause problems with those specific aspects (cookies, https, etc.) if you need to be able to access your dev machine from a remote machine, including if you need to be able to test your web app from a Parallels VM. 14 - 15 -Bonjour Delays: Apparently the procedure here is also useful for preventing "Bonjour" delays when you launch the browser to test your app on your development machine. 16 - 17 - 18 -{{/info}} 19 - 20 -== Edit Apache Config == 21 - 22 -Note: **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. 23 - 24 24 Edit **/etc/httpd/httpd.conf**, find the line containing **ServerName** and change it to this: 25 25 26 26 {{code}} ... ... @@ -37,7 +37,7 @@ 37 37 38 38 {{/code}} 39 39 40 -== Tell wotaskd to Use Localhost Too == 27 +== Tell wotaskd to Use Localhost Too == 41 41 42 42 Edit **/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources/Properties** 43 43 ... ... @@ -62,7 +62,7 @@ 62 62 63 63 restart wotaskd and womonitor with launchctl if your WebObjects install launches that way. 64 64 65 -== Finally, Configure your Application == 52 +== Finally, Configure your Application == 66 66 67 67 Add or edit these launch parameters: 68 68 ... ... @@ -78,64 +78,3 @@ 78 78 The WOPort is optional, but useful if you want consistent URLs for bookmarks and such. You can use any number you want, but it needs to be unique for each application you launch (or rather, you can only run one app instance on a given WOPort at a time). In WOLips, WOPort, WODirectConnectEnabled, and WOAdaptorURL already exist and just need to be updated. WOHost does not, and needs to be added. The dash in front of the name ("-WOHost") is important and must be in the name for the setting to work properly. 79 79 80 80 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. 81 - 82 -= Restarting Apache Fix #2: Kickstart = 83 - 84 -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. 85 - 86 -== Making a restart script == 87 - 88 -Create a script named /usr/local/bin/restartApache and set the contents to: 89 - 90 -{{code}} 91 - 92 -#!/bin/bash 93 -/usr/sbin/apachectl stop 94 -sleep 1 95 -/usr/sbin/apachectl start 96 - 97 -{{/code}} 98 - 99 -== Modifying Kicker == 100 - 101 -1. Edit /System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources/Kicker.xml 102 -1. At the end of the <array> section, add the following block of XML: 103 - 104 -{{code}} 105 - 106 -<dict> 107 - <key>execCommand</key> 108 - <string>/usr/local/bin/restartApache</string> 109 - <key>execUID</key> 110 - <integer>0</integer> 111 - <key>keys</key> 112 - <array> 113 - <string>State:/Network/Global/DNS</string> 114 - <string>State:/Network/Global/IPv4</string> 115 - <string>State:/Network/Global/IPv6</string> 116 - <string>State:/Network/Global/NetInfo</string> 117 - </array> 118 - <key>name</key> 119 - <string>restart_apache</string> 120 - </dict> 121 - 122 -{{/code}} 123 - 124 -== Restart == 125 - 126 -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. 127 - 128 -== Extra Credit == 129 - 130 -I also like to have a growl notification fire when my Apache restarts. To do this: 131 - 132 -1. grab the growl shell script from [[http://www.macosxhints.com/dlfiles/growl_sh.txt]]. 133 -1. next, at the end of your /usr/local/bin/restartApache script, you can add: 134 - 135 -{{code}} 136 - 137 -export G_APPLICATION_ICON=EOModeler.app 138 -export G_TITLE=WebObjects 139 -/usr/local/bin/growl "Apache Restarted" 140 - 141 -{{/code}}