2014年01月14日

基本は公式通り。加えてapatcheにdigest認証を追加。

Installing Jenkins on Red Hat distributions - Jenkins - Jenkins Wiki

環境

環境 version
OS Red Hat Enterprise Linux 6.4
webサーバー Apache 2.2.15
Java 1.6.0
Jenkins 1.547

jenkinsのインストール

$ su -
パスワード入力
# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
# rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
# yum install jenkins

javaのインストール

# yum remove java
# yum install java-1.6.0-openjdk

サービス起動

# service jenkins start
# chkconfig jenkins on

digest認証のパスワード作成

# htdigest -c /etc/httpd/.htdigest 'Secret Zone' secret
New password:
Re-type new password:
Adding password for user secret
  • -cは初回実行時のみ、二回目以降は不要
  • secretはユーザー名

config変更

redmineが80ポートを使用しているため、proxyで8080ポートでアクセスする。
※jenkinsはデフォルト8080

# vim /etc/sysconfig/jenkins

JENKINS_PORT="8080"
JENKINS_ARGS=""
↓
JENKINS_ARGS="--prefix=/jenkins"

# vim /etc/httpd/conf.d/jenkins.conf

ProxyPass /jenkins http://localhost:8080/jenkins
ProxyPassReverse /jenkins http://localhost:8080/jenkins
ProxyRequests Off

<Proxy http://localhost:8080/jenkins*>
Order deny,allow
Allow from all
AuthType Digest
AuthName "Secret Zone"
AuthUserFile /etc/httpd/.htdigest
Require user secret
</Proxy>
  • AuthNamedigest認証のパスワード作成時に指定したSecret Zoneを指定する。
  • secretはユーザー名

apatche再起動

# /etc/init.d/httpd restart

参考



blog comments powered by Disqus