http://blog.csdn.net/weihan1314/article/details/8944291
Opengrok is a fast, easy-to-use source search engine and control engine that can help us quickly search, locate, and control the code tree. The following is a specific explanation of the installation and use of Opengrok.
Install Web server-tomcat
First step:
First you should understand that Opengrok is a web system, so to share the Opengrok search engine, you need to install a Web server. Tomcat is recommended for use in Ubuntu environments. Download tomcat to specified directory (e.g/data_2/tools)
Use the following command to unzip the downloaded Tomcat compression pack [Python] view plain copy #tar Xvzf apache-tomcat-7.0.40.tar.gz after decompression into the decompression directory [python] view plain copy #cd apache-tomcat-7.0.40 into Tomcat's./bin directory, start tomcat service [python] view plain copy #cd bin/#./s tartup.sh start the Tomcat service, enter the URL in the browser: http://localhost:8080/can go to the following page to prove that Tomcat is running successfully.
Step Two:
After the Tomcat is installed, the next step is to configure Opengrok. Opengrok Download Address:http://opengrok.github.io/opengrok/ You can download Opengrok's compiled files on this web site, or download source files. Here we download the compiled file directly (the Opengrok interested in the download source to see), download the following command to decompress: [python] view plain copy #tar xvzf After the opengrok-0.11.1.tar.gz decompression is completed, the Source.war package in the./lib directory will be copied to the/data_2/tools/directory. Apache-tomcat-7.0.40/webapps directory, enter the http://localhost:8080/source/URL in the browser (note: The war package will be automatically decompressed) see the following interface to prove that the Opengrok run successfully.
Then you need to change the web.xml configuration file [HTML] view plain copy in the/data_2/tools/apache-tomcat-7.0.40/webapps/source/web-inf directory < context-param> <param-name>CONFIGURATION</param-name> <param-value><span style= "COLOR: #f f0000; " >/data_2/tools/opengrok-0.11.1/</span>etc/configuration.xml</param-value> <description> Full path to the configuration file where Opengrok can read it ' s configuration</description> </CONTEXT-PARAM&G T Where the red callout for the above Opengrok decompression path. The last is to build the index of the source code. Enter the ~./opengrok-0.11.1/bin directory to build the source index by executing the following command: [python] view plain copy #./opengrok Index/data/code
(Note:/data/code/is the target index path)