Modifying httpd.conf to serve over the internet in EasyPHP

余生颓废 提交于 2019-12-21 20:25:52

问题


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?


回答1:


Use this code in your 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 instead of /var/www




回答2:


I just need to add this line

Listen <your machine IP>:<your port>

e.g.

Listen 192.168.1.3:8080

and restart Apache



来源:https://stackoverflow.com/questions/7548487/modifying-httpd-conf-to-serve-over-the-internet-in-easyphp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!