【发布时间】:2015-03-30 13:38:13
【问题描述】:
我在 CentOS7 上安装了 Nginx,当我访问 localhost 或 localhost:80 时会显示 Nginx 欢迎页面。但是,当我重新启动系统并且在运行 Nginx 之前,此页面也可用。为什么会这样?
运行 nginx 之前:
ps -e | grep nginx
什么都不显示。
ps -ef | grep nginx
显示:
username 4022 3642 0 23:28 pts/0 00:00:00 grep --color=auto nginx
我认为这表明我正在使用 grep 命令。所以现在 Nginx 根本没有运行。我对吗?但是现在如果我访问 localhost 页面,就会显示欢迎页面。
运行nginx后,使用命令#nginx:
ps -e | grep nginx
显示:
4159 ? 00:00:00 nginx
4161 ? 00:00:00 nginx
ps -ef | grep nginx
显示:
root 4159 1 0 23:31 ? 00:00:00 nginx: master process nginx
nginx 4161 4159 0 23:31 ? 00:00:00 nginx: worker process
root 4181 4113 0 23:32 pts/0 00:00:00 grep --color=auto nginx
我试图搜索但没有找到任何相关内容。我对 linux 和 nginx 还很陌生,我什至无法为这个问题说出正确的关键字。请问有人可以回答这个吗?或者告诉我应该研究哪个方向。谢谢!
附:有关此服务器的更多信息: 1.我正在学习服务器编程,为我的iOS游戏提供一个简单的服务器。计划是在 Centos 7 上使用 python 和 MariaDB,Nginx,并使用 HTTP 连接。 2. Nginx已经按照这个页面一步步安装好了:http://nginx.org/en/linux_packages.html我刚发现nginx.com好像是真正的官方网站。我是不是用错了rpm?
【问题讨论】:
-
您确定您在浏览器中看到的不只是缓存页面吗?
-
你在系统中运行服务器(localhost 在 80 端口),有什么问题?
-
@RobbyCornelissen 我再次检查,它是缓存页面!非常感谢!这是一个愚蠢的问题:p 你能说出你的答案,这样也许它会帮助像我这样的许多新手。
-
@RobbyCornelissen BTW,这条结果“root 4181 4113 0 23:32 pts/0 00:00:00 grep --color=auto nginx”是否表明使用了我的 grep 命令?
-
@ArtS 是的,这是你的 grep 命令。