Windows 7 上的本地主机

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24340450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 11:37:55  来源:igfitidea点击:

Localhost on Windows 7

windowshttplocalhost

提问by Jo Colina

I want to enable a localhost on Windows 7 to be able to build websites with Chrome without a distant server. I would like to not install anything, and be able to, for example, navigate to http://localhost/something/somethingElse/index.html.

我想在 Windows 7 上启用本地主机,以便能够在没有远程服务器的情况下使用 Chrome 构建网站。我不想安装任何东西,并且能够,例如,导航到http://localhost/something/somethingElse/index.html.

Anyone knows how?

有谁知道怎么做?

回答by Jo Colina

In order to activate localhost server on Windows 7 navigate to:

为了在 Windows 7 上激活本地主机服务器,请导航到:

-> Control Panel -> Programs and Features -> Turn Windows features on or off

Then search for Internet Information Services and check its checkbox.

然后搜索 Internet 信息服务并选中其复选框。

Wait for Windows to make the changes, no need for immediate restart, the server will be enabled.

等待 Windows 进行更改,无需立即重新启动,服务器将启用。

You can now navigate to

您现在可以导航到

127.0.0.1 

or

或者

http://localhost

回答by Sasi Varunan

There is a simple chrome extension "200 OK". Which runs a web server on localhost.

有一个简单的 chrome 扩展"200 OK"。它在本地主机上运行 Web 服务器。

  • Custom port settings
  • Choose your project folder and start the server
  • 自定义端口设置
  • 选择您的项目文件夹并启动服务器

enter image description here

在此处输入图片说明