XAMPP VM and Bitnami Modules
Mac has become a platform of choice when it comes to development. From native macOS and iOS apps to Android and Web Apps.
Today I want to take you through the installation steps of Bitnami modules on XAMPP-VM for Mac. XAMPP is a LAMP stack of choice and since June 2017, they introduced XAMPP-VM. This variant is, in fact, a Virtual Machine running Debian Linux. I’ve been using it for a while, whenever I need to pop-up quickly a website.
I will take you through the installation process and then I will show you some useful tricks using XAMPP-VM to have multiple virtual machines.
Installing XAMPP-VM
We need to head to the apache friends website: https://www.apachefriends.org/
Select XAMPP for OSX. by default XAMPP-VM will be downloaded, you can double-check the file name: xampp-osx-X.y.z-r-vm.dmg
Open the DMG file and drag and drop XAMPP into your Applications folder. Then open XAMPP, you should see a dialog: Initialising Stacks… We will come back to that later.
You XAMPP is now ready to use!
Pimp it up with Bitnami module, Wordpress
Apache Friends and Bitnami have been collaborating in order to provide easy-to-install modules, such as Wordpress, Drupal and many other PHP project.
You can browse Bitnami modules for XAMPP here: https://bitnami.com/stack/xampp
In order to install a module, you need to first access the Virtual Machine. XAMPP made that very easy, by simply clicking the Open Terminal button (make sure you have started XAMPP with Start button first).
This will prompt a Terminal connected to the Virtual Machine
Given we are running a Virtual Machine running Linux Debian, we need to select the Linux of the module you like to install. I recommend to right-click and copy the download URL.
Then head to the Terminal connected to the VM
We are going to download the module using wget
$ wget https://bitnami.com/redirect/to/876131/bitnami-wordpress-5.3.2-2-module-linux-x64-installer.run
We need to update the permission to be able to execute this file
$ chmod +x bitnami-wordpress-5.3.2–2-module-linux-x64-installer.run
And finally, we can start running the installer.
$ ./bitnami-wordpress-5.3.2–2-module-linux-x64-installer.run
We first need to select which language we want the installation. Pick the language that suits you best. Then we are prompt for the installation folder. It’s important to keep /opt/lampp
here as the module is going to use existing components such as Apache, MySQL/MariaDB. The Wordpress install can now start and we will be asked for numbers of question, related to the Admin account. Regarding the installation Type, I like to choose 2 (Production settings), but pick the one that suits you best.
We are all set, let’s install it! It will take up to a few minutes to install the Wordpress module.
Connecting to your fresh Wordpress install
Now that Wordpress is set up, it’s time to use it. Make sure you enable port redirection in XAMPP
Enter http://localhost:8080/wordpress/
and here is your homepage
Enter http://localhost:8080/wordpress/wp-login.php
to access the admin section, use the credentials set during setup.
Having multiple XAMPP projects thanks to VMs
Earlier we have seen that, when XAMPP start, it is initialising the Stacks. This actually creates the VM files into ~/.bitnami/stackman/machines/
:
It is possible to store multiple machines here and swap between them very easily by renaming them back to xampp
which is the default path.
Create a new project (and Virtual Machines)
First of all, make sure you quitted XAMPP completely. Then, head to the machine folder, via Terminal or system by using menu Go -> Go to Folder…
Now let’s rename xampp
folder to xampp-project1
. Keep the Finder window open, and open XAMPP, you should see that a new xampp
folder is created into “machine”. That is your new active project.
If you which to open the project1, you have to quit XAMPP, then rename xampp
to xampp-project2
and rename xampp-project1
to xampp
, so it becomes the active project. Start XAMPP, and your project1 is up and running!
Conclusion
In this piece, we have seen how to install Bitnami modules and how we can take advantage of Virtual Machines in order to host multiple projects on your computer.
XAMPP on Mac uses Virtual Machines with Linux Debian. You can install Bitnami modules by copying the .run
into the VM and running it, using Open Terminal from XAMPP and wget
. Virtual Machines are stored in ~/bitname/stackman/machines
the default/active machine is xampp
, so you can rename that folder and XAMPP will pop a new VM for you. You can then use that new instance for your new project.
The method explained here is for development purposes, with the rise of Docker containers and Virtual Machine, I found interesting to show how it can be easy to achieve that on a Mac. However, you could prefer to have only one VM and use VirtualHost Apache configuration, to achieve a similar result.