Installing OpenGrok on Windows
Steps for installing OpenGrok.
- Download the OpenGrok binary from OpenGrok Binary.
- Unzip the tar to a location say "G:\OpenGrok"
- Download Ctags from Ctags Windows Binary.
- Extract Ctags to a location say "G:\Ctags"
- Download and install Tomcat.
- OpenGrok needs the following to run
- A configuration.xml that is generated using the command in step 8.
- Location to the source being indexed. (SRC_ROOT)
- Location to the "Ctag" generated grokData, again refer to step 8. (DATA_ROOT)
- Extract the "war" file in the "lib" folder in the extracted OpenGrok location. In this case G:\opengrok-0.11.1\lib.
- Edit the WEB-INF\web.xml file to include the information discussed above (step 6)
- Copy the the extracted source.war with the modified web.xml to the tomcat webapps folder.
- Index the source and generate the configuration.xml file using the below command (G:\opengrok-0.11.1\lib has the jar file)
- Launch Tomcat after the indexing in done. Open http://localhost:8080/source and wola you have a wicked fast source browser.
- Reindex if you need to add new projects/pick new source etc.
<context-param>
<param-name>CONFIGURATION</param-name>
<param-value>G:\opengrok-0.11.1\configuration.xml</param-value>
<description>Full path to the configuration file where OpenGrok can read it's configuration</description>
</context-param>
-------Added the below------
<context-param>
<param-name>SRC_ROOT</param-name>
<param-value>G:\CodeSource</param-value>
</context-param>
<context-param>
<param-name>DATA_ROOT</param-name>
<param-value>G:\opengrok-0.11.1\grokdata</param-value>
</context-param>
java -jar opengrok.jar -W G:\opengrok-0.11.1\configuration.xml -c G:\ctags58\ctags.exe -P -S -v -s G:\CodeSource -d G:\opengrok-0.11.1\grokdata
Very nice, good job.
ReplyDeleteIt is worth noting that source.war must be unpacked under G:\opengrok-0.11.1\lib\source, not G:\opengrok-0.11.1\lib
Also .war files are archives that can be unpacked by WinZIP or WinRAR.
Good instructions!
ReplyDeleteIf you want to use CxxAnalyzer to process .h files, you will have to add -A argument to override the default behavior.
-A h:org.opensolaris.opengrok.analysis.c.CxxAnalyzerFactory
Great instructions - it worked for me!
ReplyDeleteThanks for the instructions. I had minor issues (filenotfoundexception for configuration.xml)and the following worked for me.
ReplyDeleteI was using tomcat7.
The source.war needed to goto
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\source
Also the web.xml you mean is under
C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\source\WEB-INF
Only thing I had to change was
C:\opengrok-setup\opengrok-0.11.1\configuration.xml
great instructions, thanks so much
ReplyDeletethat's a great instruction... I would like to add something just in case there might people like me not that much expert with in and out of Tomcat installation...
ReplyDeletefor running the tomcat (tomcat 7.0 I use), try the startup script from the cmd. This way, it would build up the source folder in the webapps.
SRC_ROOT
G:\CodeSource
DATA_ROOT
G:\opengrok-0.11.1\grokdata
are not necessary
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi ,
ReplyDeleteHow do i configure svn url directly instead of checking out source to "SRC_ROOT" folder. Is there a way that opengrok update indexes when ever there is a check-in ?
please reply on above question...
ReplyDeleteas i found "-r on" to enable remote SCM systems..
ReplyDeleteHi Rahul,
DeleteCan you please provide details steps, where do i need to "-r" in configuration.xml. If you have detail steps for configuring, please lets us know steps.
Do you have similar steps for setting it up in a linux machine running Ubuntu, please?
ReplyDeleteThank you!
ReplyDeletehttps://github.com/OpenGrok/OpenGrok/issues/1091
ReplyDeletethis blog has wrong section 7 and 8, fix in above link
The link provided for the binary is broken.
ReplyDeleteI tried the step by step instruction provided on youtube, and I was successful in setting up openGrok
https://www.youtube.com/watch?v=BTGnZShDiqA
i tried the link in the mv, but the link is borken too. but i find the binary is "grokit_WindowsX64_64.zip". you can find it in google.
DeleteCan anyone help to configure the source to be indexed as gitlab.
ReplyDeleteHi,
ReplyDeleteI tried today.
I got
D:\opengrok-1.1-rc41\lib>java -jar opengrok.jar -W d:\opengrok-1.1-rc41\configuration.xml -c d:\ctags\ctags.exe -P -S -v -s d:\Projects\exw-codebase -d d:\opengrok-1.1-rc41\grokdata
Nov 27, 2018 8:30:25 PM org.opengrok.indexer.index.Indexer parseOptions
INFO: Indexer options: [-W, d:\opengrok-1.1-rc41\configuration.xml, -c, d:\ctags\ctags.exe, -P, -S, -v, -s, d:\Projects\exw-codebase, -d, d:\opengrok-1.1-rc41\grokdata]
Logging filehandler pattern: %h/java%u.log
Nov 27, 2018 8:30:25 PM org.opengrok.indexer.index.Indexer main
INFO: Indexer version 1.1-rc41 (fd2e8feba888a0b3c6938be7544aca3502695940)
Nov 27, 2018 8:30:25 PM org.opengrok.indexer.configuration.RuntimeEnvironment validateUniversalCtags
SEVERE: Error: No Universal Ctags found !
(tried running d:\ctags\ctags.exe)
Please use the -c option to specify path to a Universal Ctags program.
Or set it in Java system property org.opengrok.indexer.analysis.Ctags
Nov 27, 2018 8:30:25 PM org.opengrok.indexer.index.Indexer main
SEVERE: Exception running indexer
org.opengrok.indexer.index.IndexerException: Didn't find Universal Ctags
at org.opengrok.indexer.index.Indexer.prepareIndexer(Indexer.java:888)
at org.opengrok.indexer.index.Indexer.main(Indexer.java:298)
Usage: java -jar opengrok.jar [options] [subDir1 [...]]
-------------------------------------------------------------
I am not into Java.
What should I do?
The ctags version is ctags-5.8.tar.gz
DeleteBesides, when i tried to execute ctags.exe directly i got unknown column for p s and v
DeleteDid you find anything for the error. I am also facing exactly the same issue.
DeleteI am also getting same error. Can anyone please suggest solution..stuck here..
DeleteUse newer ctags: https://github.com/universal-ctags/ctags-win32/releases
Deleteto automate the process checkout https://www.youtube.com/watch?v=BTGnZShDiqA
ReplyDelete