Figured it out! Here is a preliminary HOWTO. Please review and let me know how it works for you. If there are any errors, let me know exactly what you did up to that point, so I can reproduce your environment.
Install requirements:
Code:
pkg install tomcat8
pkg install zip
pkg install ctags
Download the latest version of OpenGrok. Currently, the latest release is 0.13, but your
fetch
command may differ.
fetch https://github.com/OpenGrok/OpenGrok/files/631110/opengrok-0.13-rc5.zip
Then unzip the file.
unzip opengrok-0.13-rc5.zip
tar -xzvf opengrok-0.13-rc5.tar.gz
Enter the newly created directory, make the required base directory and copy over the opengrok files. I selected /usr/local/var/opengrok/ as my base, but if there is a more FreeBSD-appropriate location, please let me know.
cd opengrok-0.13-rc5
mkdir -p /usr/local/var/opengrok
cp -r * /usr/local/var/opengrok/
Enter the opengrok directory.
cd /usr/local/var/opengrok
Unpackage and update the CONFIGURATION variable in the source.war file. More on this in a bit.
cd lib
unzip source.war -d source
cd source
Now edit the WEB-INF/web.xml file to change CONFIGURATION variable to set the configuration.xml path. It should look like this.
Code:
<context-param>
<description>Full path to the configuration file where OpenGrok can read its configuration</description>
<param-name>CONFIGURATION</param-name>
<param-value>/usr/local/opengrok/etc/configuration.xml</param-value>
</context-param>
Recompress the source.war with the updated web.xml file as follows:
zip -u ../source.war WEB-INF/web.xml
Create the necessary environmental variables as follows:
export OPENGROK_TOMCAT_BASE="/usr/local/apache-tomcat-8.0"
export OPENGROK_SRC_PATH="/usr/local/var/opengrok/src/"
export JAVA_HOME="/usr/local/"
Start the tomcat service
service tomcat8 onestart
Deploy OpenGrok.
cd ../../bin
./OpenGrok deploy
Finally, index all directories that contain your source code.
./OpenGrok index /usr/local/var/opengrok/src
Now you should be able to visit the OpenGrok instance by going to
http://address:8080/source. If for any reason you are told the CONFIGURATION parameter in web.xml is not configured, this is because somewhere there is a hard-coded path to /var/opengrok/etc/configuration.xml. You can fix this problem by creating a quick symlink:
ln -s configuration.xml /var/opengrok/etc/configuration.xml
And then reload the page, and it should work
Your mileage may vary, let me show how it works for you!