mistic
mistic

Reputation: 56

Change Bitnami Jenkins base root URL

I've installed Jenkins with bitnami image on google cloud. However I want to change base root path from /jenkins to / but I can't do it until the moment. I've tried with bnconfig --appurl / but isn't working. Any idea?

Upvotes: 1

Views: 1038

Answers (1)

David Barranco
David Barranco

Reputation: 452

Bitnami developer here.

In order to move jenkins to root you should do this:

  • First, modify the contend of the /opt/bitnami/apps/jenkins/conf/httpd-app.conf to make apache don't serve jenkins in /jenkins. The content of the file should be this:

               ProxyRequests     Off
               ProxyPreserveHost On
               AllowEncodedSlashes NoDecode
               <Location />
               ProxyPass ajp://localhost:8009/ nocanon
               </Location>
    
    
    
    # App url redirect
    # RewriteEngine On
    # RedirectMatch ^/$ /jenkins/
    

Note that you should open the file with root privileges, for example sudo vim httpd-app.conf

Then, you should go to /opt/bitnami/apache-tomcat/webapps Inside that folder you should have 3 files:

ROOT (folder)
jenkins.war
jenkins (folder)

Now you should delete the ROOT folder:

sudo rm -rf ROOT

And move the jenkins folder to ROOT folder:

sudo mv jenkins ROOT

Also, in order to make that works you have to create a file in /opt/bitnami/apache-tomcat/conf/Catalina/localhost called ROOT.xml

The content of that file should be:

<Context>
  <Environment name="JENKINS_HOME" value="/opt/bitnami/apps/jenkins/jenkins_home" type="java.lang.String"/>
</Context>

Then, you should restart all the services with: sudo /opt/bitnami/ctlscript.sh restart

And then you should be able to access to jenkins in /

Upvotes: 6

Related Questions