This article mainly introduces the installation configuration code of Apache, PHP7 and mysql5.7 in the CentOS7 server, and the required friends can refer to the following
The configuration code for Apache, PHP7, and mysql5.7 in the CENTOS7 server looks like this:
Yum Upgradeyum Install Net-tools
Installing Apache
Close the SELinux editor to open the Etc/selinux/config file, locate the Selinux=enforcing field, change it to selinux=disabled, and restart the device. Yum-y Install httpd mod_ssl Configure firewall firewall-cmd--permanent--add-port=80/tcpfirewall-cmd--permanent--add-port=443/ Tcpfirewall-cmd--reload boot systemctl start httpdsystemctl enable HTTPD terminal Enter the following command to check the running status of httpd sudo systemctl status httpd
Installing PHP7
Add Source RPM-UVH HTTPS://DL.FEDORAPROJECT.ORG/PUB/EPEL/EPEL-RELEASE-LATEST-7.NOARCH.RPMRPM-UVH https:// mirror.webtatic.com/yum/el7/webtatic-release.rpm Installing yum Install php70w
Installing mysql5.7
1. Install the wget yum-y install Wget2. installation source wget https://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm RPM-IVH my sql57-community-release-el7-8.noarch.rpm3. Installing MySQL yum install mysql-server4. Start the MySQL service systemctl start Mysqld5. View the startup status of MySQL systemctl status mysqld6. Boot up systemctl enable mysqld Systemctl Daemon-reload7. Modify the root local login password to find Mys QL generated random password grep ' temporary password '/var/log/mysqld.log mysql-uroot-p change Password, note: mysql5.7 Default password Security check-in is installed (validate_passwor d), the default password check policy requires that the password must contain: uppercase and lowercase letters, numbers, and special symbols, and cannot be less than 8 bits in length. Otherwise it will prompt error 1819 (HY000): Your password does not satisfy the current policy requirements error ALTER USER ' root ' @ ' localhost ' I Dentified by ' mynewpass4! '; 8. Configure the default encoding to modify the/ETC/MY.CNF configuration file for UTF8, add the encoding configuration under [mysqld] [mysqld] Character_set_server=utf8 init_connect= ' Set NAMES UTF8 ' 9. Configure MySQL remote connection mysql-uroot-p use MySQL; Grant all on * * to ' root ' @ '% ' identified by ' root user's password ' with grant Option;flush privileges; then use the following command to see which users and hosts can access,% for any IP Address select User,host from user, firewall add 3306 port Firewall-cmd--zone=public--add-port=3306/tcp--permanentfirewall-cmd--reload10.mysql forgot password 1. Modify the MySQL configuration file (default =/ETC/MY.CNF) in the [ MYSQLD] Add a row skip-grant-tables2.service mysqld restart, you can go directly with MySQL 3.mysql> update mysql.user set Authentication_ String=password (' 123qwe ') where user= ' root ' and Host = ' localhost '; mysql> flush Privileges; Mysql> quit; Restore the/etc/my.cnf file and restart Mysql:service mysql Restart, this time you can use Mysql-u root-p ' 123qwe ' into mysql>set PASSWORD = PASSWORD (' NEWPASSWD '); Set a new password
summary