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.
Why Drupal, Why Ubuntu?For me it's all about community. I've always enjoyed apache web development in part because of the active and helpful user groups, forums, irc channels, etc. I use Ubuntu as the operating system for my LAMP because it's really popular right now - it has a very active forum and pretty good documentation. Drupal is an open-source content management system, or you could look at it as a framework since it was built to make it easy for coders to override almost anything it does without hacking the core. This means you could make it do anything you want if you happen to be good enough at PHP and still take advantage of core development and security updates no matter how much you modify the product.
Why write installation instructions?Good question? Well, the installation instructions at Drupal.org are good but they cover all sorts of environments (who wants to slog through all that?) and those in the Ubuntu Community Docs are great and pretty specific but cover Drupal 4.6.7 and 5.1. I probably should update the docs at Ubuntu, perhaps I will after I hash it out here and after a few people let me know they worked or what to change. Also, I like to search for instructions specific to my situation whenever I approach a new installation. It's good to see what other people in similar circumstances have encountered, I call it due diligence. I would suggest any user doing this install review the documentation mentioned above thoroughly. Also see related links at the end of this article.
EnvironmentThese instructions don't cover the setup of your server environment. Mine happens to be:
- Ubuntu 6.06 LTS server
- Apache 18.104.22.168
- PHP 5.1.2
- MySQL 5.0.22
tar -zxvf drupal-5.7.tar.gz
I'm a big fan of apt-get but there were a lot of issues in the forum started by people having problems with Drupal in the repositories. Community Docs recommend getting the latest package from Drupal.org, right now that happens to be Drupal 5.7. (Drupal 6 is out now as well, and is very cool, but CCK/Views aren't ready for prime-time and I'm installing for the purposes of following tutorials written for 5.x.)
sudo mkdir /var/www/drupaltest
sudo mv drupal-5.3/* drupal-5.3/.htaccess /var/www/drupaltest
sudo mkdir /var/www/drupaltest/files
My apache install is pretty much setup to default config. /var/www is my web root, yours may vary. Because I'm just using this particular install as a test which I plan on destroying later I'm going to put it in the boring old subdirectory 'drupaltest', actually I named mine d57_test_01 but thought drupaltest would be more comprehendable in the example.
In the mv command we explicitly move .htaccess because it's a hidden file.
mysqladmin -u root -p create db_drupaltest
mysql -u root -p
Create the database for Drupal to use - you can replace 'db_drupaltest' with whatever you'd like to call the database. You'll need to enter your mySQL root password. If you get an access denied error make sure you're using the mySQL root password and not your login or Ubuntu root password. The second command puts you in mySQL monitor, the command line interface for managing your MySQL server. The commands in the next code section are SQL. You could also run this in phpMyAdmin if you'd rather have a GUI.
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON db_drupaltest.* TO 'drupal_usr'@'localhost' IDENTIFIED BY 'secretpassword';
FLUSH PRIVILEGES; \q
Change the datebase name, the username 'drupal_usr' and 'secretpassword' to whatever you like. Just don't forget to write it down somewhere safe because you'll need to know it later.
sudo vi /var/www/drupaltest/sites/default/settings.php
Using vi (or whatevs) change the $db_url line. Note: If you use a fancy charcters or dashes in your user, password or database names replace them URI hex encodings, this is detailed in database settings comments section in the settings.php file.
Up Your PHP Memory Allocation
If you have a new LAMP install the default memory setting for scripts is 8M. This is redonkulous and Drupal will suck. Look for the 'Resource Limits' section and change memory_limit to 32M and then restart apache.
sudo vi /etc/php5/apache2/php.ini sudo /etc/init.d/apache2 restart
Go to http://localhost/drupaltest/install.php (or your servername instead of localhost if DNS is setup). You should see this:
One last thing, if you click Administer you will probably get a 'one or more problems were detected' error message. Two things: your files directory isn't writable and you cron job hasn't run. The first one is easy - just make the files area writable by all:
sudo chmod 777 /var/www/drupaltest/files
As for cron, you can just click 'run cron manually' on the Status report page - but you'll need to do this anytime you want to update the index. For a quick dev install you're likely to trash soon it may not be necessary but for a production or long-term dev install you'll want to set up a cron job to hit http://localhost/drupaltest/admin/logs/status/run-cron every few minutes depending upon your site's traffic and requirements. See Configuring cron jobs in Drupal's Getting Started guide for more.
That's it. Good luck folks, now enjoy surfing the Drupal learning curve...heheh.
- Ubuntu Documentation > Drupal
- Drubuntu Group - "for people using Ubuntu for developing Drupal core or contributed modules, and also for people using the Ubuntu LAMP stack as a server for Drupal."
- Install a Local Web Server on Ubuntu (11/2007) - screencast using Ubuntu desktop version, covers Drupal install.
- Installing PHP, MySQL and Apache under Linux on Drupal.org (Developing for Drupal » Setting up a development environment » Local server setup » Linux specific ) - covers enabling mod_rewrite which you'll need for clean URLs.