cd /home/wwwroot
wget https://wordpress.org/latest.zip --no-check-certificate
unzip latest.zip
cp -a wordpress/. /home/wwwroot/域名
rm -rf wordpress
进入PHPmyadmin创建数据库 用户名
进入 http://域名/ 输入数据库信息安装
安装成功!
——————文件权限——————
更新插件时遇到 “要执行请求的操作,WordPress 需要访问您网页服务器的权限。 请输入您的 FTP ”
chown -R www /home/wwwroot/域名
chmod 755 -R /home/wwwroot/域名
——————实现伪静态——————
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;
}
}
加入/usr/local/nginx/conf/nginx.conf 的server段
运行 /usr/local/nginx/sbin/nginx -t 检测是否正确
正确后/root/lnmp restart 重启lnmp服务
——————安装WP-SUPER-CACHE——————
在后台添加安装wp-super-cache,并激活
参考:http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
自动转成Nginx后加入 nginx.conf 重启nginx
——————启用HTTPS——————
WordPress对SSL支持比较友好,可以设置登录和后台页面使用https:
http://codex.wordpress.org/Administration_Over_SSL
编辑wp-config.php,在/* 好了!请不要再继续编辑。请保存该文件。 */上面加入以下两句:
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
这两句的作用是wordpress用php实现重写跳转(登录和后台页面从http转到https),和输出https的登录链接.
这样就可以不用在Nginx配置80端口的server里匹配登录和后台页面跳转到443端口的server.
——————推荐插件——————
SI CAPTCHA Anti-Spam
WP-Optimize
WP Super Cache
参考:
1.为lnmp平台下WORDPRESS网站配置后台/登录页面强制HTTPS加密
https://bbs.zephyrxt.com/thread-15057-1-1.html
2.nginx 配置ssl证书(startssl免费证书)部署discuz论坛的相关过程
https://bbs.zephyrxt.com/thread-3686-1-1.html
3.Nginx上配置NameCheap免费SSL
https://bbs.zephyrxt.com/thread-3312-1-1.html
4.Nginx + https + 免费SSL证书配置指南
https://bbs.zephyrxt.com/thread-3685-1-1.html
5.申请和使用StartSSL免费https证书要点和nginx配置
https://bbs.zephyrxt.com/thread-3681-1-1.html