文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>linpus93下的lxr安装

linpus93下的lxr安装

时间:2007-01-20  来源:junglegq

<style>!-- @page { size: 21cm 29.7cm; margin: 2cm } P { margin-bottom: 0.21cm } --></style>

需要的软件包:
glimpse-latest.tar.gz
lxr-0.3.tar.gz
perl-5.8.0.tar.gz(系统自带)
环境:
linpus9.3 build200
我的源代码位置:
/usr/src/linux-2.6.17.4
安装步骤:
1. #cd /etc/httpd/conf/
#vi httpd.conf
修改DocumentRoot为自己想要的目录,随便自己定义.
DocumentRoot "/var/www/html"


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

  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
    在大约259行,即
    ==========================
    # 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] ;进行初始化

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

  4. #cd /var/www/html/lxr/http (实际上是$INSTALLPREFIX/http)
    #vi .htaccess
    内容是
    <Files ~ (search|source|ident|diff|find)$>
    SetHandler cgi-script
    </Files>

  5. #vi lxr.conf
    内容是

    # Define typed variable "v", read valueset from file.

    variable: v, Version, [/var/www/html/lxr/source/versions], [var/www/html/lxr/source/defversion]
    # 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.6.17.4/
    srcrootname: linux-2.6.17.4

    # "#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/$v/

    # 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 /home/www/html/lxr/source
#vi versions
2.6.17.4
#vi defversion
2.6.17.4
#mkdir 2.6.17.4
5. #cd /var/www/html/lxr/source/2.6.17.4
#/var/html/lxr/bin/genxref /usr/src/linux-2.6.17.4
#glimpseindex -H . /usr/src/linux-2.6.17.4
注意:生成的2.6.17.4/下面的fileidx的模式要改成至少是644的,让owner,group和other都可以读
6. #cd /etc/httpd/conf
#vi httpd.conf
加入
<Directory "/var/www/html/lxr/http">
Options All
AllowOverride All
</Directory>
#cd /etc/rc.d/init.d
#./httpd restart
7. 访问http://localhost/lxr/http/source就可以了.


另:最近看到一个站点可以在线阅读:
http://lxr.linux.no/source/

参考:http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=26480


相关阅读 更多 +
排行榜 更多 +
儿童学英语

儿童学英语

学习教育 下载
今天开始生存

今天开始生存

动作格斗 下载
飞碟快闪

飞碟快闪

动作格斗 下载