Tech Tips

  1. 未分類
  2. 156 view

[Ubuntu][Jenkins]Install and Setting

jenkins nginx
I thought I want to use Jenkins not only work place but also private environment, I tried to install jenkins.

Install Jenkins

There are articles which shows typing command below at first.
sudo wget -q -0 - | sudo apt-key add -
gpg: 有効なOpenPGPデータが見つかりません。
But I can’t due to error happening. Then, I tried to get key from
$ sudo vim /etc/apt/sources.list
deb binary/
$ sudo apt-get update
W: GPG error: jaunty Release: 公開鍵を利用できないため、以下の署名は検証できませんでした:
Next, getting key using above PUBKEY.
$ gpg --keyserver --recv-keys 1A2B3C4D5E6F7G8H
gpg: 鍵12345678をhkpからサーバーに要求
gpg: 鍵12345678: 公開鍵“Launchpad PPA for TualatriX”を読み込みました
gpg: 処理数の合計: 1
gpg:               読込み: 1  (RSA: 1)
$ gpg --export --armor 1A2B3C4D5E6F7G8H | sudo apt-key add -
It works!. Next is finally install Jenkins.
$ sudo apt-get update
$ sudo apt-get install jenkins
Done. Just set port number for Jenkins.
$ sudo vim /etc/default/jenkins
# port for HTTP connector (default 8080; disable with -1)
$ sudo service jenkins restart
Restart Jenkins.
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.
$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
$ sudo a2enmod proxy_connect
Add new site setting with Jenkins for Apache.
$ sudo vim /etc/apache2/sites-available/jenkins
 <VirtualHost *:80>
     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
        ProxyPassReverseCookiePath / /
        Order allow,deny
        Allow from all
$ cd /etc/apache2/sites-available/
$ sudo a2ensite jenkins
$ sudo /etc/init.d/apache2 restart
I can access Jenkins with example/jenkins It’s cool.

未分類 recent post

  1. Install sbt 1.0.0 and run sample template

  2. Visualization of Neural Network and its Train…

  3. [Machine Learning]Created docker image includ…

  4. [Node.js]How to write batch script with Node.…

  5. Web Server Contribution by Vagrant and Ansibl…