Make a opengrok instance with a independent web context path
- Make a new 📂OPENGROK_INSTANCE_BASE folder for a web context
- Sub folders 1. 📂OPENGROK_INSTANCE_BASE/src 1. 📂OPENGROK_INSTANCE_BASE/data
- Make a web application file witch a web context and 📂OPENGROK_INSTANCE_BASE location
- Deploy an web app to TOMCAT
- If you define ✏️$GIT_BRANCH and ✏️$GIT_URL, clone it under 📂OPENGROK_INSTANCE_BASE/src and create indexed data
- Clone this project into a local. Set it as 📂SCRIPT_DIRECTORY
- Add Tomcat's 📂bin folder's absolute path to ✏️$PATH
- Run 📝$SCRIPT_DIRECTORY/bin/run.sh
- If you need some files, please write it on a file and set it with OPENGROK_CONFIGURATION
- run.conf
IGNORE_PATTERNS="-i .git -i */downloads -i */temp/*.i"
OPENGROK_FLUSH_RAM_BUFFER_SIZE="-m 256 -T 120"
* Command
OPENGROK_CONFIGURATION=./run.conf $SCRIPT_DIRECTORY/bin/run.sh
- Check a web app's url on a browser
- Install latest JDK 1.8 and add its 'bin' to $PATH
- Install Tomcat 8.0.X
- Go to http://tomcat.apache.org/download-80.cgi
- Download 8.0.x > Core > a distribution file( For examples .'tar.gz')
- Unpack a zipped file into a local and set it as $TOMCAT_HOME
- Add $TOMCAT_HOME/bin to $PATH
- Download OpenGrok's latest stable release from https://github.com/OpenGrok/OpenGrok/releases
- Unpack a zipped file into a local and set it as SCRIPT_DIRECTORY
- Set OPENGROK_DISTRIBUTION_BASE==$SCRIPT_DIRECTORY/lib
- Decide OPENGROK_INSTANCE_BASE
- Create $OPENGROK_INSTANCE_BASE, $OPENGROK_INSTANCE_BASE/src, $OPENGROK_INSTANCE_BASE/data
- Go to $SCRIPT_DIRECTORY
- Extract a WEB-INF/web.xml from a ✏️lib/source.war
Sunjoo:opengrok-0.12.1.6 sunjoo$ jar xf lib/source.war WEB-INF/web.xml
Sunjoo:opengrok-0.12.1.6 sunjoo$ ls
WEB-INF bin doc lib man
Sunjoo:opengrok-0.12.1.6 sunjoo$ ls WEB-INF/web.xml
WEB-INF/web.xml
Sunjoo:opengrok-0.12.1.6 sunjoo$
- Change configuration file's directory name to $OPENGROK_INSTANCE_BASE/etc
- Old:
<param-value>/var/opengrok/etc/configuration.xml</param-value>
- New:
<param-value>/Users/sunjoo/temp/opengrok-instance/etc/configuration.xml</param-value>
- Change web app's PORT to a new port number if you have been using it for another service
- Old:
<param-value>localhost:2424</param-value>
- New:
<param-value>localhost:2011</param-value>
- Change a port number '2424' to a new number in $SCRIPT_DIRECTORY/bin/OpenGrok if you change it
- Old:
WEBAPP_CONFIG_ADDRESS="localhost:2424"
- New:
WEBAPP_CONFIG_ADDRESS="localhost:2011"
- Update ✏️WEB-INF/web.xml in ✏️lib/source.war
Sunjoo:opengrok-0.12.1.6 sunjoo$ jar uf lib/source.war WEB-INF/web.xml
- Make $OPENGROK_INSTANCE_BASE/src and $OPENGROK_INSTANCE_BASE/data
- Run a deploy
$SCRIPT_DIRECTORY/bin/OpenGrok deploy
- Unpack an archived sources under $OPENGROK_INSTANCE_BASE/src
Sunjoo:opengrok-0.12.1.6 sunjoo$ pushd $OPENGROK_INSTANCE_BASE/src
Sunjoo:src sunjoo$ cp -r ~/Downloads/apache-tomcat-8.0.33.tar .
Sunjoo:src sunjoo$ tar xvf apache-tomcat-8.0.33.tar
Sunjoo:src sunjoo$ popd
- Run an indexingf job.
$SCRIPT_DIRECTORY/bin/OpenGrok deploy