Lane-CentOS7-install LAMP as Web Service
1.
# Yum install php
(The dependency package also drops httpd)
# Systemctl start httpd. service
# Firewall-cmd -- add-service = http
(The firewall unblocks http Services)
# Firewall-cmd -- permanent -- add-service = http
(Firewall unblocks http Services and writes the configuration file)
(You can view/etc/firewalld/zones/public. xml and/usr/lib/firewalld/services/http. xml)
(Php and httpd have been installed)
2.
# Yum list mysql
(No package... embarrassing)
(Go to http://dev.mysql.com/downloads/repo/yum)
# Yum install wget
# Wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# Rpm-ivh mysql-community-release-el7-5.noarch.rpm
# Yum install mysql-server
# Systemctl start mysqld. service
# Mysql_secure_installation
(Set the password according to the prompt, and enter y for all other options. In special cases, you can determine the password)
# Mysql-u root-p
(Password test successful)
Mysql> grant all privileges on *. * to "lane '@' % 'identified by '000000' with grant option;
(Username lane password 123456 allows all ip addresses to log on *. * That is, all permissions. This is very dangerous. It doesn't matter if I use a virtual machine for testing. In the actual production environment, do not execute such commands)
Mysql> flush privileges;
Mysql> quit;
# Firewall-cmd -- add-service = mysql
# Firewall-cmd -- permanent -- add-service = mysql
# Yum install php-mysql
(Installation completed)
# Systemctl restart httpd. service
# Systemctl restart mysqld. service