If you are like me, you want a full LAMP stack on your box while developing, and don't want it to mess with your other stuff.
I am running Mac Mountain Lion 10.8.2 on a Hackintosh. These directions should apply to any host OS, including Linux Windows, and Mac. My Hackintosh is a tricky little power-beast, but you don't really need all that. Any system that can run VirtualBox and blast tunes should be A-OK.
I start drinking a gross amount of Hamms (the beer-refreshing) and set out on my noble mission.
Whatever you see in () is what I am blasting on my stereo or doing, for some context. You can safely ignore.
In all directions, replace "konsumer" with your local username.
(Combichrist - Tractor) Install Virtualbox
Download an Ubuntu Server Disk Image: takes half an hour (make a few cocktails!)
Wait. Drink. Dance around your room/office. (mixes by @Glucosemusic on soundcloud, bumped up for extra glitchy bass-madness)
Dang! It's done, finally. Contemplate the nature of data and it's real-world toll on all of our souls. Bits are tangible, yo.
(masterful digi-funk hits by DOS.putin on soundcloud) Run VirtualBox (left window open while I danced) make a new virtual-machine. It's Linux, Ubuntu 64bit. I named mine "LAMPinatro", which is how I apparently type "LAMPinator" when I am wasted. Make sure it has the recommended RAM (I gave mine 2048MB, because I already love it like the father I never had)
Right-click on "LAMPinatro" and go to settings. Under "Network" set it to "Bridged". Under "Shared Folders" add your home directory (on my hackmac: /User/konsumer) and set it to "Auto-mount" (chug a Hamms: the beer refreshing, Hamms)
Run it. It will ask for a bootdisk, choose the Ubuntu ISO image you downloaded already (mmm, cocktails....)
(Suicide Commando is so good...) Hit ENTER a bunch, enter your name, etc. I set host name to "lampinator", typed correctly this time!
Hit ENTER till it asks if you want to write to disk, choose YES, hit ENTER, like a boss.
Wait for all the pretty red progress-bars to, like blood, slowly tick away the pointlessness of your life.
Set updates to "Install security updates automatically"
In the tasksel menu, choose "OpenSSH Server, and LAMP server", TAB, ENTER.
(Velvet Acid Christ) Enter passwords for MySQL
Hit ENTER till it reboots (check facebook while banging head)
(Ramstein - Sonne) I like to use my sweet Mac transparent-background terminal (that can easily cut/paste), so I use ssh to setup initial stuff. login to your vmachine, type
ifconfig to get the IP. In my case it was
192.168.1.130. In terminal ssh:
(wumpscut - praise your fears)
sudo apt-get update && sudo apt-get install virtualbox-guest-utils phpmyadmin drush, password, ENTER, wait... autoconfigure for apache.
(Combichrist - Never Surrender)
sudo vim /etc/apache2/sites-available/vhosts, hit "I" make it like this:
I keep my files in Mac
~/Sites/ohcool/webroot, when I want them to work for http://ohcool.local. adjust the above if you don't do that.
ESC:wq Gosh!, we win!
Now, do this:
sudo adduser www-data konsumer sudo adduser www-data vboxsf sudo adduser konsumer www-data sudo adduser konsumer vboxsf
sudo a2enmod vhost_alias rewrite && sudo a2dissite default && sudo a2ensite vhosts
sudo rebootI am the prince of evil. I don't work at Dairy Queen.
192.168.1.114 test test.local
mkdir -p /media/sf_konsumer/Sites/test/webroot
echo "o cool" > /media/sf_konsumer/Sites/test/webroot/index.html
mkdir -p /media/sf_konsumer/Sites/logs
sudo service apache2 restartfor good measure. check errors. all cool?
Now, life is better, here's why:
Now, when you wanna test something, fire up your fancy-ass vmachine (takes like 2 secs, fer reals) and hit the site.local. You can SSH in and drush-up your Drupal things, if you want, and be done with that mess (corrugated piece of sh*t...)
I gotta get some sleep, with all this Hamms I been drinking.
If you are looking for explanations of the above, here goes: