使用nginx
使用上了大名鼎鼎的nginx,配置wordpress后,静态链接会失效,nginx和apache的重定向配置不同。配置文件如下:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name arthurcode.com www.arthurcode.com;
root /foo/bar/arthurcode;
index index.php index.html;
location ~* \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}
location / {
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php$is_args$args;
}
}
wordpress 手动更新
- 备份 WordPress 网站文件及数据库;(用phpadmin导出的sql文件是可编辑的,部分不能导入的SQL语句可删除)。
- 下载最新版的 WordPress,切记进入WordPress 官网下载 zip 程序包,并用md5校验。
wp-content
文件夹和wp-config.php
文件替换最新版本中对应wp-content和wp-config.php。- 最后,在浏览器中访问
http://www.domain_name.com/wp-admin/upgrade.php
- 中国区会出现很多327 too many request 错误。根据观察可能是太多的重定向导致。
本来以为wp这么流行的系统不会碰到很多问题,实际上并非如此。。加了cache系统速度也没太快,可能是优化不够到位。严重怀疑wordpress各种xhr请求影响了速度。。
有点想去折腾简单的静态页面。(我这性格也不想暂时放弃,这浪费时间的问题下次靠脚本来解决问题。