google-cloud-platform - 如何在 GCE VM 实例中安装 Apache 服务器?
问题描述
我尝试通过以下命令在 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
,无法理解这里到底发生了什么。
解决方案
看起来您的容器中正在运行另一个阻止端口的 http 服务器。
尝试创建一个新的 VM 并仅运行命令sudo docker pull httpd
& sudo docker run -d --name apache-server -p 86:80 httpd
。
docker run
启动容器,因此您不需要 docker start 它。
尝试新的 VM(最好是容器优化的操作系统)。如果这是您唯一需要在其上运行sudo apt install apache2 -y
并允许使用sudo ufw allow 'WWW'
.
还要确保您的GPS 防火墙允许进出流量。
推荐阅读
- macos - setenv 出错:MATLAB 上的 startup.m 文件“不存在或不可读”
- vue-router - 如何使用“this.$router.push()”传递道具对象
- reactjs - react-mathjax 渲染两次。我该如何解决?
- c - 在switch语句之前输入字符串并使用switch语句比较c中的字符串
- vue.js - 当我动态添加选择框时,如何使 select2 在 vue js 中可用?
- django-channels - 如何摆脱“僵尸”频道
- mongodb - 有没有办法使用 MongoDB Realm 离线验证 android 应用程序?
- github - GitHub - 获取一个月内评论或提交任何内容的用户
- cmake - 将 g++ 开关转换为 CMAKE 的问题
- android-dialer - Android自定义拨号器 - 未接来电的实现缺失?