Give all computers in a network to access localhost

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thew
    New Member
    • Aug 2010
    • 69

    Give all computers in a network to access localhost

    Hi

    I just installed apache on my computer (with easyphp).
    It works fine. But now i have a question.

    I have at my house an network (just a normal house network, where all computers are connected to, so they all can acces the internet).
    Is it possible that all my computers can get acces to the localhost here on my computer?
  • Niheel
    Recognized Expert Moderator Top Contributor
    • Jul 2005
    • 2432

    #2
    You could setup the the dev environment in a VM. Then assign that VM it's own IP on the network. Every machine then has the following in the HOSTS file.

    192.168.1.XXX devdomain.com

    So everytime you access devdomain.com it will access the VM.
    niheel @ bytes

    Comment

    • Thew
      New Member
      • Aug 2010
      • 69

      #3
      Iam sorry, please explain it better, i am new to this =)

      Comment

      • Oralloy
        Recognized Expert Contributor
        • Jun 2010
        • 988

        #4
        @Thew,

        There are a few possibilites on how to go about it. It depends on how your home network is set up.

        If your local router is also providing DHCP and DNS services, then you can probably access the local computers by their existing names.

        If not, then you need to know your server's IP address.

        Windows:
        IPCONFIG /SHOW /ALL

        Linux
        ifconfig

        You should see a system address - it'll probably look life four small integers separated by dots. Typically it'll start with 192.168 but it is not guaranteed to be so.

        Let's assume you see 192.168.0.4 as your address.

        If you don't have DNS locally, you're going to have to use the addresses or enter names in the hosts file.

        Typically your URLs will look something like:

        The problem with DNS is that it dynamically allocates addresses. If you leave a computer off for some period of time, the address is returned to the pool, and your computer may get a different address next time you turn it on.

        So, if you put names and addresses in your hosts files, be aware that they may become obsolete.

        Now that you're completely confused, think about it, look up DNS and read a little bit, and then we'll help you sort things out.

        Comment

        • Thew
          New Member
          • Aug 2010
          • 69

          #5
          @oralloy i've tried it (with local DNS), but when i checked the URL:

          http://192.168.0.1/service/index.php,

          I came up with a popup login. Is that normal? Or not?

          Comment

          • Thew
            New Member
            • Aug 2010
            • 69

            #6
            Anyone? Please?

            Comment

            • Oralloy
              Recognized Expert Contributor
              • Jun 2010
              • 988

              #7
              @Thew,

              Sorry for the long delay. I'm on the Amerikan Left Coast, so my hours are a little skewed from most Bytes usesr. It's 6:00 and I just got into work.

              Is the pop-up prompting for login, or something else?

              If you can give us the specifics of the pop-up, that'll help.

              Comment

              • Thew
                New Member
                • Aug 2010
                • 69

                #8
                @oralloy

                Yes, its a popup login, where it asks for a username and a password, to let me connect to 192.168.0.1?

                Comment

                • Oralloy
                  Recognized Expert Contributor
                  • Jun 2010
                  • 988

                  #9
                  Exactly.

                  Are you certain that 192.168.0.1 is the IP address of your server, and not the router?

                  Remember that the IP address should be the IP of the computer running easyphp.

                  BTW, I have about two hours, then I'm gone for the weekend. Hopefully we can get this done by then. If not, you many need to start a new thread to get some of the other folks to help finish things off.

                  Luck!

                  Comment

                  • Oralloy
                    Recognized Expert Contributor
                    • Jun 2010
                    • 988

                    #10
                    Oh, I had another thought, too. Is your Web server only serving to port 127.0.0.1, or is it serving to the computer's address, as well.

                    This is important, because if it's not serving to your computer's external address, none of your other systems will be able to access the easyphp server.

                    Comment

                    • Thew
                      New Member
                      • Aug 2010
                      • 69

                      #11
                      That was just the problem, so i think this will be inpossible. But thanks for helping, too bad it wasnt usefull.

                      Comment

                      • Oralloy
                        Recognized Expert Contributor
                        • Jun 2010
                        • 988

                        #12
                        @Thew,

                        Don't give up yet.

                        Do you know the IP address of the server running easyphp?

                        If it's a windows machine, you can pop a DOS box and run the command
                        Code:
                        ipconfig /all
                        to see your IP address. Look in the output, there should be a line "IP Address". Don't just look at the numbers.

                        Then you can run
                        Code:
                        netstat -a
                        to see all the ports your computer is "listening" on.

                        If the port shows as your computer name (or some variation thereof), you're good.

                        If the port shows listening on 127.0.0.1, then it's localhost only.

                        Luck!

                        Comment

                        • Thew
                          New Member
                          • Aug 2010
                          • 69

                          #13
                          Hey

                          When i do ipconfig /all, it returns at IP-Adress:

                          192.168.0.1 and at netstat -a it returns a list with

                          <myaccountname> :<some port numbers>
                          <myaccountname> :<some port numbers>
                          <myaccountname> :<some port numbers>
                          <myaccountname> :<some port numbers>
                          <myaccountname> :<some port numbers>
                          <myaccountname> :<some port numbers>
                          ...

                          What can i do with this data to make it happen?

                          Comment

                          • Oralloy
                            Recognized Expert Contributor
                            • Jun 2010
                            • 988

                            #14
                            Is your account name the same as your computer name?

                            What does it say next to ports 80 and 443?

                            Comment

                            • Oralloy
                              Recognized Expert Contributor
                              • Jun 2010
                              • 988

                              #15
                              Still, it seems like your web server is running on the external IP address, and not just on the loopback address (127.0.0.1).

                              Next, try accessing your own server by using a browser on the same computer:

                              Code:
                              HTTP://##.##.##.##/the-rest-here
                              Hopefully it'll connect locally from the same computer.

                              Comment

                              Working...