LoginSignup
17
22

More than 5 years have passed since last update.

CentOSでJenkinsインストール&プロキシ設定

Last updated at Posted at 2014-10-30

CentOS7にJenkinsインストール
プロキシ設定のところでハマってイライラしたので書き置き

Javaインストール

JenkinsではJavaを利用するため、java-1.7.0-openjdkをインストール

# yum -y install java-1.7.0-openjdk

httpdインストール

webインターフェースの利用するため、もちろんhttpdインストール

# yum -y install httpd

Jenkinsインストール

CentOSではいきなりJenkinsをyumでインストールすることができないので、
レポジトリとか公開鍵をとってきます。

# 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 -y install jenkins

プロキシ設定

デフォルトではhttp://localhost:8080でJenkinsのホーム画面にアクセスできますが、
なんかみっともないのでプロキシ設定することに。

Jenkinsの設定ファイルである/etc/sysconfig/jenkinsをいじる。

/etc/sysconfig/jenkins
#ポート番号変えたい方は
JENKINS_PORT="8008"

#urlに/jenkinsさんを見せるため
JENKINS_ARGS="--prefix=/jenkins"
#設定なし http://localhost:8008
#設定あり http://localhost:8008/jenkins

apacheの設定ファイルもいじります

/etc/httpd/conf/httpd.conf
#ファイルの最後に追加
ProxyPass /jenkins http://localhost:8008/jenkins
ProxyPassReverse /jenkins http://localhost:8008/jenkins
ProxyRequests Off

サービスを再起動します。

# systemctl restart jenkins
# systemctl restart httpd

きっとこれでどうにかなる、はず。
http://localhost/jenkinsへアクセス!!

17
22
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
22