Installing OpenGrok and Tomcat 7 on Ubuntu 13.04 quickly

If you are a developer you need a good source code navigator. I have used cscope to navigate and edit code directly from my terminal dismissing any graphical user interface but some people like to use the sourcenav or net beans ecosystem. However both are graphically nice but are “heavy” apps and also, if you want to share a way with your co-workers how to browser your code you will need to install the apps in different desktops.

But what about to have a fast way to navigate in your code, have fast crossed references  and share your source code with your co-workers dismissing the installation of source navigators on different desktops using your web browser ?

If you need something like this or if you wants a fast and easy installation of a good source navigation, I recommend OpenGrok. To be honest, even if I do not need to share my code with anyone, I use in my machine only for my personal code browsing.

OpenGrok runs as a webapp that means you and your co-workers can use your favorite browser navigator. Chrome, Firefox, Internet Explorer, whatever! you only need your preferable one to enjoy the code.

Considering OpenGrok is web based you will need to install a web server to be used as servlet server. OpenGroks supports Tomcat or Glassfish.

I am personally using tomcat 7 in my ubuntu 13.04. Let’s see the 3 basic steps:

Step 1) Installing Tomcat 7 quickly

To install the tomcat 7 you need to run:

sudo apt-get install default-jdk tomcat7

Let’s discover the tomcat base dir and set the CATALINA var in your bashrc. To discover the base dir to the following:

cd /usr/share/tomcat7/bin/

./catalina.sh

You will see something like this as output:

Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar

Then edit your ~/.bashrc and include using the directory pointed by CATALINA_BASE include the following var:

export CATALINA_HOME=/usr/share/tomcat7/

export OPENGROK_TOMCAT_BASE=$CATALINA_HOME

Run the tomcat and check if it is working:

. /etc/init.d/tomcat7

Done!!! installed!!!! Check if it is running now!!! Using your favorite browser type in the web address: http://localhost:8080/

If ok you should see a web page with message “It works!”

PIC3

Step 2) Installing OpenGrok

2.1) Install the exuberant C tags:

sudo apt-get install exuberant-ctags

2.2) Then goto http://opengrok.github.io/OpenGrok/ and download the last binaries available on this page for example opengrok-0.11.1.tar.gz.

2.3) Unzip and untar in some directory.

Ex.:

tar -zxvf opengrok-0.11.1.tar.gz

2.4) Create and prepare the directories with source code link and OpenGrok data. Here you need to create a directory called “src” and another one “data” in same dir level.

After that, in the src directory you can create a soft link to your real code directory that can be in your local machine or a mapped driver in the network.

Ex.:

mkdir local_src
cd local_src/
mkdir data src
cd src/
ln -s ~/code/base/mir/ mir

On the example above the real code is in the ~/code/base/mir/ but I just created a soft link called “mir” in the local_src dir.

2.5) Set the env variable to point to your code.

Edit you ~/.bashrc again and include:

export OPENGROK_INSTANCE_BASE=/home/mcramon/local_src

if you do not set this variable, the OpenGrok will search for directories in the /var/opengrok directory. If you prefer on this way you can create the following dirs:

sudo mkdir -p /var/opengrok/src

sudo mkdir -p /var/opengrok/data

sudo mkdir -p /var/opengrok/etc

and then you create your soft link to your code in the /var/opengrok/src directory.

Step 3) Deploying, indexing and running the OpenGrok

Step 3.1) Make a fast test deploying the OpenGrok webapp running the following line in your shell:

~/tools/opengrok/opengrok-0.11.1/bin$ sudo ./OpenGrok deploy
Loading the default instance configuration ...
Installing /home/mcramon/tools/opengrok/opengrok-0.11.1/bin/../lib/source.war to /var/lib/tomcat7/webapps ...

Start your application server (Tomcat), if it is not already
running, or wait until it loads the just installed web application.

OpenGrok should be available on <HOST>:<PORT>/source
where HOST and PORT are configured in Tomcat.

Now using your web browser type the following address: http://localhost:8080/source/

You should be able to see the OpenGrok deployed to your tomcat but not code added to be navigated.

PIC1

If you have some problems executing the deployment, make sure the script is updated with your tomcat version. In my case, I installed the tomcat7 and my opengrok version did not support this version 7. So I changed the OpenGrok script including my version as the pic below:

PIC2

Step 3.2) Index your code

