赞
踩
vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
yum install -y nginx
RPM部署
yum install -y php php-mysqlnd gd php-gd
systemctl restart nginx
systemctl enable nginx
mkdir -p /www/html
vim /www/html/index.php
测试php页面(php基本信息)
<?php
phpinfo();
?>
测试语句
vim /etc/nginx/conf.d/default.conf
增加PHP主页名称:index.php
server {
...
location / {
root /www/html;
index index.php index.html index.htm;
}
...
}
systemctl restart nginx
http://192.168.145.155/index.php
需要配置php和php-fpm关联
# find / -name php-fpm.conf
/etc/nginx/conf.d/php-fpm.conf
/etc/php-fpm.conf
/usr/lib/systemd/system/httpd.service.d/php-fpm.conf
/usr/lib/systemd/system/nginx.service.d/php-fpm.conf
# vim /etc/nginx/conf.d/php-fpm.conf
upstream php-fpm {
server unix:/run/php-fpm/www.sock;
}
复制:unix:/run/php-fpm/www.sock;
vim /etc/nginx/conf.d/default.conf server{ location / { root /www/html; index index.php index.html index.htm; } location ~ \.php$ { root /www/html; #fastcgi_pass 127.0.0.1:9000; fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # 修改此行为正确的根目录变量 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
RPM部署
购买服务器/云主机
购买域名&IP
上传APP
wget https://foruda.gitee.com/attach_file/1679018961262440635/discuz_x3.5_sc_utf8_20230316.zip?token=4df35224fad2fe04d8ce8123bf3cb65c&ts=1682306575&attname=Discuz_X3.5_SC_UTF8_20230316.zip
yum install -y unzip
rm -rf /www/html/*
unzip eyoucms-fuzhuang-v1.6.6.zip -d /www/html/
chmod -R 777 /www/html
按实际情况给权限,这里因为是实验,所以给了全部权限
这里因为上面MySQL改过密码,所以使用的是MySQL中root的新密码
下面创建的是项目后台的管理员和密码
这是首页
这是后台管理页面
此时已经完成部署
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。