如题,在探索与使用阿里云ECS中遇到一个这样的情况—我安装了ngix,但通过访问我的ECS实例(ip:80),然后看到了这个页面
擦…就简单的几个命令而于,我只是安装与启动了nginx而于呀,怎么会看到apache呢?奇了个怪!!
理论上应该是看到类似这个页面吧!
然后我就去尝试检测apache有没有安装
[ecs-user@iZwz90ce5ckf4fo6tkjoxmZ testpage]$ rpm -q httpd
package httpd is not installed
没有安装,那就看下80端口,被谁监听/占用了
[ecs-user@iZwz90ce5ckf4fo6tkjoxmZ ~]$ sudo netstat -tulnp | grep :80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 17429/nginx: master
tcp6 0 0 :::80 :::* LISTEN 17429/nginx: master
holy,shit,那只能说是默认页的问题了!好吧,去看下它的默认配置
看下nginx的默认配置都有什么内容
再去html目录看一下
最终的页面是/usr/share/testpage/index (这个就是真相)
[ecs-user@iZwz90ce5ckf4fo6tkjoxmZ testpage]$ cat -n index.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>HTTP Server Test Page</title>
5 <style>
6 body {
7 width: 35em;
8 margin: 0 auto;
9 font-family: Tahoma, Verdana, Arial, sans-serif;
10 }
11 </style>
12 </head>
13 <body>
14 <h1>Welcome to HTTP Server Test Page!</h1>
15 <p>If you see this page, the httpd web server is successfully installed and
16 working. Further configuration is required.</p>
17
18 <p><em>Thank you for using apache httpd.</em></p>
19 </body>
20 </html>
即/usr/share/nginx/html/index.html被软链到了 /usr/share/testpage/index.html !!