2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS6.4 Apach2.2環境にJenkinsをインストール

Last updated at Posted at 2014-12-08

まずはここを見てみた
http://treeapps.hatenablog.com/entry/2014/06/11/233027

yumでインストールする。

##まずはjenkins用リポジトリ追加

# sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
# sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key

##インストール

# sudo yum -y install jenkins

jenkinsではデフォルトでポート8080を使用する。今回はそのまま使用する。

##ポート8080を解放する

# iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

###解放したらiptable再起動

# service iptables restart

##サブドメインを登録
自分の場合はjenkins.ドメイン名でアクセスしたかったので
お名前つかってたのでそこでやった。
参考 http://wdw-blog.info/subdomain/

##Jenkinsの設定ファイルをいじる
参考サイト http://d.hatena.ne.jp/katsuren/20121030/1351569655

 vim /etc/sysconfig/jenkins

###ApacheからJenkinsを見えるようにする

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

##Apacheのバーチャルホストの設定をする

 vim /etc/httpd/conf/httpd.conf
httpd.comf
<VirtualHost *:80>
    ServerName jenkins.ドメイン名
    ServerAlias jenkins.ドメイン名
    DocumentRoot "/var/lib/jenkins"
    ErrorLog logs/jenkins-error_log
    CustomLog logs/jenkins-access_log combined env=!no_log
    ProxyPass /jenkins http://localhost:8080/jenkins retry=5
    ProxyPassReverse /jenkins http://localhost:8080/jenkins
    ProxyRequests Off
    <Proxy http://localhost:8080/jenkins*>
        Order deny,allow
        Allow from all
    </Proxy>
</VirtualHost>

を追記。現実にはJenkinsに誰でもアクセス出来るのはあり得ないのでまた別でそのへん投稿するかも。

##Apache再起動 Jenkins起動

# service httpd restart
# service jenkins start

###ここで若干詰んだ
Jenkinsにアクセス出来るか確認

# curl localhost:8080
curl: (7) couldn't connect to host

できない。

####Jenkinsのステータス確認した

# service jenkins status
jenkins dead but pid file exists

死んでいるけどプロセスファイルはあるよ
なんでや!

ググる
http://jenkins-ci.361315.n4.nabble.com/jenkins-dead-but-pid-file-exists-td4489352.html

##Javaのバージョンが1.5だった...

# java -version

1.5だと動かない

###openjdk java 1.7インストール

# yum install jenkins dejavu-sans-fonts fontconfig java-1.7.0-openjdk

##もう一度起動して確認

# service jenkins start
# service jenkins status
jenkins (pid  8279) is running...

成功!

##アクセス

jenkins.ドメイン名/jenkins

にアクセス出来れば成功!

ジェンキンス.png

成功!

2
2
0

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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?