简体   繁体   English

如何使用系统的IP地址代替本地主机来运行在wamp / xampp服务器上运行的项目?

[英]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.

相关问题 WAMP Server:项目未在本地主机上运行 - WAMP Server :Project not running on localhost WAMP 服务器从 ip 地址重定向到 localhost - WAMP Server redirects to localhost from ip address 在URL中使用IP地址而不是localhost时如何解决WAMP页面访问 - How to fix WAMP page access when using IP Address instead of localhost in the URL 如何修复本地主机拒绝在Windows 10 Wamp服务器和Xampp上连接? - How to fix localhost refused to connect on Windows 10 Wamp server and Xampp? 如何导航出我的php localhost服务器项目(wamp服务器)? - How to navigate out of my php localhost server project (wamp server)? 如何将 IP 地址:端口号与 wamp 服务器上的某个域名绑定 - How to bind IP Address:Port No with some domain name on wamp server 在不写入IP地址的情况下连接WAMP服务器 - Connecting WAMP server without writing IP address node Socket.io链接如何在服务器中提供not localhost(wamp / xampp) - node Socket.io links how will give in server not localhost(wamp/xampp) 如何在本地 IP 地址上运行 Laravel 项目? - How to run Laravel project on local IP address? 如何在xampp或wamp服务器的localhost中配置facebook api? 使用它的php.ini设置要求是什么? - how to configure facebook api in localhost in xampp or wamp server? what is php.ini settings requirement to use it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM