2019/12/03

lxr 설치

lxr 설치

apache2 mysql lxr

1.0 lxr 설치

#ctags swish-e perl
sudo apt-get install exuberant-ctags swish-e perl

# mysql-server | MariaDB |
sudo apt-get install mysql-server

현 보안장비의 경우 mysql를 사용하기 때문에 이 데이터베이스는 설치하지 않음.
두개의 DB를 한 시스템에 구성이 가능 하다면 이 방법으로 동작 시키고 그렇지 않을 경우 mysql-server 를 사용한다.

sudo apt-get install mariadb-server

#apache2 | lighttpd
sudo apt-get install apache2

현 보안장비의 경우 아파치2를 사용하기 때문에 이 웹서버는 설치하지 않음.
sudo apt-get install lighttpd*

lxr 요구 2.0 버전
sudo apt-get exuberant-ctags
ctags --version

펄 설치
sudo apt-get install perl

lxr-2.1.0 요구 사항 5.0
perl -v

lxr 시스템 구성 요소
myxlq 4.0/5.x, oracle, postgerSQL 및 SQLite 등등 사용하지만 여기서는 mariadb-5.5 사용
sudo apt-get install mariadb-server

추가(우분투 12.04 에서는 지원하지 않음으로 mysql로 진행을 하며, 그 이상의 버전일 경우 저장소를 등록해 적용시킨다.)
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.0/ubuntu trusty main'

sudo apt-get install apache2

swich-e 구축
================
PDF, HTML, XML, Powerpoint 및 Excel, XML, HTML문법등을 지원한다.

sudo apt-get swish-e
swish-e -V

파일 인덱싱 프로그램 생성.
==========================
glimpse
http://webglimpse.net
wget http://webglimpse.net/trial/glimpse-latest.tar.gz
tar -zxvf glimpse-latest.tar.gz

./configure --prefix=/usr/local

sudo make install

glimpse --help
which glipmse
glimpse -V

펄 모듈
=======
LXR은 DBI 와 HTTP 모듈 등등을 포함하고 있다.
추가 펄 설치하기
우분투 서버 설치 방법
http://superuser.com/questions/362990/how-to-install-perl-on-ubuntu-server

cpan 설치
sudo apt-get install cpanminus

설치 후 적용된 파일
cpan App::cpanminus
File::MMagic
Perl DBI
panm DBI
cpanm File::MMagic

cpanm 참조 사이트: http://www.cpan.org/modules/INSTALL.html

apt-cache search perl <module-name>
apt-cache search perl DBD-mysql
apt-cache search perl DBD-Pg
libdbd-mysql-perl - Perl5 database interface to the MySQL database
libdbd-pg-perl - Perl DBI driver for the PostgreSQL database server

apt-get install libdbd-mysql-perl libdbd-pg-perl

검색 후 apt-get install 로 해 설치 하는되 우리는 cpan 방식으로 한다.
perl DBI
http://dev.mysql.com/downloads/dbi.html을 참조 또는
apt-cache search perl dbi-perl
sudo apt-get install libdbi-perl

DBD driver 설치하기
===================
apt-cache search perl DBD-mysql
sudo apt-get install libdbd-mysql-perl
perl File::MMagic module
cpanm File::MMagic

sudo apt-cache search perl file mmagic
apt-get install libfile-mmagic-perl

이 부분이 gitlab과 충돌 발생.
sudo apt-get install postgresql-8.3 postgresql-client-8.3

sudo apt-get install libxapian22 libsearch-xapian-perl libapache2-mod-perl2 libcgi-simple-perl libcgi-ajax-perl libhtml-parser-perl libtemplate-perl libterm-progressbar-perl libdevel-size-perl libdbd-pg-perl


lxr 다운로드
wget https://sourceforge.net/projects/lxr/files/latest/download?source=files

환경 구성 확인
./genxref --checkonly

버전를 이르켜도 그냥 진행한다.

lxr.conf 파일 생성.
./scripts/configure-lxr.pl -vv

*** LXR configurator (version: 2.1) ***
LXR root directory is /opt/lxr
Configuration will be stored in custom.d/
directory custom.d created

custom.d에 구성을 저장하기 위해 custom.d 디렉토리를 생성한다.

Configure for single/multiple trees? [S/m] > m
다중 설치

*** LXR web server configuration ***
Many different configurations are possible, they are related to the way
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 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] > SHARED
서버 유형 공유.

Selecting which tree to display can be done in various ways:
1. from the host name (all names are different),
2. from a prefix to a common host name (similar to previous)
3. from the site section name (all different)
4. from interpretation of a section name part (similar to previous)
5. from the head of script arguments
Method 5 is highly recommended because it has no impact on webserver
configuration.
Method 3 is second choice but involves manually setting up many
symbolic links (one per source-tree).
Method 1 & 2 do not involve symbolic links but need populating webserver
configuration with virtual hosts.
Note that method 2 does not work well on //localhost.
Method 4 is deprecated because it has proved not easily portable
under alternate webservers (other than Apache).

Tree designation? [ARGUMENT
/section name
/prefix in host
/hostname
/embedded in section] >
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] >
--- Alias name or IP? > http://mylxr.com
--- Alias name or IP? >
URL section name for LXR in your server? [/lxr] > /lxr
Will it be shared by all trees? [YES/no] > yes

