My preferred Linux distro at the moment is CentOS 7. It is a community-supported distribution that follows the work that Red Hat does with Red Hat Enterprise Linux (RHEL). It is stable operating system for web servers and something I use every day. Unlike MacOS or Windows, which have lots of internet resources for support, Linux is a bit different. It inherits most of the UNIX terminology and documentation, and perhaps because of this, you will find it harder to research things. After a while, I started to make notes for myself and this post is the end result of some of that note taking. Many things in Linux are step oriented. For example, you should not install PHP, before you have Apache or some other web server installed. Below I have documented some of the steps I take after installing a bare minimum install of CentOS 7 without any GUI. I plan on revising this post in the future as I add or revise my post installation steps.
Note: It is assumed that you are aware that all administrative commands in Linux require root privileges, so I have left out the sudo part. Learn more about how to become root on the CentOS Wiki.
Post Installation Tasks:
1. Update System (Update YUM and Install Updates)
This will automatically update the system. The -y option will suppress any prompting to accept the changes.
yum -y update && yum -y upgrade
2. Enable Repositories
Before installing some packages in the next section, you will need to enable some repositories. The most common are EPEL, IUS, and Remi. Unlike Ubuntu, CentOS is a linux distro that caters to users interested in an enterprise platform. This means that CentOS chooses stability over newer updated software. The EPEL, IUS, and Remi repositories aim to bring newer versions of software to CentOS, without compromising the overall goal of stability. I leave it up to you to read about what repositories to enable and why. In this tutorial, we will enable EPEL and Remi.
Enable EPEL Repo:
To enable EPEL, just use the YUM command. If this command does not work, reference the EPEL Wiki for more information.
yum install epel-release
Enable Remi Repo:
The primary reason for enabling Remi is for testing out newer versions of PHP. You can reference the Remi site for more information, however if you primarily interested in PHP, it is better to use the Remi Configuration Wizard to learn about the various way you want to setup PHP. Note that PHP is also available through the IUS repository. For this tutorial we will install only PHP version 7.1 from Remi.
In order to install PHP from Remi, we must enable EPEL. We have already done this so we will skip the first step.
# EPEL already enabled #yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm yum install yum-utils yum-config-manager --enable remi-php71 yum update
To install additional packages:
yum install php-xxx
We then can verify the PHP Version and PHP Extensions installed:
php --version php --modules
3. Programs and Applications to Install
The following commands, applications, packages are useful to install on a new system. You can use yum to install each of them. Skip down to the YUM Commands section to learn more about yum commands. In Linux most anything installed by yum is called an package, however most Windows users are familiar with the terms application or program. I use the term application interchangeably with package.
To install a specific application/package…
yum install package-name