Changes for page Development Tools-Running Through Apache
Last modified by Aaron Rosenzweig on 2011/05/09 01:46
From version 32.1
edited by David Holt
on 2008/10/29 12:33
on 2008/10/29 12:33
Change comment:
There is no comment for this version
To version 31.1
edited by Pascal Robert
on 2011/05/09 01:42
on 2011/05/09 01:42
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. dholt1 +XWiki.probert - Content
-
... ... @@ -1,9 +1,15 @@ 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>>Web Applications-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>>Development-Direct Connect]]. See that [[page>>Development-Direct Connect]] for why you don't want to be using Direct Connect. See this page for how to stop. 2 2 3 +A summary of the following steps that applies specifically to MacOS X 10.5.5 can be found here: [[Running Through Apache - Leopard & Snow Leopard Client - Summary>>Running Through Apache - Leopard & Snow Leopard Client - Summary]] 4 + 3 3 = Turning on Apache = 4 4 5 -Go to **System Preferences > Sharing > Services** and turn on **Personal Web Sharing** if it is not already on. 7 +Go to **System Preferences > Sharing > Services** and turn on **Personal Web Sharing** if it is not already on. You can also do it by command line with "apachectl": 6 6 9 +{{code theme="Eclipse"}} 10 +sudo apachectl restart 11 +{{/code}} 12 + 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 9 = Optional Extra Configuration: Explicitly Setting Your Hostname = ... ... @@ -24,7 +24,7 @@ 24 24 25 25 {{/warning}} 26 26 27 -Edit **/etc/ httpd/httpd.conf**, find the line containing **ServerName** and change it to this. If youuseLeopard(OS X 10.5), the file is at **/etc/apache2/httpd.conf**.33 +Edit **/etc/apache2/httpd.conf**, find the line containing **ServerName** and change it to this. If you still running Tiger (OS X 10.4), the file is at **/etc/httpd/httpd.conf**. If you develop on Linux, the configuration file is probably in **/etc/httpd/conf**. 28 28 29 29 {{code}} 30 30 ... ... @@ -36,8 +36,8 @@ 36 36 37 37 {{code}} 38 38 39 -# First, we configure the "default" to be a very restrictive set of 40 -# features. 45 +# First, we configure the "default" to be a very restrictive set of 46 +# features. 41 41 # 42 42 <Directory /> 43 43 Options FollowSymLinks ... ... @@ -52,8 +52,8 @@ 52 52 53 53 {{code}} 54 54 55 -# First, we configure the "default" to be a very restrictive set of 56 -# features. 61 +# First, we configure the "default" to be a very restrictive set of 62 +# features. 57 57 # 58 58 <Directory /> 59 59 Options FollowSymLinks ... ... @@ -72,6 +72,10 @@ 72 72 73 73 {{/code}} 74 74 81 +{{info}} 82 +If you installed WebObjects in another directory (for instance, /Developer/WebObjects), prepend that directory path in front of /System. 83 +{{/info}} 84 + 75 75 Then restart apache: 76 76 77 77 {{code}} ... ... @@ -82,7 +82,7 @@ 82 82 83 83 == Tell the adaptor to use localhost == 84 84 85 -Edit **/System/Library/WebObjects/Adaptors/Apache/apache.conf** to make sure that your enabled/uncommented WebObjectsConfig property looks like this: 95 +Edit **/System/Library/WebObjects/Adaptors/Apache2.2/apache.conf** to make sure that your enabled/uncommented WebObjectsConfig property looks like this: 86 86 87 87 {{code}} 88 88 ... ... @@ -90,6 +90,8 @@ 90 90 91 91 {{/code}} 92 92 103 +(Note on Tiger, aka OS X 10.4.X, replace **Apache2.2** with **Apache** in the path above) 104 + 93 93 == Tell wotaskd to Use Localhost Too == 94 94 95 95 Edit **/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/Resources/Properties** ... ... @@ -104,18 +104,45 @@ 104 104 105 105 Now you need to restart wotaskd: 106 106 119 +===== OS X 10.5 Leopard and afterward (where launchd is used to control wotaskd) ===== 120 + 107 107 {{code}} 108 108 123 +sudo launchctl stop com.apple.webobjects.wotaskd 124 + 125 +{{/code}} 126 + 127 +or 128 + 129 +===== {{color value="#000000"}}{*}OS X Tiger 10.4 and earlier{*}{{/color}} ===== 130 + 131 +{{code}} 132 + 109 109 sudo systemstarter stop "WebObjects Services" 110 110 sudo systemstarter start "WebObjects Services" 111 111 112 112 {{/code}} 113 113 114 -or 138 +launchd should automatically start wotaskd again for you if configured properly. 115 115 116 -restart wotaskd and womonitor with launchctl if your WebObjects install launches that way. 117 -(In 10.5 it appears to be necessary to launch with launchctl. See [[Running Monitor and wotaskd on Mac OS X 10.5 "client">>WO 5.4 Getting Started||anchor="javamonitor"]] 140 +You can check for whether wotaskd is running as a launchd job by typing 118 118 142 +{{code}} 143 + 144 +sudo launchctl list | grep webobjects 145 + 146 +{{/code}} 147 + 148 +which will give something like this: 149 + 150 +{{code}} 151 + 152 +43 - com.apple.webobjects.wotaskd 153 + 154 +{{/code}} 155 + 156 +(In 10.5 it appears to be necessary to launch with launchctl. See [[Running Monitor and wotaskd on Mac OS X 10.5 "client">>WO 5.4 Getting Started||anchor="javamonitor"]]) 157 + 119 119 == Finally, Configure your Application == 120 120 121 121 Add or edit these launch parameters: ... ... @@ -131,7 +131,7 @@ 131 131 132 132 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. 133 133 134 -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. 173 +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. To change the global settings, in Eclipse, open the Eclipse menu, choose Preferences... and select WOLips > Launch. 135 135 136 136 = Apache Restart = 137 137 ... ... @@ -140,6 +140,8 @@ 140 140 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. A script is shown below to do that. 141 141 If you already implemented the "localhost" explicit hostname setup above, then you will probably not need to bother with this section. 142 142 182 +No, really. Why would one need this? Is there a difference between ("apachectl stop" ; "apachectl start") and "apachectl restart"? If so, that may be a problem with apachectl. If there is a difference, why is the difference important? What bad thing will happen if one only uses "apachectl restart"? Pascal's answer: there is no difference between apachectl stop/start and apachectl restart, so the restart script could simply do a "apachectl restart". 183 + 143 143 {{/info}} 144 144 145 145 == Making a restart script == ... ... @@ -154,3 +154,5 @@ 154 154 /usr/sbin/apachectl start 155 155 156 156 {{/code}} 198 + 199 +Please note that you DON'T need to do this if you set your ServerName in Apache to localhost. Running everything under localhost is the best way to go.