LAMP as an alternative to XAMPP and WAMPP
<- Back To BlogPublished: 17/07/2013 UTC
Updated: 17/07/2013 UTC
In my opinion, the closer you get to a live environment then the fewer headaches you will get when you go to deploy. For example when developing on a case insensitivity operating system (such as Windows), it can cause all sorts of issues when deploying to a case-sensitive system (such as Unix). However, as a Web Developer, you cannot completely move to Unix based OS's because most of your websites clients will be on Windows, which means testing in IE (Internet Explorer), as well as you may need to run applications like Photoshop. Hence, I have moved away from Windows based stacks (such as XAMPP and WAMPP) in favour of a Virtual Ubuntu server, and I feel this approach gets the best of both worlds while maximizing productivity.
The main con for this is that you have to be comfortable with the Unix Command line, however once you have a basic knowledge of Unix it becomes a much better approach. This setup has saved me so much time, and it also allows you to better access things such as APC cache functions. All the main tools are available in Ubuntu, such as Xdebug, and they even work to a remote machine. You could use another full tower pc, but using VirtualBox means you can snapshot your work and setup. I also like the fact I'm not having to have another pc on draining power. I have successfully used this setup both on my desktop its self and run off my server.
The key technology I use:
- Oracle VirtualBox (on Windows)
- Ubuntu Server (in a Virtual Box)
- Netbeans (in Windows)
- Xdebug (in Ubuntu)
- smtp4dev (Windows only)
Ubuntu even makes it simple to install a LAMP stack, by providing an option in the installation wizard. Following is a brief list of things I do to maximise my productivity while using a virtualized Ubuntu server, most of them lower the security, so I can integrate it with my desktop OS. It's an abstract list for now, I intend to add more detailed instructions in future posts when or when I get time.
Brief overview of my setup
- Depending on the network, put the Virtual Box behind a ICS/NAT firewall (because I have lowered the security)
- Install LAMP, OpenSSH server and Samba file server in the Ubuntu installation
- Added packages phpMyAdmin, MariaDB (extra points!), Nano, Htop, etc.
- Share off the root of the virtual machines hard drive in Samba and map it to my W: drive. This can be a little slow for Netbeans to index large/complex sites. See the hints below.
- Install xdebug, and basically edited the apache php.ini version and add the typical Xdebug but also set/enable xdebug.remote_enable, xdebug.remote_host and xdebug.remote_port. Note: There is also a separate cli version.
- (I am testing this step at the moment) Install Mail server (such as Postfix in Satellite system mode) and forward all email to your development machine.
That's basically it!
I feel it's the best of both worlds with very little down sides and lots of upsides. From what I've found, all the Linux only Web Development tools that I need run on work for the terminal. Also, most of the Windows only Web Development tools such as smtp4dev, can be also be setup to work with a remote Unix server.
Hints
- For very large sites WinScp can be setup to Sync files from Windows to a remote machine via SSH. This is particularly helpful if Netbeans is constantly scanning for external changes.
- Netbeans can be set "Path Mapping" in the "Project Properties" -> "Run Configuration" -> "Advanced". Such as "\var\www" -> "w:\" if you have not mapped the root of the Unix file system.
The opinions expressed on this website are my own and do not necessarily reflect the views of my employer. The posts on this website are provided "as is" with no warranties and confer no rights
Copyright © 2025 Jeremy Sells - See Site Terms/Disclaimer