当我将 apache url 更改为 HTTPS 时,我遇到了问题。在更改之前,使用 http 时一切都运行正常。现在我的公司需要通过 HTTPS 使用虚拟 ip。因此,我找不到有关此问题的任何合适教程。
我正在使用 debian 9。更多详细信息如下:
/etc/apache2/status.conf
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Require local
</Location>
/etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
.....
DocumentRoot /var/www/html
Redirect "/" "https://ip_address/"
....
</VirtualHost>
我收到的错误
Failed Actions:
* Apache_monitor_0 on server1 'unknown error' (1): call=59, status=complete, exitreason='none',
last-rc-change='Wed Sep 9 17:28:19 2020', queued=0ms, exec=71ms
* pgsqld_promote_0 on server2 'unknown error' (1): call=63, status=complete, exitreason='server1 is the best candidate to promote, aborting current promotion',
last-rc-change='Wed Sep 9 16:57:25 2020', queued=0ms, exec=496ms
我尝试添加这样的资源,但没有成功
pcs resource create Apache ocf:heartbeat:apache configfile=/etc/apache2/apache2.conf statusurl="https://localhost/server-status" op monitor interval=1min --force
pcs resource create Apache ocf:heartbeat:apache configfile=/etc/apache2/apache2.conf statusurl="http://localhost/server-status" op monitor interval=1min --force
我创建了 ssl 文件并删除了 status.conf 文件
/站点可用/默认-ssl.conf
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
.....................
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Require local
</Location>
................................
</VirtualHost>