wordpress 搭建部署配置属于你自己的博客

基础组件:lnmp Linux,nginx ,mysql ,php
官方安装文档:
https://wordpress.org/support/article/how-to-install-wordpress/
安装过程
版本:5.2.5

yum install mysql-server  nginx -y

安装mysql 和 nginx

mysql安装初始化:
mysql_secure_installation
创建数据库:
mysql -uuser -ppassword -e “create databases wordpress;”
授权:
mysql -uuser -ppassword -e “GRANT ALL PRIVILEGES ON wordpress.* TO ‘dbuser’@‘localhost’;”

创建数据库

wordpress nginx配置规则
参考:https://blog.csdn.net/jun4331247/article/details/80738736
官网: https://wordpress.org/support/article/nginx/#general-wordpress-rules

upstream php {
        server unix:/tmp/php-cgi.socket;
        server 127.0.0.1:9000;
}
 
server {
	listen 80;
        ## Your website name goes here.
        server_name 192.168.119.110;
        ## Your only path reference.
        root /data/app/wordpress;
        ## This should be in your http block and if it is, it's not needed here.
        index index.php;
	access_log /data/log/nginx/wordpress.log;
 
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }
 
        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }
 
        location / {
                # This is cool because no php is touched for static content.
                # include the "?$args" part so non-default permalinks doesn't break when using query string
                try_files $uri $uri/ /index.php?$args; 
        }
 
        location ~ \.php$ {
                #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                #include fastcgi.conf;
                fastcgi_intercept_errors on;
                fastcgi_pass php;
		#      fastcgi_pass   127.0.0.1:9000;
      		fastcgi_index  index.php;
      		fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
      		include        fastcgi_params;
        }
 
        location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                expires max;
                log_not_found off;
        }
}

安装 php php-fpm
如果输入http://example.com/blog/wp-admin/install.php 不是打开网页而是直接下载php文件,说明没有安装php-fpm

php 版本太低,解决方案:

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm #更新源
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum remove php-common -y  #移除系统自带的php-common
yum install -y php72w php72w-opcache php72w-xml php72w-mcrypt php72w-gd php72w-devel php72w-mysql php72w-intl php72w-mbstring

安装php-fpm :
yum install php72w-fpm
启动php-fpm
systemctl start php-fpm

然后在web页面输入:http://192.168.119.110/wp-admin/install.php 根据提示填入数据库库名、账号密码、地址等,依次安装即可

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值