dongtiao2066
2018-06-12 15:54
采纳率: 0%
浏览 101
已采纳

我如何知道在Nginx上设置了什么服务器名称或Web地址

I am trying to setup LEMP (Linux, Nginx, MySQL, PHP) stack on my PC to use with Wordpress. I follow the instructions on this website. I see that the folder of wordpress in www folder was successfully extracted.

I can also verify that Nginx is running. However, I don't know how to get the wordpress index.php page on the browser.

enter image description here

On windows, I simply go to the browser and type localhost/webprojectfoldername or 127.0.0.1/webprojectfoldername

However, when I try to access the index.php of wordpress via localhost, I get the Apache page.

enter image description here

I would like to use Nginx as server but not Apache. I guess at this point, I don't know what servername or ipaddress to put on the browser to get to Nginx's page or Wordpress's index.php

I don't know how to identify the servername that was setup. On Windows, I simply use localhost or 127.0.0.1.

Any thoughts on how I identify it on Ubuntu?

I'd appreciate any help.

Thank you.

*** EDIT (Added Screenshot of Nginx configuration) ****

enter image description here

图片转代码服务由CSDN问答提供 功能建议

我正在尝试在我的PC上设置LEMP(Linux,Nginx,MySQL,PHP)堆栈以与Wordpress一起使用。 我按照这个网站。 我看到 www 文件夹中的wordpress文件夹已成功提取。

我还可以验证 Nginx 是否正在运行。 但是,我不知道如何在浏览器上获取wordpress index.php页面。

在Windows上,我只需转到浏览器并输入 localhost / webprojectfoldername 127.0.0.1/webprojectfoldername

但是,当我尝试访问wordpress的 index.php localhost ,我得到了Apache页面。

I 想使用 Nginx 作为服务器,而不是 Apache 。 我想在这一点上,我不知道将 servername ipaddress 放在浏览器上以访问 Nginx 的页面或< code> Wordpress index.php

我不知道如何识别已设置的服务器名称。 在Windows上,我只使用 localhost 127.0.0.1

有关如何在Ubuntu上识别它的想法?

我很感激任何帮助。

谢谢。

***编辑(添加了Nginx配置的屏幕截图)****

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dqtm8504 2018-06-12 15:59
    已采纳

    Either:

    nginx is listening on a different port

    By default, HTTP works over port 80, but when you connect to that port you are reaching Apache.

    You need to find the port nginx is listening on (from the article you link to: listen 80 default_server; shows 80 but lets say it was 81) and connect to that instead: http://localhost:81/`

    nginx and apache are trying to listen on the same port and apache won

    You need to turn off Apache (and possibly restart nginx).

    点赞 打赏 评论

相关推荐 更多相似问题