![]() ![]() Tested using XAMPP 1.7.2a for Mac and Snow Leopard 10.6. Check here for ways to assign a computer a static IP address. Īs the iMac’s IP address is hard-coded in the MacBook’s /etc/hosts file it’s important to ensure that the iMac is always assigned the same IP address on the network. This way, when it’s connected I can point my browser to and when not connected I can use. I can of course delete macbook.mysite1 now if I wish, but I find it’s convenient to keep both, particularly as the MacBook may not always be connected to my network. Is there any way to make them accessible from anywhere I mean, if i want to access my localhost (assuming it is running) from another place, is it possible Note: I have static IP from my ISP and I can also port forward if needed. This is a configuration item and to avoid exposing a potentially unsecure server many server programs come preconfigured to. Hi there, i am using mamp pro to host websites locally on my M1 Mac. If not, I’ll be unable to access the virtual host and it will default to localhost on the iMac. If you can access a server running on your own machine via 127.0.0.1 (or localhost) but not via the computers ip address, this means that the server software is configured to listen on the localhost interface only. If you are upgrading from MAMP Free and have used multiple subdirectories under C:MAMPhtdocs to create multiple hosts, you will need to check the index checkbox to see the directory structure of C:MAMPhtdocs. The only difference from the previous example is that the name ( imac.mysite1) must be the same as that configured on the iMac. Click the Open button located to the right of the Host Name text box to open localhost in a web browser. The IP address of the iMac on my network is 192.168.1.10, so to access the default localhost on the iMac from the MacBook I simply add the following to the MacBook’s /etc/hosts file: REMOTEADDR represents the IP the request came from. ![]() For now we’re only interested in the default localhost. Its ::1 because thats the IPv6 loopback address, equivalent of 127.0.0.1, and the remote address is yourself as MAMP is running locally, the remote browser is on the same machine. The /etc/hosts file on the MacBook is almost identical apart from the virtual hosts entry which is: # localhost is used to configure the loopback interface The /etc/hosts file on the iMac looks like this: I have an iMac and a MacBook both of which have local server environments. However, it is possible to have any computer on a local network serve pages that are stored on another computer on that same network. ![]() No big deal really as I currently use ChronoSync to synchronise my site’s folder structure across computers. This means that if I have a local site on computer A that I wish to access on computer B I have to replicate that site’s entire folder structure on computer B and on all other computers I want to access the site from. As it stands, the local server on each computer can only serve pages stored on that machine. I have several computers on my local network each with a local server environment provided by XAMPP. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |