LINUX
2016.04.27 08:29

OpenGrok 설치 빨리하기

조회 수 10459 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
?

단축키

Prev이전 문서

Next다음 문서

+ - Up Down Comment Print
Skip to end of metadata
Go to start of metadata

0. 설치환경 : Ubuntu 12.04


 

1. 필요한 Package


 

$ sudo apt-get install tomcat6 tomcat6-admin exuberant-ctags

Tomcat등의 필요한 package들을 설치하고 OpenGrok을 download 받아서 압축을 푼다.

2. 실행환경 만들기


OpenGrok은 설치 환경이 /var/opengrok directory 아래에 구성되어 있다고 가정한다. 이를 위해 압축을 해제한 OpenGrok file들을 /var/opengrok 으로 옮긴다.

$ sudo mv ./opengrok-0.11.1 /var/opengrok

3. SRC_ROOT 변경


/var/opengrok/bin/OpenGrok file을 열어서 SRC_ROOT를 source 들이 있는 곳으로 변경한다. 기본 설정대로 /var/opengrok/src 아래에 source file을 두려면 이 설정은 건너 뛰고 src directory만 만들어 주면 된다.

    # REQUIRED: Source Code/Repository Root

    #           (your source code or the root of all repositories)

    #SRC_ROOT="${OPENGROK_INSTANCE_BASE}/src"

    SRC_ROOT="<YOUR_SOURCE_REPOSITORY_TOP>"

 

OpenGrok script의 실행경로 변경하기

OpenGrok script는 /var/opengrok directory아래에 bin, data, ext, src가 있는 것을 가정하고 작성되어 있다. Source 경로는 별도의 directory에 보관하고 있는 것을 그대로 사용하고, bin, data, ext는 home directory에 opengrok directory 아래에 있는 것을 사용하므로, OpenGrok script를 열어서 관련 부분을 수정해 준다.

1. OPENGROK_INSTANCE_BASE

: 이 값을 기준으로 bin, data, ext, src의 경로가 기본값으로 설정되어 있으므로, 원하는 경로로 이 값을 바꾼다.

    #OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/var/opengrok}"
    OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/<YOUR_HOME_DIRECTORY>/opengrok}"

2. SRC_ROOT

: Source code는 다른경로에 있는 것을 사용하므로, SRC_ROOT를 변경한다.

    # REQUIRED: Source Code/Repository Root
    #           (your source code or the root of all repositories)
    #SRC_ROOT="${OPENGROK_INSTANCE_BASE}/src"
    SRC_ROOT="<YOUR_SOURCE_REPOSITORY_TOP>"

configuration.xml 위치 변경

web.xml에서 configuration.xml 생성위치를 변경해준다. 이 파일은 source.war안에 들어 있으므로 압축을 해제한 후 수정하고 재 압축하는 다소 번거로운 절차를 따라야 한다.

1. 먼저 source.war file의 압축을 푼다.

$ unzip opengrok/lib/source.war -d opengrok/lib/source

2. web.xml을 수정한다.

: opengrok/lib/source/WEB-INF/web.xml file을 열어서 CONFIGURATION 부분의 <param-value> 값을 우리가 사용할 etc 위치로 변경해 준다. (Line 9)

$ vi opengrok/lib/source/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>OpenGrok</display-name>
  <description>A wicked fast source browser</description>
  <context-param>
    <param-name>CONFIGURATION</param-name>
    <!-- <param-value>/var/opengrok/etc/configuration.xml</param-value> -->
    <param-value><YOUR_HOME_DIRECTORY>/opengrok/etc/configuration.xml</param-value>
    <description>Full path to the configuration file where OpenGrok can read it's configuration</description>
  </context-param>

3. 다시 zip으로 압축한다.

$ zip -u opengrok/lib/source.war opengrok/lib/source/WEB-INF/web.xml 
  adding: opengrok/lib/source/WEB-INF/web.xml (deflated 80%)

4. 설치 및 indexing


모든 설정이 끝났으니 deploy하고 indexing을 시작한다.

$ sudo /var/opengrok/bin/OpenGrok deploy

$ sudo /var/opengrok/bin/OpenGrok index

http://<IP Address>:8080/source 접속하면 opengrok 화면이 보인다.

5. Source Sync 및 자동 indexing


root 권한으로 작업한다.

crontab에서 자동으로 돌릴 시간과 script 파일명을 추가한다. (data_capa_check.sh 참고)

     $vi /etc/crontab

script 파일은 매시/매일/주/월 단위로 실행 가능하며 /etc 밑의 원하는 폴더에 넣으면 된다.

     cron.hourly / cron.daily / cron.weekly / cron.monthly

실행시킬 script 파일을 미리 실행시켜서 원하는 cmd가 제대로 실행되는지 확인한다.

  • gna server 경우, 아래의 shell script를 수행하여 OpenGrok 파일을 update 하도록 하였다.
    /etc/cron.weekly/opengrok_src_update.sh 

Dreamy의 코드 스크랩

내가 모으고 내가 보는

List of Articles
번호 분류 제목 날짜 조회 수 추천 수
401 MFC [Collection] ArrayList 예제 2017.01.25 6513 0
400 MFC [Collection] CArray Class 사용법 2017.01.25 15821 0
399 업무 ABS / PLA 2017.01.18 5924 0
398 Pi NodeMCU PIN 정보 file 2017.01.09 8925 0
397 Pi SD Memory 카드 SPI 3.3V/5.0V 인터페이스 모듈 Atmega2560 제어 예제 2016.12.27 6796 0
396 Pi ATTINY85 PIN정보, Data sheet 2 file 2016.12.10 8970 0
395 Pi 키르히호프의 법칙 2016.12.05 10359 0
394 Pi 아두이노 레오나르도 보드 기본 사용법 2016.11.22 11537 0
393 Pi ARDUINO multi function shield 핀정보 및 FND 소스 2016.11.21 7487 0
392 Pi 시프트 레지스터 사용방법 (Shift Register, 74HC595, 74HC165) 2016.11.21 31410 0
391 Pi 커패시터 용량, 오차 및 정격전압 판별법 (Capacitor Code) file 2016.11.21 15596 0
390 Pi Simple DAC - PWM을 Voltage로 변환하는 회로 file 2016.11.21 7400 0
389 일반 18650 리튬이온 배터리 2016.11.15 22583 0
388 Pi 아두이노 (Arduino) 소개 및 유형별 종류, 제품별 특징 2016.11.15 6925 0
387 Pi 부품 구매 2016.11.15 5929 0
목록
Board Pagination ‹ Prev 1 ... 3 4 5 6 7 8 9 10 11 12 ... 34 Next ›
/ 34

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소

Designed by sketchbooks.co.kr / sketchbook5 board skin

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5