我重启了我的 Bitnami 托管的 Amazon Lightsail 实例,现在我的网站加载了 Apache 默认页面,而不是我的网站。
简短描述
Bitnami 托管的实例有自己的 Web 服务(如 Apache 和 NGINX),它们预配置在端口 80 上的堆栈中。如果安装了 Apache2 包,则新的 Apache2 服务会在实例重启后首先启动,或者先停止再启动。此外,当您安装包(如 python-certbot-apache)时,Apache2 包可能会作为依赖项进行安装。
由于新的 Apache2 会自动启动并侦听端口 80,因此 Bitmani 提供的 Apache 无法启动并侦听该端口。由于该端口正在使用中,因此该网站会从 /var/www/html/index.html 加载默认 Apache 页面。
解决方法
要确保 Bitmani Apache 在您停止、启动或重启实例后启动,请完成下面的步骤:
-
运行以下命令来停止 Apache2 服务:
sudo systemctl stop apache2
sudo pkill -f apache
-
运行以下命令来启动 Bitnami 的 Apache 服务:
sudo /opt/bitnami/ctlscript.sh restart
-
运行以下命令,以便 Apache2 服务无法在引导时启动:
sudo systemctl disable apache2