Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2998,"date":"2020-01-09T19:38:44","date_gmt":"2020-01-09T19:38:44","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2998"},"modified":"2020-01-09T19:38:44","modified_gmt":"2020-01-09T19:38:44","slug":"installing-jenkins-on-ubuntu","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/installing-jenkins-on-ubuntu\/","title":{"rendered":"Installing Jenkins on Ubuntu"},"content":{"rendered":"

Jenkins is a CI (continuous integration) server. It can be a very handy tool for developers. In this tutorial, I will show you how to install and setup Jenkins.<\/p>\n

Step 1: Installing Jenkins<\/h3>\n

First off, we need to add the key and source list to apt. We can do this by executing the following commands.<\/p>\n

wget -q -O - http:\/\/pkg.jenkins-ci.org\/debian\/jenkins-ci.org.key | apt-key add -\r\necho deb http:\/\/pkg.jenkins-ci.org\/debian binary\/ > \/etc\/apt\/sources.list.d\/jenkins.list\r\napt-get update\r\n<\/code><\/pre>\n

Next, install Jenkins. Note that this can take quite some time.<\/p>\n

apt-get install jenkins\r\n<\/code><\/pre>\n

Step 2: Accessing Jenkins<\/h3>\n

Time to configure Jenkins. By default, Jenkins runs on port 8080, so you can access it by visiting\u00a0http:\/\/[SERVER_IP]:8080<\/code>\u00a0in your web browser.<\/p>\n

By default, everyone has access to Jenkins. You may want to add a password so that not everyone can use it. To add a password, go to “Manage Jenkins” (left). You will see a warning; click on “Setup Security” next to it.<\/p>\n

When asked, choose “Jenkins’s own user database” and “Matrix-based security”. Anonymous should only have “Read”. Save these settings.<\/p>\n

Jenkins will ask you to sign up now. Choose a username, password, email address, and full name. Click “Sign up”. You’ll now be the administrator of your Jenkins server.<\/p>\n

Step 3: Using Jenkins on port 80<\/h3>\n

If you want to be able to use a domain name with your Jenkins server, but you don’t want people to have to type “:8080” after it each time, we can set up iptables so all traffic from port 80 will be redirected to port 8080. Add the following iptables rules.<\/p>\n

iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT\r\niptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT\r\niptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080\r\n<\/code><\/pre>\n

Make sure to save and restart iptables.<\/p>\n

service iptables save\r\nservice iptables restart\r\n<\/code><\/pre>\n

Step 3: Adding a job<\/h3>\n

In Jenkins, you can have multiple jobs; that basically means that you have multiple projects that you can build. To add a job, click “New Job” (you have to be logged in). From here, it should be pretty straight-forward; if you have a Maven project, click Maven of course!<\/p>\n

Step 4: Using Apache and SSL for Jenkins<\/h3>\n

If you want to use Apache as a reverse proxy, that’s easy with Jenkins!<\/p>\n

You need the following Apache modules to be installed.<\/p>\n

a2enmod proxy\r\na2enmod proxy_http\r\n<\/code><\/pre>\n

Now add a virtual host.<\/p>\n

<VirtualHost *:443>\r\n  ServerName jenkins.domain\r\n  ServerAlias www.jenkins.domain\r\n\r\n  SSLEngine On\r\n  SSLCertificateFile    \/etc\/apache2\/ssl\/crt\/jenkins.domain.crt\r\n  SSLCertificateKeyFile \/etc\/apache2\/ssl\/key\/jenkins.domain.key\r\n\r\n  ProxyRequests     Off\r\n  ProxyPass         \/  http:\/\/localhost:8080\/\r\n  ProxyPassReverse  \/  http:\/\/localhost:8080\/\r\n  ProxyPassReverse  \/  http:\/\/jenkins.host\/\r\n  <Proxy http:\/\/localhost:8080\/*>\r\n    Order allow,deny\r\n    Allow from all\r\n  <\/Proxy>\r\n  ProxyPreserveHost on\r\n<\/VirtualHost>\r\n<\/code><\/pre>\n

This will allow you to use Jenkins with SSL.<\/p>\n

Step 5: Installing plugins<\/h3>\n

There are a lot of plugins for Jenkins; they allow you to do a lot of things. To install a plugin, go to “Manage Jenkins” and then click on “Manage Plugins”. This area will allow you to install plugins.<\/p>\n

Step 6: Increase Maven’s memory<\/h3>\n

Although this is slightly off-topic, I still thought I’d share how to increase the memory assigned to Maven. You need to edit\u00a0MAVEN_OPTS<\/code>. For example:<\/p>\n

set MAVEN_OPTS=\"-Xmx1024m -XX:MaxPermSize=128m\"<\/code><\/pre>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[245,247],"manual_kb_tag":[490],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2998"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2998"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2998\/revisions"}],"predecessor-version":[{"id":2999,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2998\/revisions\/2999"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2998"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2998"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}