EPELstands for Extra Packages for Enterprise Linux. This is a package repo based on Fedoraand it is managed and maintained by a Fedora Special Interest Group. The EPEL Repo contains many packages that are not shipped in the official CentOSor RHELreleases. They are very much compatible but are not officially supported.
How do I install the EPEL Repo on CentOS 7 or Red Hat Enterprise Linux 7?
Assuming you are logged in as root or have sudoaccess, then you only need one command:
This tutorial explains how to install PostgreSQL 9.3 on a CentOS 7 or RHEL 7 machine. It goes through the process of how to get the latest version of PostgreSQLthrough the very basic configurations needed to boot up the server.
Adding PostgreSQL Repository
CentOSships with PostgreSQLinstalled available in it’s default repositories. It may not be the version you would like to install. For example CentOS 7 has PostgreSQL 9.2, while CentOS 6.5has PostgreSQL 8.4. The current version of PostgreSQL is 9.3. For that reason we are going to add the PostgreSQL repority to our list of available repositories.
PostgreSQLhas quite a few packages available. For our purposes we only care about the server and it’s dependencies. But if you wanted some of the other utilities, like pg_upgrade(), you will need to install the contribpackage. Or if you want to enable the Perlextension, then install the plperl package. Here is a listing of the available packages:
To install PostgreSQLjust run the yum install command as follows:
yum install postgresql93-server.x86_64-y
Initialize PostgreSQL 9.3
Before we can do anything we need to initialize PostgreSQL. This creates the database cluster and all the file and directories needed for PostgreSQLto store the database.
Configure PostgreSQL 9.3
By default PostgreSQLlistens on localhost. To enable it to listen to any available address we must change this value either listen on all addresses with * or to a specific address. To do this we must edit the postgresql.conf file. This file holds all of the configuration parameters for PostgreSQL. The postgresql.conf file is stored in the datadirectory in our case on /var/lib/pgsql/9.3/data/.
Let’s set the listen_addresses to listen to all IP’s assigned to the machine:
Now PostgreSQLwill listen on any external IP available.
In order to allow clients to connect from anywhere except the localhost, we must allow them by editing the pg_hba.conf file. This file also is stored in the data directory.
Let’s suppose you want your PostgreSQL server to accept connections from anywhere in your network. Your network range is 192.168.1.0/24. Then we would add the following line to the pg_hba.conf file:
# TYPE DATABASE USER ADDRESS METHOD
host all all192.168.1.0/24md5
Defining the above we are adding connection socket of type host which can be any TCP/IP socket connection, this is for allavailable databases and all available users. From connections comming from the 192.168.1.0/24 network and are being authenticated with md5encrypted passwords.
You can add the settings manually or run the following command, which you should edit to accommodate your network range.
echo'host all all 192.168.1.0/24 md5'>>/var/lib/pgsql/9.3/data/pg_hba.conf
Start PostgreSQL 9.3 Server
Now that we have our server configured with basic settings we can start it.
You can run any of the two following commands to start PostgreSQL
systemctl start postgresql-9.3.service
To start PostgreSQL on startup enable the boot service
systemctl enable postgresql-9.3.service
Check PostgreSQL 9.3 is Running
If you want to check the status of PostgreSQL
systemctl status postgresql-9.3.service
Login To PostgreSQL 9.3
To login to the PostgreSQLserver we must change user to postgres. If you are logged in as root:
Once logged in as the postgres user execute the psql client command:
You are now logged into your new PostgreSQL 9.3 database.
If you followed all the instructions correctly you now have a running PostgreSQL 9.3 server on a CentOS 7 or RHEL 7 machine.
In short is an automation tool. With Ansibleyou can automate code deployments, server configurations, automatic updates. It can do this on one machine or hundreds of machines. The big difference between Ansible and it’s competitors is with agentless interactions. Ansibledoes all of it’s interaction with the machines via SSH, therefore all that it needs is a playbookand SSHcredentials to a remote machine. A playbookcontains all of Ansible’sconfigurations and tasks to be executed. A playbook is written in YAML.
Ansible is readily available in Fedora 20. However CentOS 7 and RHEL 7 users are required to install and configure the EPEL repo. For more information on installing EPEL follow my EPEL installation tutorial.
For CentOS 7, RHEL7, or Fedora 20:
sudo yum install ansible-y
For Ubuntu 14:
Make sure we have required software that might not already be installed
sudo apt-get install software-properties-common
Add the Ansiblerepository
sudo apt-add-repository ppa:ansible/ansible-y
sudo apt-get update
sudo apt-get install ansible-y
Now that we have installed Ansible we can verify that it’s installed by getting the version
If the above command returns the Ansible version, then congratulations are in order as you have successfully installed the latest version of Ansible.
This tutorial is aimed at allowing you to create a Vagrant base box which contains Centos 7.0. Vagrant allows you to create and share virtual machines with anybody. There are two ways of using Vagrant boxes, either you create them or you can import one. You can import one from the internet or any other medium. In this tutorial I will show you how to create your own Centos 7.0 Vagrant box. I usually create my own boxes as it allows me to only install the software that I need or want.
2. Download Centos 7.0 (http://www.centos.org/download/). For the purpose of this tutorial I will be using the NetInstall ISO, but you may use any other ISO. I selected the NetInstall because of it’s small file size.
3. Create a new VM with VirtualBox. I have named mine centos7-vagrant.
You may setup this box any way you want. As far as settings are concerned, I have selected the following settings:
– Memory: 2GB
– Hard Disk: 20GB fixed size
4. Once your VM has been created go ahead and boot it up. It will ask you for a start-up disk. In my case I downloaded the NetInstall ISO. So I browsed and select CentOS-7.0-1406-x86_64-NetInstall.iso
5. Install Centos with any parameters you want. I selected a minimal install since I just want the basics and any special package that I need will be installed later.
6. Set the rootpassword as “vagrant”.
7. Create the vagrantuser. Set the username and password to “vagrant”
8. Once installation is finished and the VM restarts, login as root.
9. Now would be a good time to install the VirtualBoxGuest Additions. NOTE: This is an optional step.
10. Now we need to install packages that are essential for Vagrant to operate within the VM.
yum install-yopenssh-clients man git vim wget curl ntp
11. Let’s enable some services at startup time. We need ntpdso that it sets the time up correctly every time you boot up the Vagrant box, and of course sshd in order to SSH in.
chkconfig ntpd on&&chkconfig sshd on
12. Disable iptables as it really is not needed for a Vagrant box. It would just get in the way.
16. Create /etc/sysconfig/network-scripts/ifcfg-eth0 and add the following:
17. We must now add a public key for the vagrantuser. You can use the default public key or create a custom one. You may find more information on how to create a custom vagrant public key in the following tutorial “Using custom Vagrant SSH public/private keys“. For now we are going to use the readily available vagrantpublic key.
19. To create your Vagrant Box you will need to package the VM you just created. The following command will package the VM into your home directory. You are free to change this directory by modifying the –output paramenter