*** LXR database configuration ***
The choice of the database engine can make a difference in indexing performance,
but resource consumption is also an important factor.
* For a small personal project, try SQLite which do not
need a server and is free from configuration burden.
* For medium to large projects, choice is between MySQL,
PostgreSQL and Oracle.
Oracle is not a free software, its interface has not been
tested for a long time.
* PostgreSQL databases are smaller than MySQL's
and performance is roughly equivalent.
* MySQL is at its 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
The safest option is to create one database per tree.
You can however create a single database for all your trees with a specific set of
tables for each tree (though this is not recommended).

How do you setup the databases? [PER TREE/global] > global
Name of global database? [lxr] > lxr
All databases can be accessed with the same username and
can also be described under the same names.
Will you share database characteristics? [YES/no] > YES

--- DB user name? [lxr] > lxr
--- DB password ? [lxrpw] > lxrpw

--- Directory for glimpse databases? > /opt/lxr/database/glimpse
--- Directory for swish-e databases? > /opt/lxr/database/swish-e

REMINDER: after this configuration step, open lxr.conf
and comment out one of 'glimpsebin' or 'swishbin'.
file .htaccess written into LXR root directory
file apache2-require.pl written into configuration directory
file apache-lxrserver.conf written into configuration directory
ERROR: unknown %virtroot% substitution marker!
ERROR: unknown %virtroot% substitution marker!
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 into 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] > YES
*** 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 part after the hostname.
*** You previously defined the virtual root as /lxr
--- Caption in page header? (e.g. Project XYZZY displayed by LXR) > gatieme-lxr
Do you want a speed switch button for this tree ? [YES/no] > YES
--- Short title for button? (e.g. XYZZY) > speed-gatieme
--- Tree identification in URL? (e.g. the-tree) > the-tree
Do you need a specific encoding for this tree ? [yes/NO] > yes
--- Encoding name? (e.g. iso-8859-1) > UTF-8
*** Describing tree location
How is your tree stored? [FILES/cvs/git/svn/hg/bk] > FILES
*** A source directory contains one sub-directory for every version.
--- Source directory? (e.g. /home/myself/project-tree) >  /opt/lxr/database/source
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 be explicitly enumerated, be read from a file or computed
*** by a function. The latter case is recommended for VCS-stored trees.
Version enumeration method? [LIST/file/function] >
--- Version name?  > 4.4.6
--- Version name? (hit return to stop) >
*** By default, first version in list is displayed. You may also indicate
*** a prefered version.
--- Default displayed version is first in 'range'? [YES/no] > YES
*** Setting directory lists
*** Some directories may contain non-public project data (binaries,
*** compilers caches, SCM control data, ...). They can be 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) >
*** Configuring data storage

--- DB table prefix? [lxr_] > lxr_

*** Configure another tree? [YES/no] > no
configuration saved in custom.d/lxr.conf
DB initialisation sript is custom.d/initdb.sh

파일 생성.
확인

lxr database 생성
=================
./custom.d/initdb.sh

데이터 베이스 생성 확인
mysql -ulxr -plxrpw
use lxr;
show tables;

lxr.conf 배치 파일.
sudo cp custom.d/lxr.conf .

위치 확인.
, 'glimpsebin'     => '/usr/local/bin/glimpse'
, 'glimpseindex'   => '/usr/local/bin/glimpseindex'
, 'glimpsedirbase' => '/opt/lxr/database/glimpse'
#   , 'swishbin'     => '/usr/bin/swish-e'
#   , 'swishdirbase' => '/opt/lxr/database/swish-e'
#   , 'swishconf' => '/opt/lxr/templates/swish-e.conf'

소스 인데스를 생성하기 전, 소스코드가 필요함.
링크를 만들어 소스 코드 분석.

/opt/lxr/database/source/$v
sudo ln -s  linux-linaro-stable-rt-4.4.6 /opt/lxr/database/source/4.4.6

목차 색인
sudo ./genxref --url=http://localhost/lxr --version=4.4.6
또는
sudo ./genxref --allurls 4.4.6

데이터베이스 적용(자세한 내용 http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install4genxref.php)
Populate LXR Database(http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install4genxref.php)
./genxref --url=http://localhost/lxr --version=4.4.6

웹 서버 적용
sudo cp custom.d/apache-lxrserver.conf  /etc/apache2/conf-enabled/

sudo service apache2 restart

Configure the Web Server(http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install5server.php)


업로드(자세한 내용 http://lxr.sourceforge.net/en/1-0-InstallSteps/1-0-install4genxref.php)
./genxref --url=http://172.16.1.115/html/lxr_leeht_1.0 --allversions
./genxref --url=http://172.16.1.115/html/lxr_leeht_1.0 --reindexall --allversions
./genxref --url=http://172.16.1.115/html/lxr_leeht_1.0 --reindexall --version=lht_wifi

conf 파일을 건들여 하는지는 의문점.

접근확인.
================
http://localhost/lxr/source
http://mylxr.com/source

sudo a2enmod cgid

댓글 없음:

댓글 쓰기