Arch Linux LXR installation process

Source: Internet
Author: User
Tags postgresql sqlite arch linux

Reference pages:

http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install.php

I chose the version: 2.2, my own operating system is Arch Linux


Install the necessary environment:

Perl:sudo Pacman-s Perl

Ctags:sudo pacman-s Ctags

Mariadb:sudo pacman-s MariaDB

Apache httpd:

After installation, the following configuration is required: Before starting the service:

# mysql_install_db--user=mysql--basedir=/usr--datadir=/var/lib/mysql

# sudo systemctl start mysqld

Set Password: '/usr/bin/mysqladmin '-u root password ' new-password ' or '/usr/bin/mysqladmin '-u root-h <username> password ' n Ew-password

Mod_perl:

1, download the place: https://aur.archlinux.org/packages/mod_perl/here to download Git,https://aur.archlinux.org/mod_perl.git, Then use Makepkg-sri. There will be a unknown public key error, GPG--keyserver hkps://hkps.pool.sks-keyservers.net--search-keys ab34ba0040e92ece (once useful) , but I usually use the--skippgpcheck directly. To install: Makepkg-sri--skippgpcheck

2, then also according to the page configuration https://wiki.archlinux.org/index.php/Mod_perl#Installation

I use the first method: Create a httpd-vhosts.conf file, and then fill in

#/etc/httpd/conf/extra/httpd-vhosts.conf

<virtualhost perlwebtest:80>

Servername Perlwebtest
Documentroot/srv/http/perlwebtest
Errorlog/var/log/httpd/perlwebtest-error.log
Customlog/var/log/httpd/perlwebtest-access.log combined
<directory/srv/http/perlwebtest>addhandler perl-script. pl
Perlresponsehandler Modperl::registry
Options +execcgi
Perloptions +parseheaders
AllowOverride All
Order Allow,deny
Allow from all</directory>

</VirtualHost>
Then include in the configuration file:

Include conf/extra/httpd-vhosts.conf
To ensure that the configuration file does not have this option:

Options Indexes FollowSymLinks
Add the following line to the/etc/hosts

127.0.0.1 localhost yourhostname perlwebtest

glimpse:http://webglimpse.net/download.php,

Perl database Driver Interface DBI and the relevant DBD driver for the database:

sudo cpan install Dbi::mysql

sudo cpan install Dbd::mysql

Perl File::mmagic:

sudo cpan install File::mmagic

SOURCE Download: Https://sourceforge.net/projects/lxr/?source=typ_redirect


Here, the first part is basically done. You will need to configure the server again later. Go up there and continue.

In fact, no matter what kind of system, as long as these dependencies are installed, and finally can be used.




Part II: Installation of LXR source code

I am installed on a system-wide, execute the following command:

Reference command:

$ cd/usr/local/share
$ TAR-ZXF ~/download/lxr-x.y.z.tgz
Actual command:

$ cd/usr/local/share
$ sudo tar-zxf ~/downloads/lxr/lxr-2.2.1.tgz
sudo mv LXR-2.2.1/LXR
sudo chown-r <username> LXR
Enter the directory

Cd/usr/local/share/lxr
Check if the current environment is compliant

$./genxref--checkonly





Part III:

Configuration section: The configuration section is the place where you need to see the document most. Here, I posted all my options, if you want to quickly create, you can press my direct input, and according to the arrangement of my file name to refer to how to set.

To open a configuration command:

$./SCRIPTS/CONFIGURE-LXR.PL-VV

* LXR Configurator (version:2.2) *

LXR root directory IS/USR/LOCAL/SHARE/LXR
Configuration would be stored in custom.d/
Directory CUSTOM.D created
Directory CUSTOM.D/DB-SCRIPTS.D created

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

* LXR Web server Configuration *

Many different configurations is possible, they is related to the
LXR Service is accessed, i.e to the structure of the URL.
Refer to the User's Manual for a description of the variants.

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

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 given as an IP address such as 123.45.67.89

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

-Port May is omitted if standard for the scheme.
---Host name or IP? [//LocalHost] >
---Alias name or IP? >
URL section name of LXR in your server? [/LXR] >

* LXR Database Configuration *

The choice of the database engine can make a difference in indexing performance,
But resource consumption was also an important factor.
* For a small personal project, try SQLite which does not

Need a server and is free from the configuration burden.

* For medium to large projects, choice is between MySQL,

PostgreSQL and Oracle.
Oracle is isn't a free software, its interface have not been
Tested for a long time.

* PostgreSQL databases is smaller than MySQL ' s

And performance is roughly equivalent.

* MySQL is at it best with large-sized projects

(such as kernel cross-referencing) where it is fastest at the cost
of bigger databases.

* Take also in consideration the number of connected users.
Database engine? [Mysql/oracle/postgres/sqlite] > MYSQL
---Directory for glimpse databases? >/home/<username>/glimpse_db

File. htaccess written into LXR root directory
File apache2-require.pl written into configuration directory
File apache-lxrserver.conf written into configuration directory
File lighttpd-lxrserver.conf written into configuration directory
File nginx-lxrserver.conf written into configuration directory
File thttpd-lxrserver.conf written into configuration directory
Mercurial support files written to configuration directory

* 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] > Y
Configuring File subsection
Configuring "Common Factors"
Marking Tree Section

