Maven 의 사내 저장소로 사용할 Nexus 구성.
설치할 서버에는 JDK가 이미 설치 되어 있다는 과정하네 진행합니다.
미설치시
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
클릭하여 다운 설치한다.
리눅스 JDK 설치 하는법은
아래 링크 참조
Installing Nexus
다운받을 경로로 이동
저는 ZIP파일로 된 NEXUS다운 받았습니다.
제가 설치 할 당시의 최신 버젼은 2.6.0-05였습니다.
압축 해제시 2개의 폴더가 생성 될 것입니다.
nexus-2.6.0-05
sonatype-work
2개의 폴더를 사용될 폴더로 이동 시킵니다.
해당 폴더로 옮긴후 편하게 사용하기 위해 심볼릭 링크를 생성합니다.
# cd /usr/local/src
# wget http://www.sonatype.org/downloads/nexus-2.6.0-05-bundle.zip
# unzip nexus-2.6.0-05-bundle.zip
# mv nexus-2.4.0-09 /usr/local
# mv sonatype-work /usr/local
# cd /usr/local
# ln -s nexus-2.4.0-09 nexus
Starting Nexus
# cd /usr/local/nexus
# ./bin/nexus start
****************************************
WARNING - NOT RECOMMENDED TO RUN AS ROOT
****************************************
If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script.
nexus를 root 권한으로 실행하지 않기를 추천하고 있습니다.
실행하기를 원하는 user 로 소유자를 변경합니다.
이 user 는 JAVA_HOME 과 JAVA_HOME/bin 이 path에 추가되어 있어야 합니다.
# cd /usr/local
# chown -R ggamzzak: nexus-2.4.0-09/ sonatype-work/
# su - ggamzzak
$ cd /usr/local/nexus
$ ./bin/nexus start
Starting Nexus OSS...
Started Nexus OSS.
$ ./bin/nexus status
Nexus OSS is running (23518).
$ ./bin/nexus stop
Stopping Nexus OSS...
Stopped Nexus OSS.
Running as a Service
서버 재부팅시 자동 실행하기 위해 서비스에 등록하겠습니다.
부팅시에 root로 서비스가 시작되므로 RUN_AS_USER 변수에 실제 실행될 user 입력이 필요합니다.
동시에 상대경로로 설정되어 있는 NEXUS_HOME 변수도 절대경로로 변경해 줍니다.
# cp /usr/local/nexus/bin/nexus /etc/init.d
# cd /etc/init.d/
# vi nexus
NEXUS_HOME="/usr/local/nexus"
RUN_AS_USER=ggamzzak
# chkconfig --add nexus
# chkconfig --levels 35 nexus on
# ./nexus start
Starting Nexus OSS...
Started Nexus OSS.
서비스가 정상적으로 시작되었으면 웹 브라우저에서 확인합니다.
http://domain:8081/nexus (id: admin / pw: admin123)
기본 포트는 8081이며, 방화벽 설정을 확인합니다.
다른 포트로 변경을 원할 경우 <NEXUS_HOME>/conf/nexus.properties 파일에서 가능합니다.
nexus에 대한 로그는 <NEXUS_HOME>/logs/wrapper.log 파일입니다.