今天wordpress系统升级之后,想顺带把网站固定链接和伪静态的问题也解决了。我用的是lnmp一键安装包,于是lnmp vhost del, lnmp vhost add重新添加域名顺带allow rewrite为wordpress。
然后出了个什么问题呢?先是显示chmod .user.ini文件Operation not permitted。解决方法是先chattr -i {你的文件目录},然后再chmod -R 777 给这个目录权限。lnmp每次重新添加vhost的时候都要重新chattr -i,再chmod -R 777 赋权一次。
!OK这个问题解决了。又来了两个问题:
- 我重新添加vhost的时候顺带重新添加了数据库,然后连接数据库失败了。
- Creat ssl certificate失败。
这时候,网站打不开,直接无法访问。改成http之后,会显示数据库出错。网页后缀/wp-admin尝试进入wordpress后台时显示数据库出错,让我检查wp-config.php文件。
于是检查wp-config.php文件,发现:
噢!原来是:我其实一直就有这个数据库,这是肯定的。但我新添加的数据库配置文件,密码错了。这个密码无法让我登录我的网站的这个mysql数据库。我忘了我原来数据库的密码是啥了。于是我试了几次,试出了正确密码,然后在wp-config.php文件里改掉了"DB_PASSWORD"这一行里后面的一串。问题1解决。
这时候,http协议下可以访问网站但显示不安全。https下无法访问。看来还剩下证书问题。我有证书,我不用Let's Encryt,我用我自己的。于是我改成手动添加自己的证书。locate了一番我的证书在哪后,lnmp ssl add,选择1使用自己的证书和密钥,输入证书文件的完整目录,添加成功。问题2解决。
小水站又折腾好了。耶!
I was excited to uncover this page. I wanted to thank you for your time for this particularly fantastic read!! I definitely loved every little bit of it and I have you saved as a favorite to look at new stuff on your blog.} {visit the following web site|visit the following site|visit the following web site|Visit Homepage|visit the following web site|visit my webpage|visit the following internet site|visit the following webpage|visit the following site|visit the following internet site
You are sso interesting! I ddo not think I’ve read thrrough something like this before.
So gokod to discover somebdy wth a feww uniqwue thougts onn this topic.
Really.. many thanks for starting thjs up. Thiis site is one thing that’s needsed oon the web,
someonme with a bbit of originality!
Qality articxles is the main to imvite the users to paay a visit
the website, that’s wwhat thgis web page is providing.