Just run the following command in your terminal. If you need to use the ip address of your mac instead of using localhost, here is an easy way to find the ip address of your mac via the command line. Alternatively, you could do this through your OSX settings but I'm not sure how to do that. How to get the ip address of your localhost on a mac. If you are not on your local network, I think you would have to register a domain name so that other DNS servers will assign the domain name to your address. I installed the real Xampp and run my local server on localhost and then just access it with the IP of my mac. Other times, you will have to also set this domain name for the server through your router settings or with the network administrator. I needed to see localhost on my android device as well (Samsung S3) as I was developing a Java Web-application. This assumes that you want to set the host name for your server to "" and this will be the hostname or "machine name" used on your local network. If you want to set or change the hostname for your server to use on your local network, you can use the following command: sudo hostnamectl set-hostname ![]() You can use the following command on the server to show your current hostname: hostnamectl Other times, you have to set local host names on the router or local resolver. Sometimes, the local resolver will honor hostnames set by the server. If the server is on your local network, you can resolve through a local resolver, usually on your router. ![]() Before you log in, you are resolving through whatever your mac uses to resolve (possibly a hosts file, I'm not familiar with that aspect of OSX). You will need to enter your administrator password to change the ports to these more standard ports, but after that is done, you can reach the content directly via localhost.Your mac doesn't resolve your remote server's /etc/hosts unless you are already signed into the server using ssh.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |