forget mamp and wamp, use virtual box to have a real ubuntu server
TRANSCRIPT
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Forget MAMP and WAMP, Use Virtual Box to Have a Real
Ubuntu Server
DrupalCamp Wisconsin
July 23rd 2010
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Ingredients
Virtualbox
Ubuntu Server 9.10
Drubuntu
LAMP
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Why VirtualBox?
Advantages:
Cross-platform
Large user-base / documentation
You are using the real deal!
Difficulty
Networking
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Why Drubuntu?
Takes care of LAMP package installation
Community supported
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Cooking time
Downloading and installing VirtualBox (30 minutes)
Downloading and installing Ubuntu (60 minutes)
Configuring LAMP (60 minutes)
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Installing Ubuntu Server
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Installing Ubuntu Server
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Bridged vs. NAT
NAT hides behind the IP address of the VM host
Bridged creates its own virtual network interface
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Connecting to Your VM
Add SSH to your ubuntu vm “apt-get install ssh”
If you are using bridged adapter type “ifconfig” to find your host ip address
ssh to your devm using that ip address (using putty in windows)
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Port Forwarding
If you are using NAT adapter in Windows you must use port forwarding to connect through ssh
For instructions google “ssh port forwarding virtualbox”
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Package management in Ubuntu
Using apt or aptitude
To get updates type “apt-get update” and “apt-get upgrade”
To install new packages type “apt-get” package-name
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Installing Drubuntu
See http://drupal.org/project/drubuntu
Copy and Paste “wget 'http://drupalcode.org/viewvc/drupal/contributions/modules/drubuntu/drubuntu-bootstrap.sh?view=co' -Odrubuntu-bootstrap.sh ; cat drubuntu-bootstrap.sh ; read -n1 -p "Run above script? (y/n)" ; bash drubuntu-
bootstrap.sh”
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Managing Your LAMP
Webroot is /var/www
Apache settings /etc/apache
To access mysql type “mysql”
Hosts file /etc/hosts
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Installing Drupal on Your VM
Go to webroot “cd /var/www”
Make sure you have ownership of webroot (root does by default)
“sudo chown username:username /var/www
“drush dl drupal”
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Adding a database
“mysql -e” from the command line
'mysql -e “creat database NAME”'
“create user 'USERNAME'@'localhost' identified by PASSWORD”
“grant all privileges on *.* to 'USERNAME'@'localhost'”
Or use phpmyadmin
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Add Virtual Host
Should be able to start off with http://vboxipaddress/folder
Virtual hosts allow you to user internal site names (ie mysite.local)
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Add a Virtual Host cont.
“cd /etc/apache/sites-available”
“cp default myhostname”
Update vhost file with internal hostname
“a2ensite myhostname”
change hosts file in host OS
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
What Does Drubuntu Do?
LAMP Packages:
curl php5-curl php5-xdebug php5-gd php-apc php5-mcrypt php5-dev php-pear libmagic-dev dnsmasq
cvs subversion svn-load git-core bzr meld mysql-query-browser mysql-admin phpmyadmin ghex siege gworldclock konqueror wine cabextract opera google-chrome-beta
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Running Headless
Turn on:
VBoxManage startvm VMNAME -type headless
Turn off:
VboxManage controlvm NMNAME poweroff
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Using NAT with Host-only adapter
Add network interface in ubuntu
/etc/network/interfaces
Using Virtualbox– Wisconsin Drupal Camp - 7/23/10
Vim!
Settings in /home/username/.vimrc