windows 修改 httpd.conf 以在 EasyPHP 中通过 Internet 提供服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7548487/
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-15 18:09:00  来源:igfitidea点击:

Modifying httpd.conf to serve over the internet in EasyPHP

windowsapacheeasyphp

提问by Matt Montag

I'm running EasyPHP on Windows. The default install just opens port 80 on the loopback interface, 127.0.0.1. I want my sites to be accessible over the local network too. There are no simple EasyPHP settings for enabling my other interface, like the one that's connected to the internet (let's say 192.168.1.3). What do I add/modify in Apache httpd.conf?

我在 Windows 上运行 EasyPHP。默认安装仅在环回接口 127.0.0.1 上打开端口 80。我希望我的网站也可以通过本地网络访问。没有简单的 EasyPHP 设置来启用我的其他界面,比如连接到互联网的界面(比如 192.168.1.3)。我在 Apache httpd.conf 中添加/修改什么?

回答by Book Of Zeus

Use this code in your httpd.conf

在您的 httpd.conf 中使用此代码

ServerName localdomain

# env
SetEnv TMP "/tmp"
ServerAdmin admin@devserver
DocumentRoot "/var/www"

#NameVirtualHost *:80
#Listen 80

##################################################################
# default
<VirtualHost *:80>
  DocumentRoot "/var/www"
  ServerName localhost
</VirtualHost>

<VirtualHost *:80>
  DocumentRoot "/var/www"
  ServerName www.localdomain.com
</VirtualHost>

** I just realize EasyPHP is for windows. You might use c:/path/to/www insteadof /var/www

** 我刚刚意识到 EasyPHP 适用于 Windows。您可以使用c:/path/to/www instead/var/www

回答by Nam G VU

I just need to add this line

我只需要添加这一行

Listen <your machine IP>:<your port>

e.g.

例如

Listen 192.168.1.3:8080

and restart Apache

并重新启动 Apache