1. Install PHP
PHP is a server-side scripting language for web based services. It is also often used as a general-purpose programming language. Install PHP minimizing installation of CentOS in:
# Yum install php
After installing php, confirm to restart the Apache service in order to rendering PHP Web browser.
# Systemctl restart httpd.service
Next, by creating the following under the Apache document root directory php script validation PHP.
# Echo -e ""> /var/www/html/phpinfo.php
Now see the PHP file we just created in the Linux command line (phpinfo.php).
# Php /var/www/html/phpinfo.php
# Links http://127.0.0.1/phpinfo.php
2. Install MariaDB database
MariaDB is a branch of MySQL. RHEL and its derivative version has migrated from MySQL to MariaDB. This is a mainstream database management system, is a must-have tool for you. No matter how you configure the server, you'll need it sooner or later. Install MariaDB on minimizing installation of CentOS, as follows:
# Yum install mariadb-server mariadb
Install MariaDB database
Start MariaDB and configure it to start automatically at boot time.
# Systemctl start mariadb.service
# Systemctl enable mariadb.service
Allow mysql (mariadb) services through the firewall (LCTT Annotation: If your MariaDB only used in this machine, you must not be allowed through the firewall settings, use the UNIX Socket connection to your database; if you need to connect to a database on another server, then try using the internal network, rather than to database services exposed on the public Internet.)
# Firewall-cmd -add-service = mysql
Now is the time to ensure the safety of the MariaDB server (LCTT Annotation: This step is mainly to set mysql password management).
# / Usr / bin / mysql_secure_installation
MariaDB database protection
Install LAMP (Linux, Apache, MariaDB, PHP / PhpMyAdmin) on CentOS 7.0
Create Apache virtual hosts on CentOS 7.0
3. Install and configure SSH server
That SSH Secure Shell, Linux is the default protocol for remote management. SSH is minimized with one of the most important software installed on the server running CentOS.
Check the SSH version currently installed.
# SSH -V
Check the SSH version
Use a more secure SSH protocol, rather than the default protocol, and change the port number to further enhance security. Edit SSH configuration file '/ etc / ssh / ssh_config'.
Uncomment the following line from the agreement or delete rows 1, then the line looks like this (LCTT Annotation: SSH v1 is expired abandoned insecure protocol):
# Protocol 2,1 (original)
This change forced the use of SSH protocol 2, it is considered more secure than 1 protocol, while also ensuring change the port number in the configuration 22 to the other.
SSH login protection
SSH cancel the 'root login', only allows to use ordinary user account to log after su to root, to further enhance safety. Open and edit the configuration file '/ etc / ssh / sshd_config' and change PermitRootLogin yes to PermitRootLogin no.
# PermitRootLogin yes (original)
Cancel Direct SSH Root Login
Finally, restart the SSH service to enable the changes.
# Systemctl restart sshd.service
5 Best Practices to encrypt and protect SSH server
5 easy steps to achieve using SSH Keygen no password SSH
Achieve "no password SSH key authentication" in the PuTTY
4. Install the GCC (GNU Compiler Collection)
GCC, the GNU Compiler Collection, is a GNU project development support for multiple programming language compiler system (LCTT Annotation: need it when you need to build their own translation software). Minimizing installation of CentOS not installed by default. Run the following command to install gcc compiler.
# Yum install gcc
Install GCC on CentOS
Check the version of gcc installed.
# Gcc --version
Check GCC version
11. Install Java
Java is a general purpose class-based, object-oriented programming language. Not installed by default in minimizing the CentOS server (LCTT Annotation: If you do not have any Java application, you can not install it). Install Java from the library in accordance with the following commands.
# Yum install java
Check the Java version installed.
# Java -version
Check the Java version