[英]How to run a project running on wamp/xampp server using system's IP address in place of localhost?
Actually I'm making a web project using Wamp server, and to run the same I access it using the usual local-host address, as we do while building a project on our PC. 实际上,我正在使用Wamp服务器制作一个Web项目,并且要运行相同的项目,所以我会使用通常的本地主机地址访问它,就像在PC上构建项目时一样。 But to share my project with my friends, I want to make access using the IP address of my computer. 但是要与朋友共享我的项目,我想使用计算机的IP地址进行访问。 But when I make such an access it is not able to connect, which is not the case with my friend's project. 但是,当我进行这样的访问时,它无法连接,而我朋友的项目则不是这种情况。
After I failed accessing using the Wamp Server, I installed Xamp Server, the project can be accessed using local host with both the servers (running one at a time) but not when accessed using my PC's IP address (which I find using http://www.whatismyip.com/ ) 使用Wamp Server访问失败后,我安装了Xamp Server,可以在两台服务器上同时使用本地主机访问该项目(一次运行一个),但使用PC的IP地址(使用http:/可以访问)无法访问该项目。 /www.whatismyip.com/ )
Please Help me Sort out the problem, so that I can share my project with my friends and get a feedback from them. 请帮助我解决问题,以便我可以与朋友分享我的项目并从他们那里得到反馈。
First check the Listen
directive in apache's configuration file (usually httpd.conf
). 首先检查apache的配置文件(通常是httpd.conf
)中的Listen
指令。 If it only listens on 127.0.0.1
then it can not be accessed on your network interface. 如果仅侦听127.0.0.1
,则无法在您的网络接口上对其进行访问。
You can also check it with: 您也可以使用以下方法进行检查:
netstat -na
You should see that port 80
is litening on all interfaces as somthing like: 您应该看到端口80
在所有接口上都亮起,如下所示:
Proto Local Address Foreign Address State
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
If this is the case then you should check the access to your port 80 from the outside world. 如果是这种情况,那么您应该检查外界对80端口的访问。 First of all firewalls can block the access to it. 首先,防火墙可以阻止对其的访问。 If you are behind a NAT (router) then you should use it's port forwading settings to open port 80 (or other arbitrary port) on the router an forward it to the port 80 on your PC. 如果您在NAT(路由器)后面,则应使用其端口填充设置打开路由器上的端口80(或其他任意端口),然后将其转发到PC上的端口80。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.