4
3

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.

Ubuntu Apache Jenkins URLの変更

Posted at

概要

jenkins設定ファイルの修正

  • jenkinsの設定ファイルは /etc/default/jenkins
  • 設定ファイルを下記の様に修正
    • JENKINS_ARGSの末尾に --prefix=/jenkins を追加
/etc/default/jenkins
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpPort=$HTTP_PORT --prefix=/jenkins"
  • ポートを変更する必要がある場合は、HTTP_PORTを修正
/etc/default/jenkins
HTTP_PORT=8080

Apache設定ファイルを追加

  • 今回はjenkins用の設定ファイル/etc/apache2/sites-enabled/jenkins.confを新規作成し、下記設定を追加した
/etc/apache2/sites-enabled/jenkins.conf
<Proxy *>
   Allow from all
</Proxy>
ProxyPass /jenkins http://127.0.0.1:8080/jenkins
ProxyPassReverse /jenkins http://127.0.0.1:8080/jenkins
RedirectMatch permanent ^/jenkins$ /jenkins/

Apacheのプロキシ利用のため、mod_proxyを有効化する

  • 下記コマンドを実行
sudo a2enmod proxy
sudo a2enmod proxy_http

jenkinsとApacheを再起動

  • 下記コマンド実行
sudo service jenkins restart
systemctl restart apache2

http://ホスト名/jenkins にアクセス確認 → 終了

4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?