CentOS 7 - Create CentOS 7 Mirror

The tutorial below will show you how to configure a CentOS 7 server with Nginx to act as a mirror for other CentOS 7 servers. Steps First we need to update and install all the necessary packages. sudo yum update sudo yum install -y createrepo rsync nginx Now we need…

Read this article

Cloning CentOS Guests - Disable MAC

Today I was scratching my head trying to figure out why my changes to the network to go from DHCP to static IP was not taking effect on my CentOS 7 guest. It turns out that the network configuration is defaulted to including the HWADDR (MAC) address as shown below:…

Read this article

CentOS 7 - Disable Root Login

#!/bin/bash SEARCH="#PermitRootLogin yes" REPLACE="PermitRootLogin no" FILEPATH="/etc/ssh/sshd_config" sudo sed -i "s;$SEARCH;$REPLACE;" $FILEPATH sudo service sshd restart The script is exactly the same for debian users, except the last line in which you need to change sshd to ssh…

Read this article

CentOS 7 - Adding Users to Sudo

Most articles that talk about granting users sudo privileges do so by directly adding the user to the sudoers file. However, I am used to (and prefer) the Ubuntu way in which giving a user sudo privileges is as easy as: sudo adduser [user] sudo To set this up in…

Read this article

CentOS 7 - Install Pydf

Pydf is an alternative to the df command that I find is much easier to quickly read and understand due to it's use of text-based graphs like below: Filesystem Size Used Avail Use% Mounted on /dev/centos/root 13G 1332M 12G 10.0 [#........] / /dev/vda1 497M 150M 347M 30.1…

Read this article

CentOS - Install MySQL Server

CentOS does not come with MySQL in the repositories. Instead it has switched over to MariaDB. The script below will install MariaDB 5.5 which is extremely similar to MySql 5.5. sudo yum install mariadb-server -y sudo systemctl start mariadb sudo systemctl enable mariadb mysql_secure_installation Now you…

Read this article

CentOS 7 - Install Ceph Deploy

Execute the script below to install Ceph Deploy for the Hammer LTS release on your CentOS 7 box. sudo yum install yum-utils -y && \ sudo yum-config-manager --add-repo https://dl.fedoraproject.org/pub/epel/7/x86_64/ && \ sudo yum install --nogpgcheck epel-release -y && \ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 && \ sudo rm…

Read this article

CentOS 7 - Install Docker

Below is a script to run as a sudo user to install Docker on CentOS 7. Even though CentOS 7 runs kernel 3.10, it manages to scrape by with supporting docker. I have a feeling that even after Docker increases its minimum kernel requirements, CentOS will still be supported…

Read this article

CentOS 7 - Configure Static IP

In order to set a static IP, open /etc/sysconfig/network-scripts/ifcfg-[interface name] in your favourite editor. You should see contents similar to below. TYPE=Ethernet BOOTPROTO=dhcp DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_PEERDNS=yes…

Read this article

CentOS 7 - Mount NFS Share

First install the necessary packages. sudo yum install nfs-utils nfs-utils-lib Then edit your /etc/fstab file and add the share. [ip-of-sharing-server]:[/path/to/share] [/path/to/mount/point] nfs defaults 0 2 References DigitalOcean - How To Set Up an NFS Mount on CentOS 6…

Read this article