New Web Development Workflow

I have had the long-standing habit of working alone, without version control. While many have scolded my workflow, it has been fast and mostly problem free. However, it’s time to change it and while there is a lot to learn in the version control and virtual machine space, actually setting up a dev box with git should be pretty quick (or so they say). So here goes: my notes on how to setup drupal and start theming a site, using git manage versions of the theme.

  1. install virtual box;
  2. download ubuntu server 14.04;
  3. using virtual box, create an ubuntu LAMP VM;
  4. configure port forwarding on the vm for mysql and ssh;
  5. start the vm from the CLI by issuing this command:

    VBoxManage startvm ubuntu –type=headless

  6. connecting to mysql from the host system requires a different bind_address. change bind_address in /etc/mysql/my.cnf to 0.0.0.0 and restart mysql
  7. create a database for drupal by logging into your vm, connecting to mysql and issuing these commands (note: ignore curly quotes):
    CREATE USER ‘user’@’localhost’ IDENTIFIED BY ”; //put password in the ”
    GRANT ALL PRIVILEGES ON *.* TO ‘user’@’localhost’ WITH GRANT OPTION;
    CREATE USER ‘user’@’%’ IDENTIFIED BY ”; //put password in the ”
    GRANT ALL PRIVILEGES ON *.* TO ‘user’@’%’ WITH GRANT OPTION;
  8. CREATE DATABASE dev;
  9. create a folder (“dev”) to hold drupal and download drupal into it
  10. configure drupal to use the mysql server in your vm. this involves copying sites/default/default.settings.php to settings.php and setting the permissions for the file;
  11. navigate to dev folder in CLI and issue this command:

    php -S localhost:8000

  12. visit http://localhost:8000/ in a web browser to test that php is running and to setup the drupal service;
  13. choose the theme that you will customize and do some theming;
  14. create a repository to hold the theme and commit your local code to git.

Leave a Reply

Your email address will not be published. Required fields are marked *