If the deployment work fine, and if you already created your source code link, then you should index the database typing in your terminal.

mcramon@ubuntu:~/tools/opengrok/opengrok-0.11.1/bin$ sudo ./OpenGrok index

Depending how big is your code it can take several minutes to finish. It is common to have messages saying “there is no history” in the source… to now worry about those messages because it is searching for some control version history provided by git or other cm tools.

Step 3.3) Run!!!!

When the index finish, only refresh your browser screen again (F5) and check if you can see the project listed in a combo-box in the right side of your window. This project will have the same directory name you have to your soft link.

PIC4

Step 3.4) Share with your friends

Your friends/co-workers can see the code accessing the following addresses: <IP>:<PORT>/source or <hostname>:<PORT>/source

Simple like that!

Of course, OpenGrok and Tomcat are must powerful and this post is only a fast way to start the code browsing… check the OpenGrok and Tomcat sites for advanced topics.

 Enjoy!!

183 thoughts on “Installing OpenGrok and Tomcat 7 on Ubuntu 13.04 quickly

  1. Hi, I followed the steps and installed version opengrok-0.12.1 on Ubuntu 14.04 64 bit as the mentioned version is not available on the specified download directory.

    I can see the source directories listed under the In Projects section. But when I click on the source code I get error.

    Error: File not found!

    The requested resource is not available. The source root specified in your configuration does not point to a valid directory! Please configure your webapp.

    Any suggestions ?

    • Hi Niranjan

      This post is a little bit old and the versions used are outdated now. I will need to update my machines on this week and I will update this post. Send me an email to manoel.ramon@gmail.com and it will be my please to keep you informed with the most new procedure!!!

  2. Hi @manoelramon,

    I am facing same problem. We were installed java 8 and tomcat 8 on Centos 7 OS

    You may contact me on rajiv.ranjan@tomtom.com

    Error: File not found!

    The requested resource is not available. The source root specified in your configuration does not point to a valid directory! Please configure your webapp.

  3. Pingback: converse embroidery canvas action green uk trainers

  4. Pingback: womens air max air max 2015

  5. Pingback: glitter Adidas NMD R2

  6. Pingback: big boys youth kd 9 flyknit oreo black white

  7. Pingback: 蟹械谢械薪褘泄 胁芯谢褜褌 puma platform

  8. Pingback: uk trainers nike air max 180 em marron

  9. Pingback: puma ignite pink glaze pinterest.com

  10. Pingback: in shape black gs asics gel gt ii peachwater blue h502n

  11. Pingback: wholesale womens limited kevin rader 46 green bay packers jersey

  12. Pingback: nike nike free 30 v3

  13. Pingback: nike free 50 2014

  14. Pingback: nike black white red orbitblack nike epic react flyknit mens

  15. Pingback: advance 8673 vintage pattern 1958 off the shoulder dress roll collar ties in back by sydcam123

  16. Pingback: uk trainers balenciaga ligne match low top canvas amber

  17. Pingback: marr贸n nike dunk hi

  18. Pingback: update adidas yeezy boost 350 v2 butter drop today

  19. Pingback: 芯褉邪薪卸械胁褘泄 褋械褉械斜褉褟薪褘泄 adidas j wall 2

  20. Pingback: shoes mens navy blue 762826 882 nike air huarache ultra id

  21. Pingback: online world anti theft backpack with usb charging port office bag

  22. Pingback: ladies white puma trainers pinterest.com

  23. Pingback: acg nike boots grey twitter.com

  24. Pingback: richoose fashion womens winter wool cute cat ears knit beanie hats black

  25. Pingback: adidas f50 adizero ii prime fg blue white electricity

  26. Pingback: stella mccartney small falabella backpack

  27. Pingback: jordan rulez white blue silver black white red

  28. Pingback: asics gel stratus 2.1 salmon pinterest.com

  29. Pingback: puma soleil

  30. Pingback: the north face anden triclimate jacket double layer mens winter jacket size

  31. Pingback: pachyderm power 10 000mah portable device charger power bank charges two iphones on a pet

  32. Pingback: mens nike sb janoski max suede

  33. Pingback: converse chuck ii two tone leather ox m japanese eggplant lilacwhite converse me

  34. Pingback: jet set vanilla michael kors twitter.com

  35. Pingback: riddell speedflex inside

  36. Pingback: girls shoesjordan air jordan 1 retro highanthraciteblack black hyper pink332148

  37. Pingback: universal 4 channel 433 315 mhz gate garage door cloning remote control key fob

  38. Pingback: rucksack white women accessories bags rucksacksby guess storeusa official shop

  39. Pingback: beautiful pajamas ladies burgundy

  40. Pingback: womens shoes nike womens downshifter 5 wide running s

  41. Pingback: indoor sport shoes green black basketball shoes for men super light basketball sneakers cheap high

  42. Pingback: shop womens the north face black size xs vests at a discounted price at poshmark description size small fits more like xs sold by fast delivery

  43. Pingback: 蟹械谢械薪褘泄 泻褉邪褋薪褘泄 nike zoom witness

  44. Pingback: womens nike ultra moire

  45. Pingback: svart chuck taylor all star sneakers dam by converse sverige

  46. Pingback: beautiful hugo boss glasses eyeglasses frames for

  47. Pingback: foliage green convertible fleece beanie cap polyester face mask

  48. Pingback: girls hopsack blazer

  49. Pingback: curly pear flower horse hair wig azbro

  50. Pingback: cheap sport shoes white black white mens hyperdunk 2018 low

  51. Pingback: graceful sleek pearl inlay resin black flower round frame sunglasses cheap

  52. Pingback: menu puma kevler runner jr 186299 03

  53. Pingback: nike air jordan 4 retro bg royalty

  54. Pingback: t shirt chicago bulls hoodie jersey uniform t shirt

  55. Pingback: mens shoes mens adidas originals zx flux trainers blue white main blueadidas pants joggersadidas hoodies cheappromo codes

  56. Pingback: new black adidas yeezy powerphase calabasas cg6420 rrp 125 uk 9

  57. Pingback: cashmere pyjamas grey

  58. Pingback: hot sale adidas ultra boost triple black womens training rv i t shoes

  59. Pingback: utah jazz jersey 2016 jersey wholesale

  60. Pingback: timberland earthkeepers r glancy 6 boot dark blue nubuck womens dress

  61. Pingback: adidas lk cf nb kids trainers navy royal white 33285

  62. Pingback: the nike elite 51 uniform nike news

  63. Pingback: wolf gris nike mercurial vapor xi cr7 fg hematite bottes m茅tallique enfants gris football

  64. Pingback: benassi jdi slides etsy.com

  65. Pingback: mbt chaussures lac茅es blanche hommes sportmbt pas chermbt basket pas cher

  66. Pingback: nba men s basics structured adjustable hat price

  67. Pingback: nike field general 2 champ drive

  68. Pingback: adidas kids nemeziz messi 17 360 agility fg core black solar red tactile gold metallic

  69. Pingback: 2018 new fashion hello kitty hoodie sweatshirts sportswear clothing womens mens long sleeve star lovers hoodies m xxl hoodies sweater long sleeve online

  70. Pingback: puma speed font t shirt for men puma tees

  71. Pingback: nike air jordan iii golf shoes 2018 release

  72. Pingback: ty beanie baby ty 2k the bear retired 4262

  73. Pingback: nike internationalist nike internationalist

  74. Pingback: adidas superstar bold platform originals shoes womens black white gold metallic 318dxgep

  75. Pingback: prada black patent leather boots in f0002 black

  76. Pingback: neymar will wear the no 10 shirt at psg after completing his 198m transfer

  77. Pingback: toyota trademarks supra moniker in europe overdrive

  78. Pingback: fallen patriot iii kids black blood red skate shoe red skate shoes fanciful vans

  79. Pingback: new air jordan 31 gs black red wolf grey release authentic price

  80. Pingback: new balance m670bpr chinese zodiac rabbit blue red pink womens sneakersnew balance

  81. Pingback: houston rockets james harden nike nba mens marled player t shirt

  82. Pingback: nike zoom kd9 elite pale grey ivory 878637 001 sneaker junkies

  83. Pingback: that sad desperate look on michael jordans face plastered on top of everyone from cam newton to kanye west

  84. Pingback: pull femme no毛l rennes pull de no毛l pas cher

  85. Pingback: puma black gym bag

  86. Pingback: b酶rnet酶j st酶rrelse 98 tilbud p氓

  87. Pingback: 銈汇兗銉玜didas 銈儑銈c儉銈广偢銉ャ儖銈偣銉濄兗銉勩偊銈с偄 銈︺偐銉笺儬銈儍銉椼偣銉笺儎 g 銈搞儯銉笺偢涓婁笅

  88. Pingback: botte ville paul joe sister effie noir chaussures femme vente super pas cher

  89. Pingback: chill fleece headband earband

  90. Pingback: b usa po o ra ph auren casaco mascu ino po o ra ph auren usado

  91. Pingback: ed hardy mermaid and lotus low rise shoes in pink all the best

  92. Pingback: air jordan 3 retro prm hc gg chrome city blue

  93. Pingback: new balance 580 elite edition halloween sz 13 running green suede rare

  94. Pingback: innovasport nike sandalia sunray adjust 4 ni帽os

  95. Pingback: 屑芯写薪芯械 锌谢邪褌褜械 褋 谐械芯屑械褌褉懈褔械褋泻懈屑 褍蟹芯褉芯屑

  96. Pingback: trampki m臋skie pepe jeans industry deep b ack 40 7249493293

  97. Pingback: nike air max 97 921733 004 age adulte

  98. Pingback: cropped nike essentia feminino cropped 茅 na authentic feet authenticfeet

  99. Pingback: chloe accessories scalloped sunglasses poshmark

  100. Pingback: cf crossover tunika

  101. Pingback: herren jeans asos r枚hrenjeans im mid wash blau fabrikpreisg眉nstige

  102. Pingback: opskrift til aransweater i vital amager strik

  103. Pingback: sapat锚nis couro lacoste espere chukka cano alto masculino compre

  104. Pingback: bello 2018 nuovo scarpe ginnastica bambina estive nike 178 donna

  105. Pingback: uk trainers adidas ultra boost shoes black

  106. Pingback: saucony jazz origina navy white 1044 316 sneaker donna

  107. Pingback: platero zaino porta pc impermeabile per 15.6 pollici computer portatili zaino laptop ben imbottita nylon

  108. Pingback: sylvester stallone

  109. Pingback: collezione borse twin set simona barbieri primavera estate 2013

  110. Pingback: cartoon running man with beard and sunglasses sweating by

  111. Pingback: 18 st眉ck haarspangen m盲dchen

  112. Pingback: camur莽a de couro genu铆no das mu heres cinta cruz beading sand谩 ias de cunha de ver茫o designer de

  113. Pingback: loja roupa online compra casacos inverno marca osley 1591ci online

  114. Pingback: cal莽ado t锚nis adidas element feminino

  115. Pingback: boss hugo boss portland embossed plain toe derby men

  116. Pingback: anneler i莽in polaris yazl谋k ayakkab谋 modelleri

  117. Pingback: red tommy hilfiger thdm sl print stretch shirts mens reservation s

  118. Pingback: longchamp le pliage bag colors hastings

  119. Pingback: 贸culos givenchy womens round aviator s 266288 r

  120. Pingback: hugo boss mens formal shirts sale

  121. Pingback: bos amp co holding lace boot red pc

  122. Pingback: new coach ava black leather top zip tote shoulder handbag purse

  123. Pingback: 泻芯卸邪薪邪褟 褋褍屑泻邪 chane 泻芯卸邪薪褘械 褋褍屑泻懈 褋褍屑泻懈 卸械薪褋泻懈械 懈薪褌械褉薪械褌

  124. Pingback: kemei 3 in 1 foldable hair curler fast heating mini ceramic curling

  125. Pingback: d谩msk谩 ko拧ile tyrkysov谩 slim fit

  126. Pingback: saint laurent leather waist bag. black. au 1

  127. Pingback: vero moda tall funnel neck padded longing coat total eclipse women jackets shop

  128. Pingback: en primer lugar la calidad saint laurent lentes de sol redondos mujer

  129. Pingback: arma莽茫o para 贸culos de grau masculina hb polytech m 93023

  130. Pingback: 噩賵鬲賷 賵丕賳鬲賵丕 亘賰乇丕賲賴 賰賱丕爻賷賰 賲丕乇賰丞 賱賵賷爻 賮賷鬲賵賳 賱賱乇噩丕賱

  131. Pingback: new polo ralph lauren womens blue label chino shorts sizes 2 4 6 8 10

  132. Pingback: zoerea beb茅 chicos conjunto de conjunto page boy trajes 4 piezas chaleco camisa pantalones

  133. Pingback: blusa renda vermelha blusas licole

  134. Pingback: philips shaver at600 wet n dry rechargeable alat cukur garansi resmi harga murah

  135. Pingback: compra classic patch trucker black en vans colombia tienda oficial

  136. Pingback: buy batman baseball stylish cap online

  137. Pingback: elegant river island glida kl盲nning i ljusrosa dam utlopp

  138. Pingback: calca esportiva faixa foto still

  139. Pingback: femme textile acheter rond under armour street precision chaussures dentra卯nement et de fitness midnight navy violet

  140. Pingback: mens nike kyrie 4 ncaa march madness white multi color 943806 104

  141. Pingback: chuteira futsal nike mercurial vortex jr iii

  142. Pingback: n艖i t谩ska f茅rfi ingekb艖l az 艖sz sz铆neivel

  143. Pingback: eli manning new york giants nike elite mens team road jersey two tone

  144. Pingback: 锌懈卸邪屑褘 写谢褟 胁褋械泄 褋械屑褜u 锌懈卸邪屑褘 写谢褟 胁褋械泄 褋械屑褜懈 蟹邪锌懈褋褜 锌芯谢褜蟹芯胁邪褌械谢褟

  145. Pingback: vivienne westwood buffalo hat

  146. Pingback: chaqueta original adidas real madrid. cargando zoom

  147. Pingback: christian dior malice handbags handbags patent leather black

  148. Pingback: kanye west ye wyoming long sleeve t shirt listening party hoodie merch new

  149. Pingback: 2019 punk rivet street boots women buckle strap lace up dr. martins boots ladies black combat boots military motorcycle boots

  150. Pingback: puma ducati motorazzo street racer trainers mens white tenisky

  151. Pingback: kostymer for par utkledningst酶y til karneval halloween coolstuff

  152. Pingback: spring savings is upon us get this deal on nike sportswear

  153. Pingback: firm ground soccer cleat nike hypervenom phantom iii pro dynamic fit fg zapatos

  154. Pingback: timberland vendo credito disponivel no site cal莽ados roupas acessorios

  155. Pingback: 2019 fish print winter fuzzy pajamas dress

  156. Pingback: come fare cappelli mostro in pile per bambini tutorial. simpatici

  157. Pingback: dream vine plus size pu slit sexy belted long sleeves mini dress metallic shiny wetlook deep v neck off shoulder club

  158. Pingback: armani jeans ladies armani jeans white rounded bowler style patent

  159. Pingback: nouvelle fleur leggings rose pantalon pour sexy leggins remise en forme complet 3d pantalon leggins legging

  160. Pingback: tidak perlu takut memilih jenis kacamata kecil karena bentuk wajah ini cocok mengenakan jenis kacamata apa saja. namun coba kacamata dengan frame mata

  161. Pingback: Salomon Shoes

  162. Pingback: 蠁胃畏谓维 蟺伪喂未喂魏维 蟺苇未喂位伪 纬喂伪 魏慰蟻委蟿蟽喂伪

  163. Pingback: italian shoes with matching bags rhinestone high quality coral color large size 38 43 wedding

  164. Pingback: pat patriots sneakers

  165. Pingback: nyeste t酶j trends

  166. Pingback: womens aviator green lenses armyuniverse

  167. Pingback: reaso 茅t茅 femmes robe longue sexy col v soir茅e cocktail casual robe de plage sundress elegant

  168. Pingback: rel贸gio anal贸gico feminino champion cn20328w r 169

  169. Pingback: champion combo neutral running shoes blue kids sports champion clothing sports authority champion sports apparel discount shop

  170. Pingback: ac t8116 108 nina black maris dehart

  171. Pingback: new balance 956 brown suede lace up walking hiking trail shoes womens

  172. Pingback: cappello hugo boss tg. regolabile

  173. Pingback: nero giardini nero tronchetto collezione scarpe donna vendita online

  174. Pingback: Nike Air Max 270

  175. Pingback: leather weekend bag leather duffle bag overnight by mahileather collection bags

  176. Pingback: shop missguided high waisted buckle bikini brief online on zalora philippines

  177. Pingback: miu miu pink leather shoulder bag

  178. Pingback: black and gold foamposite pro

  179. Pingback: braza womens backless freedom bustier adhesive bra beige

  180. Pingback: champion legacy beanie rumba red stayhard

  181. Pingback: apparel mens pittsburgh steelers 13 dri archer nfl black 1967 home throwback power seller

Leave a Reply