Ubuntu环境下OpenGrok的安装及配置

注:YOUDIR为自己设定的存放目录,这个大家随意哈。

第一步,安装Web服务器-Tomcat:

1、使用以下命令解压下载的Tomcat压缩包

#tar   xvzf   apache-tomcat-6.0.45     -C     /YOURDIR/

这样便自动解压到指定目录下

2、获取startup.sh路径

cd    /YOURDIR/apache-tomcat-6.0.45   

cd   bin/   

pwd(获取路径待拷贝)

/YOURDIR/apache-tomcat-6.0.45/bin

3、配置自启动,OpenGrok为常用工具,需要随时存在,我这边把apache设成开机启动

vi    /etc/rc.local 

在exit 0 之前添加/YOURDIR/apache-tomcat-6.0.45/bin/startup.sh    &

保存退出,重启系统,浏览器输入:

localhost:8080/

弹出如下界面则表述apache配置成功:


第二步,安装配置opengrok:

OpenGrok下载地址:https://github.com/OpenGrok/OpenGrok/releases

1、解压:

tar   xvzf   opengrok-0.12.1.5.tar.gz   -C    /YOURDIR/

2、拷贝source.war

cd   /YOURDIR/opengrok-0.12.1.5/lib

cp  source.war  /YOURDIR/apache-tomcat-6.0.45/webapps

3、在浏览器输入:http://localhost:8080/source/,若弹出如下界面表示OpenGrok可以运行起来了:

4、配置索引目录:

vi   /YOURDIR/apache-tomcat-6.0.45/webapps/source/WEB-INF/web.xml

修改下面红色的配置语句:

  <context-param>
    <param-name>CONFIGURATION</param-name>
    <param-value>/var/opengrok/etc/configuration.xml</param-value>
    <description>Full path to the configuration file where OpenGrok can read it's configuration</description>
  </context-param>

由于OpenG建立完索引后会把索引文件放在/var/opengrok下,所以此处写成这个路径

5、建立索引,这个步骤很费时:

cd  /YOURDIR/opengrok-0.12.1.5/bin
#./OpenGrok   index   /codedir

PS:建立索引可能会失败,提示:

Loading the default instance configuration ...
ERROR: Unable to determine Exuberant CTags command name for Linux 3.13.0-44-generic

FATAL ERROR: Missing Dependent Application - Exuberant CTags - Aborting!

安装CTags即可:

apt-get install CTags

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值