About
If you are using Tomcat 5+ as your primary web server (with APR this is actually feasible), you may wonder how you can proxy through to FishEye.
Out of the box this isn't possible, so here is a small How-To that seems to work properly using j2ep.
This setup may also work using other J2EE web container frontends. It has been verified to work for a setup with Tomcat 5.5.25 and Fisheye 1.4.2.
Note: This setup may not be suitable for large scale installations or sites with a high volume of traffic.
Preparing j2ep
The jEasy Extensible Proxy (j2ep) is a reverse proxy running in tomcat or any other J2EE container.
The setup presented here is supposed to proxy only fisheye, but I think it should be possible to use an adapted ROOT context configuration.
1. Grab the 1.0 release from SourceForge
2. Unpack it and deploy the WAR as "fisheye.war" in your TOMCAT_HOME/webapps
The idea is that the context fisheye will be used for the proxying.
3. Configure TOMCAT_HOME/webapps/fisheye/WEB-INf/web.xml for rewriting:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>j2ep</display-name>
<description>
A J2EE application implementing a reverse proxy.
</description>
<filter>
<filter-name>Rewriter</filter-name>
<filter-class>net.sf.j2ep.RewriteFilter</filter-class>
<init-param>
<param-name>dataUrl</param-name>
<param-value>/WEB-INF/config/data.xml</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Rewriter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>Proxy</filter-name>
<filter-class>net.sf.j2ep.ProxyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Proxy</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
4. Configure TOMCAT_HOME/webapps/fisheye/WEB-INf/config/data.xml to:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<server className="net.sf.j2ep.servers.BaseServer"
domainName="yourdomain.com:8060"
path="/fisheye"
isRewriting="true">
<rule className="net.sf.j2ep.rules.AcceptEverythingRule"/>
</server>
</config>
Configuring Fisheye
You need to configure Fisheye as described here. Especifically:
1. Enter the Fisheye admin console
2. Goto Global Settings > Server Settings
3. Configure:
a) Web context: fisheye
b) Proxy host: your proxy address:yourdomain.com
c) Proxy port: your proxy port
4) You will need to restart Fisheye for changes to take effect.
You may alternatively configure through editing your config.xml:
<web-server site-url="http://yourdomain.com/" context="fisheye">
<http bind=":8060" proxy-port="80" proxy-host="yourdomain.com"/>
</web-server>
Test your setup
All that is left to be done is to visit fisheye through your reverse proxied setup and enjoy Fisheye :)


3 comments:
I followed your excellent guide and I got everything up and running. However, some of the links in FishEye seems to not be processed correctly:
http://host.com/fisheye/admin/addRep!default.do
http://host.com/fisheye/admin/editRep!default.do?rep=0
http://host.com/fisheye/admin/editServerSettings!default.do
http://host.com/fisheye/changelog/repos
http://host.com/fisheye/profile
When I try one of those links in Firefox the current page just seems to reload and nothing happens. In IE I get a "Cannot find server" error.
My setup is a Debian box with Tomcat 5.5.23 and FishEye 1.4.2. The settings I'm using is practically the same as those you have. I've also tested the direct connection to port 8060 and it works perfectly. Just strange that some of the URLs don't seem to work correctly.
I have actually tried these links on my setup, and they seem to work properly. This is really strange, I have to check this with other browsers, though.
Maybe you can figure out what is going wrong by enabling the j2ep logging as described here. In a nutshell: drop the following as file logging.properties in TOMCAT_HOME/webapps/fisheye/WEB-INF/classes:
handlers=org.apache.juli.FileHandler
org.apache.juli.FileHandler.level=FINEST
org.apache.juli.FileHandler.directory=TOMCAT_HOME/logs
org.apache.juli.FileHandler.prefix = j2ep.
.level=INFO
httpclient.wire.header.level=FINE
org.apache.commons.httpclient.level=FINE
net.sf.j2ep.level=FINE
net.sf.j2ep.servers.level=FINE
When you restart, j2ep should be logging to the file you configured.
Just some follow up information on my setup:
Linux 2.6.22-14-generic (Ubuntu)
JVM 1.6.0_01-b06 HotSpot(tm) Server VM
Tomcat 5.5.25 with APR
Fisheye 1.4.2
Make sure to set the web context and reboot Fisheye.
I haven't had time to check out the Crowd Integration (SSO), yet (because we actually never used logins on Fisheye).
Post a Comment