Linux:CentOS Linux release 7.5.1804 (Core)
nginx:1.14.2
php-fpm:5.4.16
mariadb-server:5.5.60
基本以上信息安裝lnmp環境php
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum -y install vim lrzsz nginx php-fpm mariadb-server php-mysql
setenforce 0
firewall-cmd --zone=public --add-service=http firewall-cmd --zone=public --add-port=9000/tcp firewall-cmd --zone=public --add-service=mysql
systemctl start mariadb mysql -e "grant all privileges on *.* to user1@'%' identified by '123456';" mysql -e "flush privileges;"
在/etc/nginx/conf.d/下建立.conf結尾的虛擬主機配置文件 :html
server { listen 80; server_name www.a.com; location / { root /usr/share/nginx/html; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
刪除原有default配置文件
檢測nginx配置文件語法:mysql
nginx -t
systemctl start php-fpm systemctl restart nginx
上傳Discuz_X3.3_SC_UTF8.zip 到服務器,解壓,複製upload目錄下所有文件到/usr/share/nginx/html/下
設置facl權限linux
setfacl -R -m u:nginx:rwx ./* setfacl -R -m u:apache:rwx ./*
重啓nginx服務,web登陸,初始化相關數據。nginx
setfacl -b ./*