Case: I had to set up a server with the Atlassian Starter products, and these run on port 8080, 8090, etc. by default. The server (Mac mini running Snow Leopard) is placed at my home. The problem occurs when trying to access the server from certain networks where these ports are blocked. To fix that, I wanted JIRA and the other products to run on port 80, so I could access them on any network. By default you access these URLs by:
http://yourserver.com:8080 (jira)
http://yourserver.com:8090 (confluence)
By the end of this post, you can access these and more with URLs like:
http://yourserver.com/jira
http://yourserver.com/confluence
In essence, this is solved by using the built in Apache2 web server in Snow Leopard and the mod_proxy module (loaded by default). In addition, we need to set correct context paths for each application. Detailed instructions follow:
Use Terminal and add a configuration file for Apache2
-
cd /private/etc/apache2/other
-
sudo nano atlassian.conf
- Paste the following contents into this file:
<Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPreserveHost On ProxyPass /jira http://localhost:8080/jira ProxyPassReverse /jira http://localhost:8080/jira ProxyPass /confluence http://localhost:8090/confluence ProxyPassReverse /confluence http://localhost:8090/confluence ProxyPass /crowd http://localhost:8095/crowd ProxyPassReverse /crowd http://localhost:8095/crowd ProxyPass /bamboo http://localhost:8085/bamboo ProxyPassReverse /bamboo http://localhost:8085/bamboo ProxyPass /fisheye http://localhost:8060/fisheye ProxyPassReverse /fisheye http://localhost:8060/fisheye
Save this file by hitting CTRL+X, and Y, and Enter. With this we accomplish the mapping from port 80 to the correct product/port, based on the URL.
Start Apache on Snow Leopard
- Go to System Preferences -> Sharing
- Tick “Web Sharing”. Apache now starts and is accessible on http://localhost (you should see “It works!” when browsing to that site)
JIRA
Edit conf/server.xml. Locate and change the start of the line from
<Context path=
"/"
to
<Context path=
"/jira"
Confluence
Edit conf/server.xml. Change the line
<
Context
path
=
""
docBase
=
"../confluence"
debug
=
"0"
reloadable
=
"true"
>
to
<
Context
path
=
"/confluence"
docBase
=
"../confluence"
debug
=
"0"
reloadable
=
"true"
>
Crowd
is already setup to run on context path /crowd so no configuration is required
Fisheye
Login to FishEye admin (localhost:8060/admin). Go to Server Settings under Global Settings, and set the context path to fisheye. Leave the proxy values unset.
Bamboo
Edit the bamboo.sh script. Locate the line beginning with RUN_CMD. This line ends with
8085
./webapp /"
change this to
8085
./webapp /bamboo"
Final configuration
- Restart the machine. You should now be able to use the URLs. Try going to http://localhost/jira etc.
- You probably want to attach your server to a domain. I recommend using dyndns.org, which is free. This way, you can have a static address to access your server on, ie: myserver.dyndns.org/jira. Setting up your server for dyndns is outside the scope for this post, but google should be able to help you. Otherwise, leave a comment and I may write a post about it.