USE THIS INFORMATION AT YOUR OWN RISK. Any information found on this website is offered only as informational and includes no warranty, guarantees or support. The author claims no authority on any subject whatsoever.I just started reading the recently published book Using Drupal, 1st Edition, published by trusty ol’ O’Reilly and written by a bunch of Lullabots.
So far the book is great, but the instructions on setting up a dev environment aren’t exactly crystal clear for those completely new to Drupal. I thought I’d help out the next geek that bothers to GTS to find pitfalls before starting.
First review the preface section 2.7 ‘Downloading Drupal’. If you’ve never installed Drupal before, or any web application on a web server before, it’s a good idea to check out Lullabot Addison Berry’s very easy to follow video, Installing Drupal 6.
These instructions are specific to the context of a shared hosting account on Dreamhost, but may work for your environment as well. Be sure to review the book’s errata – the ‘confirmed errata’ will let you know about any code mistakes or problems with source discovered since the book was published. For troubleshooting help related to the books exercises and installation issues, review the Using Drupal book forum.
THESE INSTRUCTIONS MAY CAUSE YOUR DATAZ TO BE LOST. In addition to setting up things quickly, these steps include how to quickly delete all the stuff in your database, without bothersome ‘back up your data first’ steps. The idea is you are just creating a sandbox and nuking your install is no big deal.
Enough blab, let’s do this:
- Create a subdomain for your dev environment like drupal.yourdomain.com
- Dreamhost panel > Domains > Mandage Domains > Add New Domain / Sub-Domain
- Create a new database (on a new or existing subdomain)
- Goodies > Manage MySQL, scroll to the bottom where it says ‘Create a new MySQL database:’
- Enter something in all the fields:database name must be unique system wide so get creative, create a new hostname like mysql.drupal.yourdomain.com, you can use your own username but I created a special username and password that I’ll also be using for the admin user in the Drupal install (note: dev enviro, not recc’d for production), you might want to put something to remind you what this is later in the comment field like “Sandbox for Using Drupal Book”.
- Write down all that DB stuff so you can use it later.
- Wait a while for new database host name and/or new subdomain to propagate.
- Download the latest source from the book site.
- Extract the zip somewhere you can find it, like your desktop.
- Change the database connection string in using_drupal_source\drupal\sites\default\default.settings.php
- Open default.settings.php with your favorite text editor
- change connection string stored in $db_url (line 92 at TOW) from mysql://username:password@localhost/databasename to something like
- Copy default.settings.php in the same folder and call it settings.php
- There should now be 2 files in the default folder
- Save a backup copy of your default folder somewhere
- I just copied the default folder and renamed it ‘_default’, or save somewhere on your hard drive, thumb drive, whatever…the point is, settings.php and default.settings.php that will soon live on your web server are going to change and you’re going to want these files again someday.
- Upload the contents of using_drupal_source\drupal to the root of your new subdomain
- chmod /sites/default to 777
- On you web server (via your FTP client) navigate to /drupal/sites/default
- If you’re using FileZilla, right click (ctrl+click for macs) the default folder and select file permissions, this will allow you to enter the numeric value 777 or just check read/write/execute for all roles
- Open http://drupal.yourdomain.com
You’ll be prompted to select an ‘Installation Profile’. The book source code includes scripts to automatically install a site with assets and modules used in their examples for you. If you are just starting Chapter 2. where they send you off to the Appendix for installation instruction, chose the last option – the generic/basic Drupal install.
Here’s how to “start over” so you can use a different installation profile. These steps will cause you to lose any data you entered in Drupal – you will end up with a brand new install and a chance to chose a diferent installation profile:
- Nuke all your database tables
- Note I said ‘tables’, not the database.
- Go to http://mysql.drupal.yourdomain.com (phpMyAdmin screen) and login
- Select you Drupal database from the databases list at left (e.g. NOT information_schema)
- Scroll to the bottom of tables listing page and select ‘Check All’, change the ‘With selected:’ drop down to ‘Drop’.
- You will see a screen asking if you really want to execute this command. Click ‘Yes’.
- CHMOD /sites/default to 777 again
- On your web server, go to /sites/default
- CHMOD default to 777 (again, because the previous install process modified the permissions) and be sure to check ‘recursive’ (or use -R on commandline) because there’s new files in there and we need to blow everything in the default folder away.
- Delete everything in /sites/default
- Put a clean copy of default.settings.php and settings.php in /sites/default
- Remember that saved copy of default.settings.php and settings.php?
- Go to http://drupal.yourdomain.com/install.php and start all over again :)
I hope that was helpful for someone. I remember all to well not even knowing what chmod was and trying to write perl scripts, ouch! As you might guess, with as much time as I spend documenting when I should be doing book exercises I don’t really have time to offer support, but please let me know if anything I’ve written here needs to be corrected or elaborated on. Have fun in Drupal land!