【发布时间】:2021-07-16 15:32:00
【问题描述】:
我尝试通过这些命令在 GCE VM 中安装 apache 服务器:
sudo docker pull httpd
sudo docker run -d --name apache-server -p 86:80 httpd
sudo docker container start apache-server
但是当我尝试访问端口 http://34.138.232.98:86/ 时,我得到以下信息:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
我安装了Apache,但得到NGINX,无法理解这里到底发生了什么。
【问题讨论】:
-
是你到达的VM的IP吗?您能否详细说明您的设置以帮助我们重现相同的问题?
-
看起来您的容器中正在运行另一个 http 服务器。尝试创建一个新 VM 并仅运行命令
sudo docker pull httpd和sudo docker run -d --name apache-server -p 86:80 httpd。docker run启动容器,因此您不需要docker start它。尝试新的 VM(最好是容器优化的操作系统)。如果这是您唯一需要在 VM 上运行的东西,您始终可以直接在 VM 上安装 Apache。 -
我删除了虚拟机并再次执行相同的步骤。这次奏效了。但是找不到原因。
标签: google-cloud-platform google-compute-engine