1 install Apache

yum -y install httpd
#Set the startup of chkconfig -- List httpd to view
chkconfig httpd on
#Enter the configuration file and make the following changes
vi /etc/httpd/conf/httpd.conf
ServerName localhost:80
DirectoryIndexindex.html index.php index.htm
service httpd restart

2 install MySQL

wget https://repo.mysql.com//mysql57-community-release-el6-9.noarch.rpm
rpm mysql57-community-release-el6-9.noarch.rpm
yum install mysql-community-server
service mysqld start
#Save MySQL temporary password in / var / log / mysqld.log
chkconfig mysqld on
mysql -uroot -p
Set password for user name @ localhost = password ('New password ');

3 install PHP

#Install dependency package
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
#Install PHP and related software
yum install php70w.x86_64 php70w-opcache.x86_64 php70w-pdo.x86_64 php70w-fpm.x86_64 php70w-mysql.x86_64
yum install php70w-gd.x86_64 libjpeg* php70w-ldap.x86_64 php70w-odbc.x86_64 php70w-pear.noarch php70w-xml.x86_64
yum install php70w-xmlrpc.x86_64 php70w-mbstring.x86_64 php70w-bcmath.x86_64 php-mhash php70w-pecl-redis.x86_64
#View PHP FPM
whereis php-fpm
#Start PHP FPM
service php-fpm start
#View PHP version
php -v

4 configure SSH

#Configure SSH provided by the system, and modify port 22 port number
/etc/ssh/sshd_config
#Restart SSH service
service sshd restart

5 install phpMyAdmin

#Jump to site root
cd /var/www/html
#Download compressed package
wget https://files.phpmyadmin.net/phpMyAdmin/4.6.0/phpMyAdmin-4.6.0-all-languages.tar.gz
Decompression
tar zxvf phpMyAdmin-4.6.0-all-languages.tar.gz
Rename
mv phpMyAdmin-4.6.0-all-languages.tar.gz newName
service mysqld restart
#If you are prompted to lose mysqli file
vi /etc/php.d/mysqli.ini
#Cancel the semicolon before "enable mysqli extension module"
 
#View installed software, such as
rpm -qa | grep mysql*

6 Apache configuration 301 redirection

#Open Apache configuration file
vi /etc/httpd/conf/httpd.conf
#Remove the "×" before "loadmodule Rewrite Module / module rewrite. So"
#At the end of httpd.conf file, add
#Open 301Rewrite
RewriteEngine on
#Log level
RewriteLogLevel 0
#Log address
RewriteLog logs/rewrite.log
#main code
rewritecond %{HTTP_HOST} ^straystarry.com$
rewriterule ^(.+) %{HTTP_HOST}$1 [C]
rewriterule ^straystarry.com(.*) https://www.straystarry.com$1