Wordpress 错误:找不到版本11(PostgreSQL 11)和x2B的pg#U ctl可执行文件;让';s加密
我有一个VPS主机和一个域名重定向到它。 我有我的主要网站使用WordPress CMS灯堆栈。 另外,我在子域中使用Odoo作为python和PostgreSQL的后端 一切正常直到我安装了Certbot,让我们按照这些教程进行加密以获得SSL证书 对于我的Wordpress,我安装了以下插件: 这让我陷入了一个循环,因为它强制了https,我稍后会解释它 因此,当插件不起作用时,我通过以下教程为整个VPS寻找了另一种方法: 在完成Ubuntu18.04的第二个教程后,我注意到我所有的域流量都将转到https,它陷入了一个循环,与我上面所说的一样 “ERR_TOO_MANY_重定向,这意味着站点重定向次数过多” 无法访问doamin中wordpress的网站前端 然后当我申请的时候 “步骤3-允许HTTPS通过防火墙” 我的internet连接被解释了,当我回到ssh会话时,我发现自己被服务器锁定了,没有找到任何方法返回 当我厌倦了使用子域上有Odoo的时候,我也得到了同样的错误 “ERR_TOO_MANY_重定向,这意味着站点重定向次数过多” 在这里之前,我没有希望,也不知道该怎么办 我联系了我的VPS服务器提供商,并告诉他具体发生了什么。然后他告诉我他是如何通过一个指向终端的URL让我再次进入服务器的,我仍然无法使用putty之类的ssh客户端访问服务器。。因此,当我进入服务器后,他向我提供了URL,我注意到的第一件事是,他“重新启动VPS”将在一秒钟内达到这一点 因此,我做的第一件事就是删除wordpress插件“WP Encryption”,并更新mysql数据库中WP_选项表中的wordpress站点url,因为该插件将其从http更改为https,所以我将其更改回去,从而解决了我的wordpress网站的错误重定向问题 然后我做的第二件事是禁用我在上面步骤3的教程中启用的ufw防火墙 我立即使用ssh客户端putty恢复了与服务器的连接,但我再次注意到postgres服务处于非活动状态,并且随着VPS的重新启动而停止。我试图启动服务,但它没有给我这个错误Wordpress 错误:找不到版本11(PostgreSQL 11)和x2B的pg#U ctl可执行文件;让';s加密,wordpress,postgresql,ubuntu,ssl,odoo,Wordpress,Postgresql,Ubuntu,Ssl,Odoo,我有一个VPS主机和一个域名重定向到它。 我有我的主要网站使用WordPress CMS灯堆栈。 另外,我在子域中使用Odoo作为python和PostgreSQL的后端 一切正常直到我安装了Certbot,让我们按照这些教程进行加密以获得SSL证书 对于我的Wordpress,我安装了以下插件: 这让我陷入了一个循环,因为它强制了https,我稍后会解释它 因此,当插件不起作用时,我通过以下教程为整个VPS寻找了另一种方法: 在完成Ubuntu18.04的第二个教程后,我注意到我所有的域
Failed to start postgresql.service: Unit postgresql.service is masked.
我搜索了一个解决方案,并找到了这些用于解除掩码的命令
sudo systemctl unmask postgresql
sudo systemctl enable postgresql
sudo systemctl restart postgresql
然后服务启动了,当我运行status命令时,一切都正常
service postgresql status
答案是
● postgresql.service - LSB: PostgreSQL RDBMS server
Loaded: loaded (/etc/init.d/postgresql; generated)
Active: active (exited) since Thu 2020-03-26 05:54:09 UTC; 2h 22min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 2286)
Memory: 0B
CGroup: /system.slice/postgresql.service
但是,当我尝试使用odoo通过默认端口连接到postgres时,它会说:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"
经过多次搜索,我发现posgres主集群也处于非活动状态或关闭状态,我尝试使用此命令启动它
pg_ctlcluster 11 main start
zip -r main.zip main/
mv /backups/main.zip /var/lib/postgres/11/
unzip -a /var/lib/postgres/11/main.zip
但是我得到了这个错误
Job for postgresql@11-main.service failed because the service did not take the steps required by its unit configuration. See "systemctl status postgresql@11-main.service" and "journalctl -xe" for details.
● postgresql@11-main.service - PostgreSQL Cluster 11-main Loaded: loaded (/lib/systemd/system/postgresql@.service; disabled; vendor preset: enabled) Active: failed (Result: protocol) since Thu 2020-03-26 15:22:15 UTC; 14s ago Process: 18930 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 11-main start (code=exited, status=1/FAILURE)
当我按要求运行命令时
systemctl status postgresql@11-main.service
我得到这个错误
Job for postgresql@11-main.service failed because the service did not take the steps required by its unit configuration. See "systemctl status postgresql@11-main.service" and "journalctl -xe" for details.
● postgresql@11-main.service - PostgreSQL Cluster 11-main Loaded: loaded (/lib/systemd/system/postgresql@.service; disabled; vendor preset: enabled) Active: failed (Result: protocol) since Thu 2020-03-26 15:22:15 UTC; 14s ago Process: 18930 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 11-main start (code=exited, status=1/FAILURE)
独自
systemd[1]: Starting PostgreSQL Cluster 11-main...
postgresql@11-main[18930]: Error: Could not find pg_ctl executable for version 11
systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or
systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
systemd[1]: Failed to start PostgreSQL Cluster 11-main.
我猜Let's Encrypt在pg_hba.conf和postgres.conf中添加了一个ssl配置,就像apache中的id一样,所以我搜索了它们并注释了“ssl on”行,然后与主集群一起重新启动了postgres服务,但仍然没有发生相同的错误
Error: Could not find pg_ctl executable for version 11
我知道我不应该直接在Ubuntu/Debian下运行pg_ctl。我必须改用pg_ctlcluster,它是由postgresql common安装的。我看到了主页文档。但是当我运行“sudo pg_ctlcluster 11 main reload”命令时,我总是收到上面的错误,告诉我他找不到pg_ctl可执行文件
我已经搜索了很多关于这个问题的内容,但是没有任何结果如何解决版本11中的pg_ctl可执行文件??
附言:
我使用的是Ubuntu 19.10(GNU/Linux 5.3.0-24-generic x86_64)
Odoo 11和postgres 11作为数据库,正如我前面提到的,Odoo无法连接到postgres
编辑:
不幸的是,我无法还原或恢复服务器以修复postgres软件包,因为我对服务器的最后一次备份是在19/3,今天是26/3,这段时间我有一个重要的数据
更新日期:2020年3月27日上午4:06
我将上次服务器备份与生产服务器进行了比较,发现许多postgres文件丢失了!!像int this path/usr/lib/postgres/11/和/etc/postgres/11/我认为postgres是如何在服务器重新启动时损坏和丢失一些文件的>>>但是找到了位于/var/lib/postgres/11/中的数据库数据文件,请尝试在odoo配置文件中添加“pg_path”。 比如:pg_path=/path/to/postgresql/binaries
一般来说,“/usr/lib/posrgresql/11/bin”是二进制目录。因此,经过几个小时的挖掘,最终 所有损坏和丢失的PostgreSQL文件,我失去了修复它们的希望,我不知道是什么原因造成的,但这与服务器意外重启有关 因此,我设法在这个路径中找到了生产服务器的重要数据库信息的主集群数据文件
/var/lib/postgres/11/
我用这个命令压缩了整个文件夹,从中得到了一个备份
pg_ctlcluster 11 main start
zip -r main.zip main/
mv /backups/main.zip /var/lib/postgres/11/
unzip -a /var/lib/postgres/11/main.zip
然后,我使用这些命令对postgres进行了全面清理并重新安装
从系统中删除所有PostgreSQL。仅仅清除postgres包是不够的,因为它只是一个空的元包
删除所有PostgreSQL包后,运行:
rm -r /etc/postgresql/
rm -r /etc/postgresql-common/
rm -r /var/lib/postgresql/
userdel -r postgres
groupdel postgres
然后我用这个命令安装了postgres以匹配odoo11
sudo apt-get install postgresql libpq-dev -y
然后创建ODOO PostgreSQL用户
sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true
现在一切都好了,奥多应该可以正常工作,但你仍然没有任何数据库
因此,要从我们之前使用的群集文件夹中恢复备份,我们需要将zip文件移动到我们使用它的同一目录中
/var/lib/postgres/11/
但在此之前,你应该停止postgres服务
sudo systemctl stop postgresql
sudo systemctl start postgresql
sudo systemctl status postgresql
确保它已经停止
sudo systemctl status postgresql
然后重命名postgres现在使用的主集群,因为它是空的