WordPress个人博客搭建
Posted 皮特王同学
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WordPress个人博客搭建相关的知识,希望对你有一定的参考价值。
搭建LNMP环境
请参考前面的博文自行搭建
部署WordPress
#创建数据库和用户 mysql -uroot -p123456 -S /data/3306/mysql.sock create database wordpress; show databases like "wordpress"; grant all on wordpress.* to wordpress@\'127.0.0.1\' identified by \'123456\'; flush privileges; show grants for wordpress@\'127.0.0.1\'; select user,host from mysql.user; quit #修改nginx配置文件 cd /application/nginx/ mkdir conf/extra vim conf/extra/blog.conf server{ listen 80; server_name blog.peterwang.org; root html/blog; index index.php index.html index.htm; location / { if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } } location ~ .*\\.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } } vim conf/nginx.conf ... include extra/blog.conf; ... mkdir html/blog chown -R nginx.nginx html/blog/ sbin/nginx -t sbin/nginx -s reload #安装WordPress cd /server/tools wget https://cn.wordpress.org/wordpress-4.8.1-zh_CN.tar.gz tar xf wordpress-4.8.1-zh_CN.tar.gz mv wordpress/* /application/nginx/html/blog/
WordPress初始化
以上是关于WordPress个人博客搭建的主要内容,如果未能解决你的问题,请参考以下文章