2021-05-28 部署wordpress

阿里云部署wordpress并支持https

# 安装数据库
yum -y install mariadb-server mariadb
# 安装php7
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php71w-xsl php71w php71w-ldap php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath php71w-mcrypt -y
yum install -y php71w-fpm

# 安装nginx
yum install -y epel-release
yum install -y nginx

# 启动php 数据库 nginx
systemctl start php-fpm mariadb nginx

# nginx 配置文件设置
server {
        listen      80;
        server_name www.itnzs.top;
        location / {
			root /usr/share/nginx/html;
			index index.php;
		}
        location ~ \.php$ {
            root           /home/nginx/html;  #指定网站目录
            fastcgi_pass   127.0.0.1:9000;    #指定访问地址
            fastcgi_index  index.php;		#指定默认文件
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; #站点根目录,取决于root配置项
            include        fastcgi_params;  #包含nginx常量定义
        		}
        }

# 重启nginx
systemctl restart nginx
# mysql 创建数据库
mysql -e "create database wordpress"
# 代码上传
tar xf wordpress-5.7.2-zh_CN.tar.gz
rm -rf /usr/share/nginx/html/*
cp -r ./wordpress/* /usr/share/nginx/html

浏览器访问

上一篇:WordPress安全篇(1):WordPress网站启用HTTPS详细教程


下一篇:WordPress 5.7 XXE Vulnerability---翻译自seebug