CentOS Server - Server Applications
Server Applications Installations For CentOS Web Server
Application Install Checklist
Application Install Checklist
Server Applications Checklist
Applications Checklist
| √ | To Do | |
| 1 | Install MySQL | |
| 2 | Install Postfix | |
| 3 | Install PHP | |
| 4 | Install Apache | |
| 5 | Install Let’s Encrypt |
Applications
Applications
Install MySQL
Installing MySQL on Centos
Uninstall MariaDB
- Uninstall MariaDB from the server
yum remove MariaDB-server MariaDB-client
Add the MySQL repository
- Download and add the following MySQL Yum repository
Downloading respository data
============================
wget https://repo.mysql.com/mysql80-community-release-el7-1.noarch.rpm
Installing the repository data
==============================
yum localinstall mysql80-community-release-el7-1.noarch.rpm
Verify if the MySQL Yum repository has been added successfully
- with the command below very that the MySQL Yum repository has been added successfully
yum repolist enabled | grep "mysql.*-community.*"
The result should be similar to
Installing MySQL Release Series
If a specific release series is required follow the following steps
- If not already installed, install yum-config-manager
yum update && yum install yum-utils - Disable the current active sub-repository, where [xx] replaces the version number
yum-config-manager --disable mysql[xx]-community - Enable the appropriate sub-repository, where [xx] replaces the version number
yum-config-manager --enable mysql[xx]-community
Install MySQL
- Install MySQL with the command below
yum install mysql-community-server
Start and enable MySQL
- Start and enable MySQL with the commands below
Start mySQL
===========
systemctl start mysqld
Enable Mysql
============
systemctl enable mysqld
Secure MySQL installation
- Lastly, secure the installation of MySQL by running the command below and following the prompts
mysql_secure_installation
Applications
Install Postfix
Installing Postfix
Uninstall SendMail
- Run the command below to ensure that SendMail is removed/not installed
yum remove sendmail
Install Postfix
- Install Postfix with the below command
yum install postfix - Make postfix as default MTA for your system using the following command
alternatives --set mta /usr/sbin/postfix
Use the command below, if the above command does not workalternatives --set mta /usr/sbin/sendmail.postfix
Start and Enable Postfix
- With the below commands, start and enable Postfix
Start Postfix
=============
service postfix start
Enable Postfix
==============
chkconfig postfix on
Open Firewall Port
- Open the firewall with the below commands to allow Postfix to communicate
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -m state --state NEW -m udp -p udp --dport 25 -j ACCEPT
Applications
Install PHP
Installing PHP
Installing Repositories
- If not already installed, install the EPEL repository with the command below
yum install epel-release - Install the Remi repository to get the latest versions of PHP with the command below
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm - If not already installed, install yum-utils
If not already installed, install - Use yum-config-manager (a utility provided by yum-utils), to Remi repository as the default repository for installing PHP, [xx] represents the version of PHP
yum-config-manager --enable remi-php[xx]
Installing PHP
- Install PHP with the command below with the default set of "add-ons" used by most PHP applications
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
Applications
Install Apache
Installing Apache Web Server
- Run the commands below to install Apache web server
Installing Apache Web server
============================
yum install httpd
Install SSL module for Apache Web server
========================================
yum install mod_ssl
Disable HTTP_PROXY
- To prevent an attack through the HTTP_PROXY vulnerability, disable HTTP_PROXY header in apache globally
echo "RequestHeader unset Proxy early" >> /etc/httpd/conf/httpd.conf
Start And Enable Apache Web Server
- To start and enable Apache Web Server use the commands below
Start Apache Web Server
=======================
service httpd start
Enable Apache Web Server
========================
chkconfig httpd on
Applications
Install Let’s Encrypt
Installing Let’s Encrypt on the web server
- Ensure that the CentOS EPEL repository is installed
yum install epel-release - Install Let's Encrypt with the command below
yum install certbot python2-certbot-apache mod_ssl
To allow the installation to finish, accept the GPG key by typing y and pressing ENTER when prompted to do so