rpm Archives - Justin Silver https://www.justinsilver.com/tag/rpm/ Technology, Travel, and Pictures Wed, 10 May 2017 21:58:18 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.1 https://www.justinsilver.com/wp-content/uploads/2013/06/cropped-apple-touch-icon-160x160.png rpm Archives - Justin Silver https://www.justinsilver.com/tag/rpm/ 32 32 Install Jenkins as a Service on CentOS 7 https://www.justinsilver.com/technology/linux/install-jenkins-service-centos-yum/?utm_source=rss&utm_medium=rss&utm_campaign=install-jenkins-service-centos-yum https://www.justinsilver.com/technology/linux/install-jenkins-service-centos-yum/#respond Wed, 27 Apr 2016 19:17:41 +0000 https://www.justinsilver.com/?p=4140 I have previously written about how to Install Jenkins on CentOS as a Service where it was necessary to write your own startup, shutdown, configuration, and init.d scripts. Luckily this is all much easier...

The post Install Jenkins as a Service on CentOS 7 appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

I have previously written about how to Install Jenkins on CentOS as a Service where it was necessary to write your own startup, shutdown, configuration, and init.d scripts. Luckily this is all much easier now as you can install the software directly from a yum repository – you’ll just need to fetch the repo from http://pkg.jenkins-ci.org/redhat/jenkins.repo.

Install Jenkins from the Yum Repository

Make sure you have Java on your system, then fetch the yum repository and install Jenkins.

yum -y install java 
curl http://pkg.jenkins-ci.org/redhat/jenkins.repo -o /etc/yum.repos.d/jenkins.repo
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
yum -y install jenkins

Enable and Start Service

Since CentOS 7 uses Systemd, use it to start the service on reboot.

systemctl enable jenkins
service jenkins start

Access Jenkins

This will start jenkins on port 8080 by default (you can change these settings in /etc/sysconfig/jenkins). Leaving it as is and setting up a reverse Nginx proxy is my preference. Once you load the Jenkins home page you will be prompted to enter a password located in a file on your system to continue the setup. Here is a sample of my Nginx configuration.

# jenkins is upstream listening on port 8080
upstream jenkins {
        server                          127.0.0.1:8080 fail_timeout=0;
}

# nginx is listening on port 80
server {
        listen                          80;
        server_name                     jenkins.example.com;
        
        location / {
        
                proxy_set_header        Host $host:$server_port;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Forwarded-Proto $scheme;

                proxy_pass              http://jenkins;
        }
}

Keep in mind that you may have issues initially proxying to Jenkins if SELinux is configured to block access to port 8080. If you try to load the site via Ngnix and get a “502 Bad Gateway” error, check out the /var/log/audit/audit.log – you will probably see errors regarding Nginx connecting to your port. You can either add the port by hand, or do it automatically with audit2allow.

mkdir ~/.semanage && cd ~/.semanage
cat /var/log/audit/audit.log | grep nginx | grep denied | audit2allow -M semanage
semodule -i semanage.pp

If you need to generate an SSH key for the Jenkins user, use sudo to run as the proper user.

sudo -u jenkins ssh-keygen

Enjoy!

The post Install Jenkins as a Service on CentOS 7 appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/linux/install-jenkins-service-centos-yum/feed/ 0
Install logtail on CentOS https://www.justinsilver.com/technology/linux/install-logtail-centos/?utm_source=rss&utm_medium=rss&utm_campaign=install-logtail-centos https://www.justinsilver.com/technology/linux/install-logtail-centos/#respond Mon, 02 Jun 2014 22:09:36 +0000 http://justin.ag/?p=3599 The developer of logtail has not made the repository available via yum for quick installation. Even if you don’t want to access logtail from the command line, it is still used by several other scripts...

The post Install logtail on CentOS appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

The developer of logtail has not made the repository available via yum for quick installation. Even if you don’t want to access logtail from the command line, it is still used by several other scripts and plugins, such as the Nginx plugins for Munin. The easiest way to do this is to install logcheck, which includes logtail. You can use rpm to handle the install, but you will need to install some dependencies first.

Install Dependencies

Use rpm to install the logtail dependencies in the order below – liblockfile, lockfile-progs, perl-mime-construct, and perl-Proc-WaitState. If you already have one of these packages rpm should let you know when you try to re-install it.

liblockfile

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/liblockfile-1.08-9.el5.i386.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/liblockfile-1.08-9.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:liblockfile            ########################################### [100%]

liblockfile was successfully installed.

lockfile-progs

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/lockfile-progs-0.1.15-2.el5.i386.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/lockfile-progs-0.1.15-2.el5.i386.rpm
Preparing...                ########################################### [100%]
   1:lockfile-progs         ########################################### [100%]

lockfile-progs was successfully installed.

perl-mime-construct

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-mime-construct-1.11-2.el5.noarch.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-mime-construct-1.11-2.el5.noarch.rpm
Preparing...                ########################################### [100%]
	package perl-mime-construct-1.11-2.el5.noarch is already installed

perl-mime-construct was already installed.

perl-Proc-WaitStat

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-Proc-WaitStat-1.00-2.el5.noarch.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/perl-Proc-WaitStat-1.00-2.el5.noarch.rpm
Preparing...                ########################################### [100%]
	package perl-Proc-WaitStat-1.00-2.el5.noarch is already installed

perl-Proc-WaitStat was already installed.

Install logcheck

Now we’re ready to install logcheck. Use the following rpm to wrap up the install.

rpm -ivh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/logcheck-1.3.13-6.el5.noarch.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/5/i386/logcheck-1.3.13-6.el5.noarch.rpm
Preparing...                ########################################### [100%]
   1:logcheck               ########################################### [100%]

Run logtail

Now that logcheck is installed, you should be able to call logtail from the command line, or other scripts and plugins.

[root@web1 ~]# logtail
No logfile to read. Use -f [LOGFILE].

The post Install logtail on CentOS appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/linux/install-logtail-centos/feed/ 0