Update the System
Copy and execute the following command to update the critical components of the system :
yum update
After the update completed, we need to restart the system using the following command :
reboot
Install the dependencies packages
These are the basic software packages for environment settings and utility tools to compile other packages in the next section.
Copy the block command and execute in the Putty Windows :
This is a long command line, copy all and implementation.
yum -y install nano zip unzip libyaml-devel zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel
Install Apache and MySQL
Apache is a server application for communicating over the HTTP protocol. Apache runs on operating systems such as Unix, Linux, Microsoft Windows, and other operating systems.
Apache play an important role in the development of the internet and the world wide web.
MySQL is the database management free open source most popular on the world, MySQL has high speed, stability and ease of use, portability, operating on multiple operating systems offer a large system is very powerful utility functions.
With the speed and high security, MySQL is well suited for applications that access databases on the internet.
Use the following command to install :
yum -y install httpd mysql mysql-server
Allow start services when OS boot :
chkconfig httpd onchkconfig mysqld onservice httpd startservice mysqld start
Set the password for MySQL
/usr/bin/mysql_secure_installation
Because we not have a password for the root account so you press Enter to skip.
Enter current password for root (enter for none):
Select Yes to set the password for the MySQL root account.
Set root password? [Y/n] Y
Enter and confirm your password, remove the anonymous user, select Yes
Remove anonymous users? [Y/n] Y
Allow remote login to MySQL as root account, select No.
Disallow root login remotely? [Y/n] n
Delete the test database, select Yes
Remove test database and access to it? [Y/n] Y
Reload privilege tables, select Yes
Reload privilege tables now? [Y/n] Y
Turn off SELinux
SELinux is a security feature advanced for Linux operating system, when installing the system you need to turn off this feature to get the process done smoothly, after successful you can turn on back if you want.
nano /etc/selinux/config
Change the file content :
SELINUX=disabled
Press CTRL + O to save the file and press CTRL + X to exit. Set up the Hostname
By default when installing a new OS Centos not set the hostname, so we need to setting with the command :
nano /etc/hosts
127.0.0.1 localhost::1 localhost localhost.localdomain localhost6 localhost6.localdomain610.168.226.151 iZ23lttzrggZ
Add your domain name or host name that you set on both the command line, save the file and exit, the server name will be changed when restarting. Configuring the Firewall
We do not want to turn off the firewall because it's quite important, so you need to add rules to allow port 80 for HTTP and port 443 for HTTPS.
In the Centos OS, you can configuration firewall by editing files iptables and ip6tables.