Configure lxr on ubuntu

Source: Internet
Author: User
Tags install perl
Configure lxr-Linux Enterprise Application-Linux server application information on ubuntu. The following is a detailed description. Linux Cross-Reference is a tool for Cross-Reference of source code. For details, refer to the LXR homepage.

Execute all commands with root permissions (that is, add sudo to the front)

1. Download The lxr source code
Apt-get source lxr-cvs

2. Decompress lxr to/var/lib/lxr/

Create the/var/lib/src/directory to store the source code.
Extract the kernel source code to/var/lib/src/and name it with the version number, for example, 2.6.17. Multiple copies can be placed.
Source code of the version. Create the/var/lib/src/versions file and include the version numbers in the file.

Create a/var/lib/swish-e/directory to store swish-cache

3. Install ctags
Apt-get install ctags

4. Install mysql 4.1 (4.x required)
Apt-get install mysql-server-4.1 mysql-client-4.1


5. install apache and mod_perl (must be apache, not apache2)
Apt-get install apache libapache-mod-perl

6. Install swish-e for text search
Apt-get install swish-e

7. Install Perl File: MMagic Module
Apt-get install libfile-mmagic-perl

8. To build a mysql environment, you must first initialize the system table.
Mysql_install_db-u root
Then start the mysql server
Mysqld_safe-u root &
Finally, you need to create the database and data table required by lxr and switch to the/var/lib/lxr/directory,
Run mysql as root
Mysql-u root-p
When the database prompts you to enter the password, press enter to enter the password at the mysql prompt.
\. Initdb-mysql // here, initdb-mysql must be in the full path, for example, in/root/lxr/initdb-mysql
To create a database table

9. Run:
Cp/var/lib/lxr/Local. pm/usr/lib/perl5/
Cp-r/var/lib/lxr/lib/LXR/usr/lib/perl5/

Mv/var/lib/lxr/templates/*/var/lib/lxr/


10 edit/var/lib/lxr. conf
1) Comment out all rows with glimps
2) Change 'swishbin' => "/some/path/to/exectuable"
'Swishbin' => '/usr/bin/swish-e'

3) set the baseurl to 'HTTP: // localhost/lxr /'
Set the primary root to '/lxr'
4) Comment out basealias
5) locate readfile ('src/version') and change it to readfile ('/var/lib/src/version ')
Set default to the default source code version (for example, 2.6.17)
Set sourceroot to/var/lib/src/
6) set swishdir to/var/lib/swish-e/
7) convert 'genericconf' => '/path/to/lib/LXR/Lang/generic. conf ',
Change to 'genericconf' => '/var/lib/lxr/lib/LXR/Lang/generic. conf ',
8) convert 'ectagsconf' => '/path/to/lib/LXR/Lang/ectags. conf ',
Change to 'ectagsconf' => '/var/lib/lxr/lib/LXR/Lang/ectags. conf ',

11. generate an index
Run:/var/lib/lxr/genxref -- url = http: // localhost/lxr/-- version = "2.6.17"
2.6.17 indicates the kernel version number (which is consistent with the directory in/var/lib/src ). You can also use -- allversions
Option to generate the index of all source code in the/var/lib/src/directory.

Since I downloaded lxr directly through apt-get install lxr-cvs, I need to copy lxr. conf to/etc/lxr-cvs,

(Note: This operation takes a very long time)

12. Configure the apache server
Open/etc/apache/httpd. conf and write
Alias/lxr/var/lib/lxr

Options All
AllowOverride All



Restart apache and access http: // localhost/lxr/source to access the source code cross-index.
Stop now: apachectl-k stop
Elegant restart: apachectl-k graceful
Restart now: apachectl-k restart
Elegant stop: apachectl-k graceful-stop
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.