XAMPP is a software package that used by programmer/software developer generally. Inside of the XAMPP there are several tools like apache, mySql, PHP for development necessary. We know, this is one of popular software tool for development needs, because it is so user friendly to use and compatible with any operation system.
Recently, this software has a new model version is XAMPP-VM (Virtual Machine). It released devoted for Mac OS (Mojave), because the general version has not compatible yet. You can visit this link, if you are interested to learn more about the XAMPP-VM version.
Talking about XAMPP-VM, we know it has a little difference display and the software's installation is also same to the other version. For more details we can see in figure below.
|XAMPP-VM Screen Display|
Basically, we can use IP virtually machine that provide by XAMPP-VM as default, and the htdocs folder was hidden before set mounting inside it. Because the XAMPP-VM still not too familiar to any developer. Many people as developer are asking about how to access localhost in another device in XAMPP-VM in Mac OS (specially Mojave) in various forum session. Based on many cases about share access localhost using XAMPP-VM have a different way in configuration compared of XAMPP general version. Therefore, on this article we are going to give you out about how to make a configuration the XAMPP-VM that can be accessed in other devices.
STEP - 1 : Set a New Port in XAMPP-VM
First step you should to do is creating a new port in XAMPP-VM, and notes your macbook IP address (e.g. 192.168.x.xx), then make sure your macbook and the other device have a same network connectivity.
After that, you can create a new port with click the "add" button and change "remotePort" to 81 (81 just optional, you also can use 82, 83, ect), for more detail please see in figure below:
|Add a new port|
Click "OK" button for adding a new port and then select the new port and enable it.
STEP - 2 : Edit httpd.conf File
If you had created a new port, the next one open your xampp folder in Finder and please go to 192.168.64.2 (xampp vm folder) > lampp > etc > open httpd.conf (via edit text).
Scroll down untill you find text like this:
Next, please duplicate in the bottom of the first text then change "18.104.22.168" to your macbook IP address that you had noted and change "80" to "81" is a remotePort that had you added before.
Don't forget to save file before close the file
STEP - 3 : Edit httpd-xampp.conf
The third, open folder etc > extra > open file httpd-xampp.conf, then make sure the Directory text as follows:
Save your file if you make a change.
STEP - 4 : Access Your Localhost in Other Device
Finally, you can access the localhost in the other device with using your macbook IP address:8080/your-application-in-htdocs.
|Try to access in other device|
That's all of simple steps how to configuration XAMPP-VM so that can be accessed in other device. We always open for question and feedback. Thank you!
How to Access Localhost (XAMPP VM) from Another Device in Mac OS
4/ 5Oleh Arian