* LXR master configuration file Setup *

Tree section part
SQL Script for Database initialisation

Configuring LXR Server Parameters
The virtual root is the fixed URL of part after the hostname.
You previously defined the virtual root AS/LXR
---Caption in page header? (e.g. Project Xyzzy displayed by LXR) > Projec Read Source Code displayerd by LXR
Does need a specific encoding for this tree? [Yes/no] > N
Describing tree location
How is your tree stored? [FILES/CVS/GIT/SVN/HG/BK] > F
A Source directory contains one sub-directory for every version.
---Source directory? (e.g./home/myself/project-tree) >/home/<username>/documents/sourcecode
Name to display for the path root? (e.g. Project or $v for version) [$v] >
Enumerating versions
Label for version selection menu? [Version] >
Versions can explicitly enumerated, be-read from a file or computed
by a function. The latter case was recommended for vcs-stored trees.
Version Enumeration method? [List/file/function] >
---Version name? > Klib
---Version name? (Hit return to stop) > libevent-2.1.8
---Version name? (Hit return to stop) > linux-2.6.39
---Version name? (Hit return to stop) > linux-4.10.10
---Version name? (Hit return to stop) > memcached
---Version name? (Hit return to stop) > Other1
---Version name? (Hit return to stop) > Other2
---Version name? (Hit return to stop) >
By default, first version on list is displayed. also indicate
A prefered version.
---Default displayed version is first in ' range '? [yes/no] > Y
Setting directory lists
Some directories may contain non-public project data (binaries,
Compilers caches, SCM control data, ...). They can hidden from LXR.
---Directory to ignore, e.g Cvsroot or CVS? (Hit return to stop) >
If Your source code uses "include" statements (#include, require, ...)
LXR needs hints to resolve the destination file.
---Include directory, e.g./include? (Hit return to stop) >/usr/include
---Include directory, e.g./include? (Hit return to stop) >/usr/local/include
---Include directory, e.g./include? (Hit return to stop) >/usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/include
---Include directory, e.g./include? (Hit return to stop) >
Configuring data storage
---Database name? > Lxr_readsourcecode
---DB user name? [LXR] >
---DB password? [LXRPW] >
---DB table prefix? [Lxr_] >
Create a database

$./custom.d/initdb.sh
Then it shows

Enter Password:
Mysql-creating Tree User LXR
Enter Password:
Mysql-creating Tree Database Lxr_readsourcecode
mysql-configuring tables Lxr_ in database Lxr_readsourcecode
Copy the configuration to the current

$ CP custom.d/lxr.conf.





The third part of the long index begins

Generate all versions directly:

$./genxref--URL=HTTP://LOCALHOST/LXR--allversions
You can also generate only one version

$./genxref--URL=HTTP://LOCALHOST/LXR--version=v1

After a night, it's ready.

Shows a message such as:

other2/tools/
---other2 install_venv.py 1491296469-4352 82079 + + + 140/138
---other2 normalize_json.py 1491296469-958 82080 + + + 28/10
---other2 ryu-manager.spec 1491296469-715 82081 + + + 29/31
---other2 topology_graphviz.py 1491296469-1021 82082 + + + 34/5
---other2 with_venv.sh 1491296469-752 82083 + + + 22/8
Other2/
---other2 run_tests.sh 1491296469-5040 82084 + + + 191/181
---other2 setup.py 1491296469-956 82085 + + + 31/9

Summary for HTTP://LOCALHOST/LXR = = Version Other2

purge:0:00:00
Free-text indexing:0:00:00
Definitions parsing:0:00:09
References parsing:0:00:17
... Total Duration: 0:00:26

Database optimisation ... Done



Fourth: Configure the server

The Configuration folder for HTTP on Arch Linux is/etc/httpd/conf (my no Last face D)

# CP Custom.d/apache-lxrserver.conf/etc/httpd/conf
Then, in my version, there is no automatic inclusion of this file, and will not automatically include the Conf inside the configuration file statement, so also need to include this configuration file

Include conf/apache-lxrserver.conf
Restart Service required:

$ sudo systemctl restart httpd
The first time it is turned on, it cannot be started successfully. Use status to view, is not started successfully, because invalid command ' Perlresponsehandler '

Try to annotate the Options Indexes in http.conf followsymlinks

It's no problem canceling the comment.

There is a featal problem, can not create a folder, it is possible because/home/<user name> folder, set the permissions, because this folder, other is not able to read, need to add permissions, you can access the

Arch Linux LXR installation process

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.