Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server

8,077 views

Published on

Session from DrupalCamp Wisconsin 2010

Published in: Self Improvement
  • Be the first to comment

Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server

  1. 1. Forget MAMP and WAMP, Use Virtual Box to Have a Real Ubuntu Server DrupalCamp Wisconsin July 23 rd 2010
  2. 2. Ingredients <ul><li>Virtualbox
  3. 3. Ubuntu Server 9.10
  4. 4. Drubuntu
  5. 5. LAMP </li></ul>
  6. 6. Why VirtualBox? Advantages: <ul><li>Cross-platform
  7. 7. Large user-base / documentation
  8. 8. You are using the real deal!
  9. 9. Difficulty
  10. 10. Networking </li></ul>
  11. 11. Why Drubuntu? <ul><li>Takes care of LAMP package installation
  12. 12. Community supported </li></ul>
  13. 13. Cooking time <ul><li>Downloading and installing VirtualBox (30 minutes)
  14. 14. Downloading and installing Ubuntu (60 minutes)
  15. 15. Configuring LAMP (60 minutes) </li></ul>
  16. 16. Installing Ubuntu Server
  17. 17. Installing Ubuntu Server
  18. 20. Bridged vs. NAT <ul><li>NAT hides behind the IP address of the VM host
  19. 21. Bridged creates its own virtual network interface </li></ul>
  20. 22. Connecting to Your VM <ul><li>Add SSH to your ubuntu vm “apt-get install ssh”
  21. 23. If you are using bridged adapter type “ifconfig” to find your host ip address
  22. 24. ssh to your devm using that ip address (using putty in windows) </li></ul>
  23. 25. Port Forwarding <ul><li>If you are using NAT adapter in Windows you must use port forwarding to connect through ssh
  24. 26. For instructions google “ssh port forwarding virtualbox” </li></ul>
  25. 27. Package management in Ubuntu <ul><li>Using apt or aptitude
  26. 28. To get updates type “apt-get update” and “apt-get upgrade”
  27. 29. To install new packages type “apt-get” package-name </li></ul>
  28. 30. Installing Drubuntu <ul><li>See http://drupal.org/project/drubuntu
  29. 31. 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 &quot;Run above script? (y/n)&quot; ; bash drubuntu-bootstrap.sh ” </li></ul>
  30. 32. Managing Your LAMP <ul><li>Webroot is /var/www
  31. 33. Apache settings /etc/apache
  32. 34. To access mysql type “mysql”
  33. 35. Hosts file /etc/hosts </li></ul>
  34. 36. Installing Drupal on Your VM <ul><li>Go to webroot “cd /var/www”
  35. 37. Make sure you have ownership of webroot (root does by default)
  36. 38. “sudo chown username:username /var/www
  37. 39. “drush dl drupal” </li></ul>
  38. 40. Adding a database <ul><li>“mysql -e” from the command line
  39. 41. 'mysql -e “creat database NAME”'
  40. 42. “create user 'USERNAME'@'localhost' identified by PASSWORD”
  41. 43. “grant all privileges on *.* to 'USERNAME'@'localhost'”
  42. 44. Or use phpmyadmin </li></ul>
  43. 45. Add Virtual Host <ul><li>Should be able to start off with http://vboxipaddress/folder
  44. 46. Virtual hosts allow you to user internal site names (ie mysite.local) </li></ul>
  45. 47. Add a Virtual Host cont. <ul><li>“cd /etc/apache/sites-available”
  46. 48. “cp default myhostname”
  47. 49. Update vhost file with internal hostname
  48. 50. “a2ensite myhostname”
  49. 51. change hosts file in host OS </li></ul>
  50. 52. 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
  51. 53. Running Headless Turn on: VBoxManage startvm VMNAME -type headless Turn off: VboxManage controlvm NMNAME poweroff
  52. 54. Using NAT with Host-only adapter Add network interface in ubuntu /etc/network/interfaces
  53. 55. Vim! Settings in /home/username/.vimrc

×