In diesem Artikel wird hauptsächlich das detaillierte Konfigurations-Tutorial von CentOS7+Apache+php7+MySQL5.7 vorgestellt.
yum upgrade yum install net-tools
Apache installieren
SELinux schließen
Öffnen Sie die Datei etc/selinux/config im Editor, suchen Sie das Feld SELINUX=enforcing, ändern Sie es in SELINUX=disabled und Starten Sie das Gerät neu.
yum -y install httpd mod_ssl
Firewall konfigurieren
firewall-cmd --permanent --add-port=80/tcp firewall-cmd --permanent --add-port=443/tcp firewall-cmd --reload
Beim Booten starten
systemctl start httpd systemctl enable httpd
Geben Sie den folgenden Befehl in das Terminal ein, um den Betriebsstatus von httpd zu überprüfen
sudo systemctl status httpd
PHP7 installieren
Quellen hinzufügen
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Installieren
yum install php70w
Installieren Sie mysql5.7
1. Installieren Sie wget
yum -y install wget
2. Quelle installieren
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm rpm -ivh mysql57-community-release-el7-8.noarch.rpm
3. MySQL installieren
yum install mysql-server
4. MySQL-Dienst starten
systemctl start mysqld
systemctl status mysqld
systemctl enable mysqld systemctl daemon-reload
grep 'temporary password' /var/log/mysqld.log mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
[mysqld] character_set_server=utf8 init_connect='SET NAMES utf8'
mysql -uroot -p use mysql; Grant all on *.* to 'root'@'%' identified by 'root用户的密码' with grant option; flush privileges;
select user,host from user;
firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --reload
mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost'; mysql> flush privileges; mysql> quit;
Das obige ist der detaillierte Inhalt vonDetailliertes Konfigurations-Tutorial für PHP7, Apache, CentOS7 und MySQL5.7. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!