基于华为云nginx web服务器搭建

1,使用 yum -y install nginx安装nginx

基于华为云nginx web服务器搭建

下载网站源代码

wget https://sandbox-experiment-resource-north-4.obs.cn-north-4.myhuaweicloud.com/kunpeng/Discuz_SC_UTF8.zip

基于华为云nginx web服务器搭建

解压网站源代码

unzip Discuz_SC_UTF8.zip

基于华为云nginx web服务器搭建

进入网站目录

cd Discuz_SC_UTF8/

基于华为云nginx web服务器搭建

创建网站根目录

mkdir /upload

把当前文件夹下的upload目录下的文件全部移到/upload下

mv ./upload/* /upload

基于华为云nginx web服务器搭建

更改目录权限

chmod -R 777 /upload/*

基于华为云nginx web服务器搭建

至此网站根目录设置好

安装mariadb数据库

yum -y install mariadb mariadb-server

基于华为云nginx web服务器搭建

启动mariadb

systemctl start mariadb

设置开机自启动

systemctl enable mariadb

基于华为云nginx web服务器搭建

进入数据库

mysql

基于华为云nginx web服务器搭建

设置以root身份在本机上登录的用户密码 并授予所有表权限

基于华为云nginx web服务器搭建

创建数据库

create database kunpeng

刷新权限表,使刚才设置立即生效

flush privileges;

基于华为云nginx web服务器搭建

退出数据库

exit

基于华为云nginx web服务器搭建

安装php,php-mysql,和php-fpm

yum -y install php php-mysql php-fpm

编辑/etc/php.ini,将short_open_tag=on,保存退出

基于华为云nginx web服务器搭建

修改nginx配置文件

基于华为云nginx web服务器搭建

修改server下的location

基于华为云nginx web服务器搭建

将location ~ \.php$前注释符去掉,并修改

基于华为云nginx web服务器搭建

启动nginx和php-fpm服务

基于华为云nginx web服务器搭建

访问127.0.0.1

基于华为云nginx web服务器搭建

至此配置完毕