说明:本文是第一次安装 lxr 的记录文章,适合加深对 lxr 的理解;如果是想迅速使用 lxr 的话,本文中有些地方对 lxr 的配置不太妥当,建议先阅读本文,然后再以 《LXRUserManual-1.2-en_UK-1.4.pdf》 为主实践
==================================
安装 Apache, MySQL, ctags, mod_perl
==================================
官网有一句 "Apache httpd with mod_perl is recommended", 所以最好是现在就将 mod_perl 一起安装,后面可以省去很多麻烦(麻烦见下文),由于 Apache 是用 yum 方式安装的,所以 mod_perl 最好也用 yum 安装,否则后面会一堆麻烦(见下文)
============
安装 glimpse
============
genxref --checkonly
====================
配置 lxr(./scripts/configure-lxr.pl -vv)
========================================
==================================
安装 Apache, MySQL, ctags, mod_perl
==================================
$ sudo yum install mysql mysql-server mysql-devel
$ sudo yum install httpd
$ sudo yum install ctags
官网有一句 "Apache httpd with mod_perl is recommended", 所以最好是现在就将 mod_perl 一起安装,后面可以省去很多麻烦(麻烦见下文),由于 Apache 是用 yum 方式安装的,所以 mod_perl 最好也用 yum 安装,否则后面会一堆麻烦(见下文)
$ sudo yum install mod_perl
$ sudo service mysqld stop
$ sudo service mysqld start
$ mysqladmin -u root password <password>
$ sudo service httpd stop
$ sudo service httpd start
============
安装 glimpse
============
$ ./configure
$ make
...
make[1]: Leaving directory `/share/linux-data/Downloads/glimpse-4.18.6/index'
make[1]: Entering directory `/share/linux-data/Downloads/glimpse-4.18.6/dynfilters'
flex -F -8 htuml2txt.lex
make[1]: flex: Command not found
make[1]: *** [lex.yy.c] Error 127
make[1]: Leaving directory `/share/linux-data/Downloads/glimpse-4.18.6/dynfilters'
make: *** [build-sub] Error 2
$ sudo yum install flex
$ make
$ make install
=============
安装 lxr
=============
$ cd /usr/local/share
$ tar -xzvf lxr-1.2.0.tgz
$ mv lxr-1.2.0.tgz lxr
$ cd lxr
LXR root directory 为 "/usr/local/share/lxr"
genxref --checkonly
====================
$ ./genxref --checkonly
Can't locate File/MMagic.pm in @INC (@INC contains: lib scripts /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./genxref line 30.
BEGIN failed--compilation aborted at ./genxref line 30.
[hwx@hwx lxr]$ ./genxref --checkonly
Can't locate File/MMagic.pm in @INC (@INC contains: lib scripts /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./genxref line 30.
BEGIN failed--compilation aborted at ./genxref line 30.
$ sudo yum install perl-File-MMagic
$ ./genxref --checkonly
ERROR: could not open configuration file lxr.conf
[ OK ] Perl version ... 5.10.1
Parameter 'ectagsbin' not defined - trying to find ctags
ctags found at /usr/bin/ctags
[ OK ] ctags version ... 5.8
Parameter 'glimpsebin' not defined - trying to find glimpse
glimpse found at /usr/local/bin/glimpse
Checked: glimpse version ... 4.18.5
Parameter 'glimpseindex' not defined - trying to find glimpseindex
glimpseindex found at /usr/local/bin/glimpseindex
Checked: glimpseindex version ... 4.18.5
Parameter 'swishbin' not defined - trying to find swish-e
swish-e not found, `command -v swish-e` returned a null string
genxref stopped without indexing by --checkonly option
配置 lxr(./scripts/configure-lxr.pl -vv)
========================================
$ ./scripts/configure-lxr.pl -vv
*** LXR configurator (version: 1.13) ***
LXR root directory is /usr/local/share/lxr
Configuration will be stored in custom.d/
mkdir custom.d: Permission denied at ./scripts/configure-lxr.pl line 223
[hwx@hwx lxr]$ sudo ./scripts/configure-lxr.pl -vv
[sudo] password for root:
*** LXR configurator (version: 1.13) ***
LXR root directory is /usr/local/share/lxr
Configuration will be stored in custom.d/
directory custom.d created
Configure for single/mu