Install Jenkins
There are articles which shows typing command below at first.gpg: 有効なOpenPGPデータが見つかりません。sudo wget -q -0 - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
But I can’t due to error happening. Then, I tried to get key from kerserver.ubuntu.com.
Next, getting key using above PUBKEY.$ sudo vim /etc/apt/sources.list deb http://pkg.jenkins-ci.org/debian binary/ $ sudo apt-get update W: GPG error: http://ppa.launchpad.net jaunty Release: 公開鍵を利用できないため、以下の署名は検証できませんでした: NO_PUBKEY 1A2B3C4D5E6F7G8H
It works!. Next is finally install Jenkins.$ gpg --keyserver keyserver.ubuntu.com --recv-keys 1A2B3C4D5E6F7G8H gpg: 鍵12345678をhkpからサーバーwwwkeys.eu.pgp.netに要求 gpg: 鍵12345678: 公開鍵“Launchpad PPA for TualatriX”を読み込みました gpg: 処理数の合計: 1 gpg: 読込み: 1 (RSA: 1) $ gpg --export --armor 1A2B3C4D5E6F7G8H | sudo apt-key add - OK
Done. Just set port number for Jenkins.$ sudo apt-get update $ sudo apt-get install jenkins
Restart Jenkins.$ sudo vim /etc/default/jenkins # port for HTTP connector (default 8080; disable with -1) HTTP_PORT=9090 $ sudo service jenkins restart
localhost:9090 works!
Setting Apache
:9090 is not cool. And I always use reverse proxy to service-in for new page.After setting reverse proxy, we can access Jenkins with example/jenkins. Rewrite Jenkins config file.
$ sudo vim /etc/default/jenkins JENKINS_ARGS="--webroot=/var/run/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --prefix=/jenkins" $ sudo service jenkins restart
Add /jenkins to prefix. If mod_proxy doesn’t work, make it available using command below.
Add new site setting with Jenkins for Apache.$ sudo a2enmod proxy $ sudo a2enmod proxy_http $ sudo a2enmod proxy_connect
DONE!!$ sudo vim /etc/apache2/sites-available/jenkins <VirtualHost *:80> ServerName hameln.server-on.net ProxyRequests off ProxyPass /jenkins http://localhost:9090/jenkins <Location /jenkins> AuthType Basic AuthName "jenkins" AuthUserFile /etc/apache2/.htpasswd Require valid-user ProxyPassReverse http://localhost:9090/jenkins ProxyPassReverseCookieDomain localhost hameln.server-on.net ProxyPassReverseCookiePath / / Order allow,deny Allow from all </Location> </VirtualHost> $ cd /etc/apache2/sites-available/ $ sudo a2ensite jenkins $ sudo /etc/init.d/apache2 restart
I can access Jenkins with example/jenkins It’s cool.