1. 程式人生 > >ubuntu如何配置lxr

ubuntu如何配置lxr

4.2 trees ssi tip compute wget and pan post

配置好源
deb http://old-releases.ubuntu.com/ubuntu natty main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu natty-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu natty-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu natty-proposed main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu natty-backports main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu natty main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu natty-security main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu natty-updates main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu natty-proposed main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu natty-backports main restricted universe multiverse


1 perl
14.04 本來就有
11.04 也是有

2 ctags
sudo apt-get install exuberant-ctags
https://sourceforge.net/projects/ctags/files/
從這裏下載,然後解壓,通過以下命令編譯
./configure --prefix=/usr/local/ctags
make && make install
sudo vi /etc/bash.bashrc
export PATH=/usr/local/ctags/bin:$PATH


3 mysql-server
sudo apt-get install mysql-server
root: aishenghuo526

4 lighttpd
sudo apt-get install lighttpd

5 glimse
sudo apt-get install flex (安裝前需要安這個)
wget http://webglimpse.net/trial/glimpse-latest.tar.gz
./configure
make
make install

6 perl DBI
# perl -MCPAN -e shell
cpan> install DBI

perl Makefile.PL
make
make test
make install

7 perl File::MMagic
# perl -MCPAN -e shell
cpan> install File::MMagic
DBD::mysql

8 安裝LXR 源代碼
LXR的根目錄:/usr/local/share/lxr/
這可以服務整個系統
在這可以用使用以下命令檢查已經安裝了什麽
./genxref --checkonly
但是這裏有些沒有安裝是正常的(glimpse switch-e肯定有一個沒有安裝),由於沒配置,也會出現一9些變量沒有定義。

9 配置LXR
./scripts/configure-lxr.pl --v
記錄完整的配置過程
LXR root directory is /usr/local/share/lxr
Configuration will be stored in custom.d/

Configure for single/multiple trees? [S/m] > s
Do you intend to add other trees later? [yes/NO] > N

LXR can be located at the server-root (so called dedicated)
or lower in the server hierarchy (shared because there are
usually other pages or sections).
Server type? [dedicated/SHARED] > dedicated

The computer hosting the server is described by an URL.
The form is scheme://host_name:port
where:
- scheme is either http or https (http: can be omitted),
- host_name can be given as an IP address such as 123.45.67.89

or a domain name like localhost or lxr.url.example,

- port may be omitted if standard for the scheme.
--- Host name or IP? [localhost] > localhost
--- Alias name or IP? > //linux.lxr.org
--- Alias name or IP? >

Database engine? [MYSQL/oracle/postgres/sqlite] > MYSQL
--- Directory for glimpse databases?/usr/local/share/lxr/glimpse_DB

--- Use ‘buttons-and-menus‘ instead of ‘link‘ interface? [YES/no] > YES

* LXR master configuration file setup *

Global section part

*** Configuring auxiliary tool paths
*** Host name previously defined as http://localhost
*** Configuring HTML parameters
*** ‘Buttons-and-menus‘ interface is recommended for the kernel
*** to avoid screen cluttering.
--- Use ‘buttons-and-menus‘ instead of ‘link‘ interface? [YES/no] > YES
*** Configuring file subsection
*** Configuring "common factors"
*** Marking tree section

--- Caption in page header? (e.g. Project XYZZY displayed by LXR) > Project Linux displayed by LXR

Do you need a specific encoding for this tree ? [yes/NO] > NO

How is your tree stored? [FILES/cvs/git/svn/hg/bk] > FILES

--- Source directory? (e.g. /home/myself/project-tree) > /home/andrew/Downloads/linux

Name to display for the path root? (e.g. Project or $v for version) [$v] > $v

Label for version selection menu? [Version] > Version

Version enumeration method? [LIST/file/function] > LIST
--- Version name? > 0.11
--- Version name? (hit return to stop) > 0.12
--- Version name? (hit return to stop) >

--- Default displayed version is first in ‘range‘? [YES/no] > YES

Directory to ignore, e.g. CVSROOT or CVS? (hit return to stop) >

Include directory, e.g. /include? (hit return to stop) >

*** Configuring data storage
--- Database name? > lxr_linux_
--- DB user name? [lxr] >
--- DB password? [lxrpw] >
--- DB table prefix? [lxr_] >

configuration saved in custom.d/lxr.conf
DB initialisation sript is custom.d/initdb.sh

10 使用剛才創建好的腳本來配置數據庫
[email protected]:/usr/local/share/lxr$ ./custom.d/initdb.sh
*** MySQL - Creating tree user lxr
Enter password:
*** MySQL - Creating tree database lxr_linux_
*** MySQL - Configuring tables lxr_ in database lxr_linux_

11 拷貝復制文件到lxr根目錄
cp custom.d/lxr.conf .

12 創建索引
要註意文件夾的名稱是
/home/andrew/Downloads/linux/0.12
/home/andrew/Downloads/linux/0.11 (版本號,是用文件夾名稱來做的)

./genxref --url=http://localhost --allversions (這是生成所有版本的索引)
如果是單獨某個一版本,則是
./genxref --url=(剛才配置地址) --version=(剛配置的版本號)

13 配置網頁服務器
我使用lighttpd,版本是lighttpd/1.4.28
顯示不出source這個程序

14 安裝appache2 來試試
sudo apt-get install apache2
apt-get install libapache2-mod-perl2-dev
激活它
sudo a2enmod version
sudo service apache2 restart
(參考網頁)https://sourceforge.net/p/lxr/discussion/86145/thread/a2b8392e/
cp custom.d/apache-lxrserver.conf /etc/apache2/conf.d

然後可以使用。

ubuntu如何配置lxr