How to enable Fisheye/Crucible to listen to web requests on additional ports
目的
This page covers how to enable your Fisheye/Crucible instance to listen to web requests on additional ports besides those specified in the Fisheye/Crucible user interface or in the config.xml
file.
This can be used, for example, in the following use cases:
- create an unproxied application link
Solution 4.7 and Later
- Stop Fisheye/Crucible
Create a file named
jetty-web.xml
in<Fisheye installation directory>/content/WEB-INF
with the following content:<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd" > <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <!-- ENABLE HTTP PORT 8065 --> <Get name="server"> <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.ServerConnector"> <Arg name="server"><Ref refid="Server" /></Arg> <Set name="port"><Property name="jetty.http.port" default="8065"/></Set> </New> </Arg> </Call> </Get> </Configure>
8065
should be replaced with the additional port you'd like to listen on. This port must not conflict with any other ports being used on the server or those already being used by Fisheye/Crucible.- Start Fisheye/Crucible
Solution 4.6.x and prior
The web interface and config.xml
for Fisheye/Crucible will not allow the server to listen to web requests on multiple ports, the following steps show how to achieve this.
- Stop Fisheye/Crucible
Create a file named
jetty-web.xml
in<Fisheye installation directory>/content/WEB-INF
with the following content:<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure.dtd" > <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <Get name="server"> <Call name="addConnector"> <Arg> <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <Set name="port"><Property name="jetty.port" default="8065"/></Set> </New> </Arg> </Call> </Get> </Configure>
8065
should be replaced with the additional port you'd like to listen on. This port must not conflict with any other ports being used on the server or those already being used by Fisheye/Crucible.- Start Fisheye/Crucible
Verify XML
The XML might be formatted incorrectly if Fisheye starts with an exception like:
2021-08-06 10:00:00,000 ERROR - The Web context could not be started
java.lang.ClassNotFoundException: org.eclipse.jetty.server.nio.SelectChannelConnector
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) [?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) [?:1.8.0_282]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) [?:1.8.0_282]
...
Please verify jetty-web.xml
correct XML. This command might be useful. It will test the XML and return 0 if valid.
xmllint --format jetty-web.xml > /dev/null ; echo $?