Accessing localhost (xampp) from another computer over LAN network - how to?

后端 未结 24 3099
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 14:01

I have just set up a wi-fi network at home. I have all my files on my desktop computer (192.168.1.56) and want to access localhost over there from another computer (192.168.

相关标签:
24条回答
  • 2020-11-22 14:24

    This tool saved me a lot, since I have no Admin permission on my machine and already had nodejs installed. For some reason the configuration on my network does not give me access to other machines just pointing the IP on the browser.

    # Using a local.dev vhost
    $ browser-sync start --proxy
    
    # Using a local.dev vhost with PORT
    $ browser-sync start --proxy local.dev:8001
    
    # Using a localhost address
    $ browser-sync start --proxy localhost:8001
    
    # Using a localhost address in a sub-dir
    $ browser-sync start --proxy localhost:8080/site1
    

    http://www.browsersync.io/docs/command-line/

    0 讨论(0)
  • 2020-11-22 14:26

    Thanks for a detailed explanation.

    Just to Elaborate, in Windows, Go to Control Panel -> Firewall, in exceptions "add http and port 80". Then in Services check mark "http (web server port 80)" and "https (web server port 443)" ONLY if you need https to work also. Ok, OK, Close

    Then go to any computer on network and type http://computer-name (where you change the firewall and has the xampp running on it) in your web browser and happy days :)

    0 讨论(0)
  • 2020-11-22 14:26

    After ensuring you've got the appache configs set up as described in the other answers on this page, you may need to also open TCP ports through your firewall as described here:

    https://superuser.com/questions/569227/xampp-is-not-accessible-from-other-computer-through-lan-when-firewall-is-enable

    0 讨论(0)
  • 2020-11-22 14:28

    I am Fully agree With BugFinder.

    In simple Words, just put ip address 192.168.1.56 in your browser running on 192.168.1.2!

    if it does not work then there are following possible reasons for that :

    1. Network Connectivity Issue :

      • First of all Check your network Connectivity using ping 192.168.1.56 command in command prompt/terminal on 192.168.1.2 computer.
    2. Firewall Problem : Your windows firewall setting do not have allowing rule for XAMPP(apache). (Most probable problem)

      • (solution) go to advanced firewall settings and add inbound and outbound rules for Apache executable file.
    3. Apache Configuration problem. : Your apache is configured to listen only local requests.

      • (Solution) you can it by opening httpd.conf file and replace Listen 127.0.0.1:80 to Listen 80 or *Listen :80
    4. Port Conflict with other Servers(IIS etc.)

      • (Solution) Turn off apache server and then open local host in browser. if any response is obtained then turnoff that server then start Apache.

    if all above does not work then probably there is some configuration problem on your apache server.try to find it out otherwise just reinstall it and transfer all php files(htdocs) to new installation of XAMPP/WAMP.

    0 讨论(0)
  • 2020-11-22 14:31

    Sometimes your firewall can be the problem. Make sure you've disabled your antivirus firewall monitoring. It worked for me.

    0 讨论(0)
  • 2020-11-22 14:31

    If you are using XAMPP 1.8.3 Navigate to file httpd-xampp.conf and search for " # # New XAMPP security concept # server-status | server-info))">

         Require local
         ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
         </LocationMatch>
    

    "

    Cut this code and save it somewhere for later use i.e restoring this feature( remember removing this code makes your computer vulnerable). Save changes on httpd-xampp.conf, restart services on XAMPP and that's it.

    0 讨论(0)
提交回复
热议问题