基于lxr的源代码浏览系统
基础环境:
CentOS release 6.9 (Final)
perl-5.10.1-144.el6.x86_64
httpd-2.2.15-59.el6.centos.x86_64
mysql-server-5.1.73-8.el6_8.x86_64
安装步骤:
- yum安装perl-CPAN
- 用perldoc perllocal查看 已经安装的模块,如果File::MMagic尚未安装,则需要perl -MCPAN -e 'install File::MMagic'来安装
- 下载安装glimpse-4.18.6
- 下载lxr-2.2.1压缩包,解压到/usr/local/share/; 配置PATH和PERL5LIB环境变量:
export PATH=.:/usr/local/share/lxr-2.2.1:/usr/local/bin:$PATH
export PERL5LIB=$PERL5LIB:/usr/local/share/lxr-2.2.1/lib:/usr/local/share/lxr-2.2.1/scripts
5. genxref --checkonly 验证依赖是否齐全
6. 启动mysql数据库;
7. cd /usr/local/share/lxr-2.2.1 && ./scripts/configure-lxr.pl &&
custom.d/initdb.sh; 除了项目源代码的路径,其余的地方一路回车用默认值;该脚本生成数据库和custom.d/lxr.conf; cp custom.d/lxr.conf .
8. genxref --url='http://<主机名>/lxr'
9. 生成的custom.d/apache-lxrserver.conf 文件此时尚有问题,需要修改:Alias /lxr "/usr/local/share/lxr-2.2.1" --> ScriptAlias /lxr "/usr/local/share/lxr-2.2.1"
10. cp custom.d/apache-lxrserver.conf /etc/httpd/conf.d/ && service httpd restart; 如果有MODPERL2相关指令的报错则注释掉;
最后访问http://<主机名>/lxr/source即可