Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post

    Accessing an Apache server on a nother computer on my network.

    Hey everyone.

    I have apache, MySQL and PHP installed on a windows machine at home. I have a couple of other computers on a small home network, inlcuding two macs.

    Is it possible to somehow use the IP address of the machine (running Win XP Prof) and access the dynamic files (such as PHP pages) as I would if I typed in 'http://localhost/' on the machine running the server?

    I want to test some site on the macs but cant seem to figure out how to get this all installed on OS X.

    It would also be pretty cool to use that machine as a type of web server for my home.

    Any ideas??

    Thanks a lot in advance!
    -DR.Wong

    Wheres the food at?

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,019
    Thanks
    2
    Thanked 313 Times in 305 Posts
    If the other computers can "see" the computer with the web server on it over the network, it will appear with some name (the name you gave it when you set it up.) You should be able to enter something like -

    http://thecomputername/

    You should also be able to do this from the computer with the web server on it, instead of entering localhost on it.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post
    I see.. I just tried. That works great if it is on the PC with the server but it isnt working from another computer.

    The computer is most definetly present as it hosts a printer all the computers use.
    -DR.Wong

    Wheres the food at?

  • #4
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post
    Update : It works fine from a windows PC. The Mac is giving issues.
    -DR.Wong

    Wheres the food at?

  • #5
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    I am not sure if it is the same on a Mac as it is on linux, but here is how you can do it on a Linux machine

    Note: 192.168.2.100 is the IP address of your home server and homeserver is the name that you wish to add. Please Edit as you see fit.

    As a super user, edit the following file. /etc/hosts

    192.168.2.100 homeserver

    If you wish to do the same thing, but for a Windows machine, locate the following file

    C:\WINDOWS\system32\drivers\etc\hosts

    and add the above line

    Cheers,
    Ess

  • #6
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post
    Thanks Ess.

    I cant seem to find the hosts file/option/setting on my mac... will keep looking though!

    Cheers Mate.
    -DR.Wong

    Wheres the food at?

  • #7
    Regular Coder DR.Wong's Avatar
    Join Date
    Jan 2005
    Posts
    360
    Thanks
    23
    Thanked 1 Time in 1 Post
    Solution!!

    Aha! Let all people with the same question learn from this thread :

    If you have an apache server running on a computer on your LAN (wireless or cabled) you can access that computers 'server root' through the 2nd computer's web browser (Just like visiting a webiste, only on your LAN)

    FOR WINDOWS :

    1) Open Internet Explorer
    2) In the address bar, enter the name of the computer (eg : NICKSPC), this can be found under 'computer name' if you open your system properties.
    EG : http://NICKSPC/
    3) Presto! You will be in the web directory for that computer (so long as it is turned on and visible to the network)

    FOR MAC > WINDOWS :

    If the server is running on a windows machine and you want to access it from a Mac :

    1) Open Safari
    2) In the address bar, type in the computer's IP address
    EG : http://10.0.0.1/

    3) This will take you to the server's web root.

    It seems that Macs do not identify the Windows Computer Names to well.

    Notes :

    - A quick way of finding the windows server's IP is opening CMD and typing ipconfig

    - You will not be able to edit files from the 2nd machine (as they are running from the server)

    Sweet!

    Hope this helps other in the future!

    Cheers

    -Nick
    -DR.Wong

    Wheres the food at?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •