Redhat9下LXR 0.3的安装

最近在读《linux device drivers》(3rd)一书,而lxr和glimse是用来阅读源程序很好的工具,所以打算花点时间安装这个环境。

        由于最新版的lxr需要装数据库很麻烦,决定还是装lxr-0.3版本的。

说明:
        我这里的过程可能和很多人放置的文件夹位置不太一样,但是我想这可使大家更加清楚每一步,每一个参数是干什么用的,我想大家遇到困难的时候都会问,这个位置和做法到底是干什么的?我换成别的是否可以?所以,我在这里就适当地做了几处替换,我想会更清晰一些。

需要的软件包::
glimpse-latest.tar.gz
lxr-0.3.tar.gz
perl-5.8.0.tar.gz(最好要自己下载这个,自己安装,原来自带的可能不全)


环境:
RedHat9.0


我的源代码位置:
/usr/src/linux-2.4.20-8


安装步骤:
1. #cd /etc/httpd/conf/
#vi httpd.conf
修改DocumentRoot为自己想要的目录,随便自己定义(我用的是默认目录)。
DocumentRoot "/var/www/html"


2.1 安装glimpse
#tar -zvxf glimpse-latest.tar.gz
#cd glimpse-4.17.4
#./configure
#make
#make install
这时glimpse就安装到/usr/local/bin中了


2.2 安装perl
#tar -zvxf perl-5.8.0.tar.gz
#cd perl-5.8.0
#./Configure -d
#make
#make test
#make install
这时perl就安装到了/usr/local/bin中了.
修改 /usr/local/lib/perl5/5.8.0/i686-linux/DB_File.pm
在大约280多行,即
==========================
# make recno in Berkeley DB version 2 work like recno in version 1.
if ($db_version > 1 and defined $arg[4] and $arg[4] =~ /RECNO/ and
$arg[1] and ! -e $arg[1]) {
open(FH, ">$arg[1]") or return undef ;
close FH ;
==========================
这段语句之前加上$arg[3] = 0666 unless defined $arg[3] ;进行初始化

2.3 安装lxr
#tar -zvxf lxr-0.3.tar.gz
#cd lxr-0.3
#vi Makefile
修改如下
PERLBIN = /usr/local/bin/perl (perl安装的位置)
INSTALLPREFIX = /var/www/html/lxr (实际上是$DocumentRoot/lxr)
#make install


3 #cd /var/www/html/lxr/http (实际上是$INSTALLPREFIX/http)
#vi .htaccess
内容是:
<Files ~ (search|source|ident|diff|find)$>
SetHandler cgi-script
</Files>
#vi lxr.conf
内容是:
# Define the base url for the LXR files.baseurl中最后一个斜线"/"绝对不能少.
baseurl: http://localhost/lxr/http/

# These are the templates for the HTML heading, directory listing and
# footer, respectively.
htmlhead: /var/www/html/lxr/http/template-head
htmltail: /var/www/html/lxr/http/template-tail
htmldir: /var/www/html/lxr/http/template-dir

# The source is here.源代码本身的位置
sourceroot: /usr/src/linux-2.4.20-8
srcrootname: linux-2.4.20-8

# "#include <foo.h>" is mapped to this directory (in the LXR source
# tree)
incprefix: /include

# The database files go here.索引之后产生的索引文件所在的位置
dbdir: /var/www/html/lxr/source/2.4.20-8/

# Glimpse can be found here.
glimpsebin: /usr/local/bin/glimpse

# The power of regexps. This is pretty Linux-specific, but quite
# useful. Tinker with it and see what it does. (How's that for
# documentation?)
map: /include/asm[^//]*/ /include/asm-$a/
map: /arch/[^//]+/ /arch/$a/


4. #cd /var/www/html/lxr/source
#vi versions
2.4.20-8
#vi defversion
2.4.20-8
#mkdir 2.4.20-8


5. #cd /var/www/html/lxr/source/2.4.20-8
#/var/www/html/lxr/bin/genxref /usr/src/linux-2.4.20-8/
#glimpseindex -H . /usr/src/linux-2.4.20-8/
注意:生成的2.4.20-8/下面的fileidx的模式要改成至少是644的,让owner,group和other都可以读,可以用chmod 644 * 这个命令。


6. #cd /etc/httpd/conf
#vi httpd.conf
加入
<Directory "/home/www/html/lxr/http">
Options All
AllowOverride All
</Directory>
#cd /etc/rc.d/init.d
#./httpd restart


7. 访问http://localhost/lxr/http/source就可以了。

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值