Jump to content

XAMPP/MAMP vs. Virtual Machine


Nico Knoll
 Share

Recommended Posts

Hey,

since I started developing for the web I used XAMPP. It's a program which comes with PHP, MySQL and a full Apache installation. It works great. But somehow I don't want to merge this with my regular PC.

Some time ago I read something about Virtual Machines. It sounds like it is possible to create a Linux Server in it and work with it like with a "real" server. Sounds clean and therefore great to me. But I have no idea how to create it. And is it still possible to use these fake "hosts"-file URLs like "processwire.dev", etc. with it?

How does your setup looks like?

And is it possible to reset a VM to a certain point?

-- Nico

Link to comment
Share on other sites

I had a nice tutorial somewhere about creating virtual hosts...can't find it now. I even did this some time back. It's all about editing your PC's host file (to serve your fake hosts) plus your appache httpd.conf, if I remember correctly...I use XAMMP with a customised start screen :-)

Edited by kongondo
Link to comment
Share on other sites

I think you probably know this already, but you can create a linux VM using one of these:

  • vmware fusion
  • parallels
  • bootcamp

I have only used fusion and only for a windows VM, but it should be straight forward to install debian or similar through one of these too.

  • Like 2
Link to comment
Share on other sites

You might want to check out Vagrant: https://processwire.com/talk/topic/5993-vagrant/

and http://www.vagrantup.com/

There are predefined server images with predefined configurations out there in the web, just search for it.

It's a bit of a learning curve, but then it's great. The actual files/folders in the Apache are symlinks to folders on your host system, so no worries if you f*ck up the VM, just reinstall with the given config, piece of cake.

Regarding your .dev domains, that's something you always manage on your host system, not the VM, so your hosts file must redirect your desired .dev domains to the IP of the VM (or you set up something like dnsmasq, where you can write wildcard rules and don't have to add every single .dev domain to the hosts file). The Apache on the VM then should handle the requests and map to the specific folders (via vhosts).

But that's all pre-configurable with Vagrant, check out https://puphpet.com/, they have a guided image creator for Vagrant.

Link to comment
Share on other sites

You might want to check out Vagrant: https://processwire.com/talk/topic/5993-vagrant/

and http://www.vagrantup.com/

There are predefined server images with predefined configurations out there in the web, just search for it.

It's a bit of a learning curve, but then it's great. The actual files/folders in the Apache are symlinks to folders on your host system, so no worries if you f*ck up the VM, just reinstall with the given config, piece of cake.

Regarding your .dev domains, that's something you always manage on your host system, not the VM, so your hosts file must redirect your desired .dev domains to the IP of the VM (or you set up something like dnsmasq, where you can write wildcard rules and don't have to add every single .dev domain to the hosts file). The Apache on the VM then should handle the requests and map to the specific folders (via vhosts).

But that's all pre-configurable with Vagrant, check out https://puphpet.com/, they have a guided image creator for Vagrant.

Will it run smoothly on older/slower machine? I have an old white macbook with archlinux installed (I use it when bored/tired working on my desktop).

Link to comment
Share on other sites

Will it run smoothly on older/slower machine? I have an old white macbook with archlinux installed (I use it when bored/tired working on my desktop).

Well it's the same with all VMs, they'll never run as performant as the host system itself.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...