Showing posts with label Installing OpenGrok. Show all posts
Showing posts with label Installing OpenGrok. Show all posts

Tuesday, December 7, 2010

Installing OpenGrok on Debian squeeze

If you have come across lxr, then you might like openGrok. It's a cross referencer for your code. It also highlights as a bonus :) Have a look at the openoffice instance

Pull in the dependencies
  • sudo aptitude install sun-java6-jdk tomcat6 exuberant-ctags

For debian lenny, there default sysctl setting fraks up java. Fix it by setting the vars in /etc/sysctl.d/bindv6only.conf
  • net.ipv6.bindv6only = 0
  • You may restart procps or
  • echo 0 > /proc/sys/net/ipv6/bindv6only
Download the opengrok binary and unzip it
  • wget http://hub.opensolaris.org/bin/download/Project+opengrok/files/opengrok%2D0.9.tar.gz

Make the opengrok directory tree
  • mkdir /opt/opengrok/ && cd /opt/opengrok && mkdir bin data lib source

Copy over files from the unzipped directory to the installation directory
  • cp ~/opengrok-0.9/bin/* bin/
  • cp ~/opengrok-0.9/lib/ lib/

Fix your app
  • mkdir /opt/opengrok/web && cd /opt/opengrok/web && unzip ../lib/source.war
  • Edit your WEB-INF/web.xml to have:
<!-- My configs -->
<context-param>
<param-name>DATA_ROOT</param-name>
<param-value>/opt/opengrok/data</param-value>
<description>REQUIRED: Full path of the directory where data files generated by OpenGrok are stored</description>
</context-param>

<context-param>
<param-name>SRC_ROOT</param-name>
<param-value>/opt/opengrok/source</param-value>
<description>REQUIRED: Full path to source tree</description>
</context-param>

<context-param>
<param-name>SCAN_REPOS</param-name>
<param-value>false</param-value>
<description>Set this variable to true if you would like the web application to scan for external repositories (Mercurial)</description>
</context-param>


  • Save and recreate the war
  • zip -r ../lib/source.war ./

Deploy your app
  • cd /opt/opengrok/bin && ./OpenGrok deploy
  • You should be able to hit the app: http://a.b.c.d:8080/source

Check out your code
  • cd /opt/opengrok/soure && hg clone https://blah.co.ke/app

Index
  • cd /opt/opengrok/bin && ./OpenGrok index /opt/opengrok/source/

Get to work :)

Pretty brilliant!

Thanks to: