Getting Started with Drupal: The Non-Retarded Version

October 11, 2009 by: Rick Martin

drupal_hapiThe worst thing about all the documentation over on Drupal.org is that it’s just not very accessible to non-developers. But first I want to address the question,

Why even bother with Drupal?

Despite the headaches I’ve experienced with installation and administration, Drupal is super powerful. It’s really good at presenting content in interesting ways, and in a time when news sites and blogs are all competing for an edge, the winner just might be the guy with the best presentation. Will a Wordpress blog stand out? I don’t think it’s as awesome as geo-tagging all your content (for example). See what Alex has done with the map over on DalianDalian.com for a damn sweet illustration of this.

When I think about all the English language content about Japan that’s out there (see the big boys Gaijin Pot and Metropolis) it occurs to me that no one is really doing it well. Maybe they’re held back by old software? I don’t know… But it would be really awesome to have a multi-person blog site or forum where all the content is geo-tagged, or categorized according to the nearest train station or some other ‘taxonomy’ (sane people, read ‘category’). Geo-specific advertising then becomes a possibility as well.

One of these days, I might take my TokyoSocial.com domain name and do something like this. But just this once I’m going to hang back and say “hey, maybe I have enough websites already.” I’m open to collaboration though, so if anyone likes this idea drop me a line.

But Drupal is Tricky to Install

The Drupal install can be troublesome, and I ran into multiple problems when I attacked it using an FTP program (Cyberduck). I suspect when I was uploading the install package, I was not copying essential hidden files when I was dragging and dropping. I ran into other errors as well but to make a long story short, my problems ended when I switched to the command line (I use the Terminal application on Mac, Windows users try Cygwin maybe?). Matthew helped me out by showing me a few basic commands, and I was good to go from there.

Disclaimer: I’m no expert at this stuff, and my explanation isn’t great. But it’s laughable that nobody has tried to make Drupal as accessible as other CMSs by explaining all this in simple, understandable terms. Anyway, here goes:

Connect to your server via SSH

In the terminal application (Windows users, try Cygwin maybe?), type in ‘ssh username@hostname.com‘. In my case, the hostname was the IP. It’ll ask for prompt you to type your password as well.

Note: Keep in mind that some hosting companies might not have it enabled by default. And if they tell you that they don’t support ssh, they might if you threaten to switch hosting companies. Mine did.

Navigate to the Folder where you plan to install Drupal

Anyone old enough to remember DOS commands will enjoy using the ‘cd’ change directory command here.

Download the Drupal Package

Type: wget http://drupal.org/files/projects/drupal-x.x.tar.gz (Of course replace the Xs with the latest version number)

Extract the Installation Files

To unzip (or untar) this package, type: tar -zxvpf drupal-x.x.tar.gz

Note: If you have trouble memorizing this command, just think of “Zebras, Xylophones, and very pretty flowers”

Create the Database and Run the Install Script

This was the easy part. You can use PHPmyadmin, or your regular server interface for this. Maybe there’s a terminal command for this? Anyone?

Install Desired Themes and/or Modules

Once you find themes or modules that you’d like to install, you might think that they should go in the ‘themes’ or ‘modules’ folder. Wrong… It seems that Drupal expects you to instinctively navigate to sites/all and open the readme text file. Reading this mysterious file, you’ll discover that:

This directory should be used to place downloaded and custom modules and themes which are common to all sites. This will allow you to more easily update Drupal core files. These modules and themes should be placed in subdirectories called modules and themes as follows:

sites/all/modules
sites/all/themes

Ok, that makes sense Drupal dudes. But is there any reason why these directories can’t be there by default? And then just explain the correct process through competent documentation?

Remove unwanted zip files

Unless you want to keep these zip files on your server, you can remove them using the rm filename command.

Error: register_globals is enabled

If you run into this error during the install, be sure to read this section. This error caused me so many headaches, I can’t even begin to tell you. But I finally got to the bottom of it. Previously when I encountered this error:

register_globals is enabled. Drupal requires this configuration directive to be disabled.

From most discussion on Drupal.org, I thought I was out of the woods when I added a php.ini file to the root directory with the code

register_globals = off.

While that does allow me to move on to the next step, it doesn’t solve the underlying problem. According to my hosting company, the code (at least for me) should be:

register_globals = off
post_max_size = 20M
memory_limit = 200M
upload_max_filesize = 20M
max_execution_time = 120
expose_php = off
session.save_path = /tmp
mysqli.default_socket = /tmp/mysql5.sock

(download php.ini file here)

They said: “The issue is that php.ini files override the global settings, and when you do not add the compatibility lines the socket for mysqli is not set.”

And sure enough, a php.ini file with this code solved the problem. *Sigh…*

You should be ok from there. I recommend checking out some video tutorials to take you deeper into Drupal, and the ones over at MustardSeed Media are especially good.

Anyway, I’d love to hear Alex, Takaaki, and other Drupal minds chime in here. Because again, maybe this is not the best way to go about it — but it’s the way that made the most sense to me.  I’m still open to suggestions.

Support 1Rick.com by Sharing:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Posterous
  • Reddit
  • RSS
  • StumbleUpon
  • Tumblr
  • Twitter
  • email
Filed under: drupal, mac, tools
Tags:

Comments

10 Responses to “Getting Started with Drupal: The Non-Retarded Version”
Subscribe to Comments via RSS
  1. Alex says:

    Drupal is sadly not made to be easy to use. It is a real pain for someone new to it. It is really powerful too. Out of the box it does half of what a competing CMS does – hell it doesn’t have the right files set to the right default permissions to be able to be installed.

    It does provide a workbench with a set of tools all with consistent dimensions and interoperability.

    It doesn’t provide out of the box solutions. Functionality in terms of an API is usually pretty good, but in terms of something to plug in and go it really sucks.

    I don’t think that will change, other than the addition of various forks, branches and installs, while Drupal consultancies will do heavy lifting. There is also more to a CMS than the visitor, much work has to go into training the organisation using it how to best use their tools.

  2. takaaki says:

    You can use an GUI FTP program with no problem. http://screenr.com/pfH
    No need to learn to ssh into the server. You can use FTP software to
    change permissions. In most cases you can set to “755″. When there’s
    a security risk, Drupal will let you know.

    It’s okay to ssh into your server and “wget” the Drupal. But in any case,
    you might want to run your Drupal site locally. So I cannot recommend your approach.
    If you learn the command line, check out PeepCode stuff. Highly recommended.

    If you want to view the files and folders just like in Finder, you might want to try
    http://www.expandrive.com/mac

    Top level “themes” and “modules” are for Drupal core. When you upgrade the Drupal someday, you can safely upgrade if the folders are untouched.

    Drupal can run multiple websites. That’s why Drupal has “sites/all” to make the modules and themes available to *every* website you run on the Drupal installation.

    My suggestion would be that you run the system locally first. Keep the source under version control so that you can come back where it was any time. Also *dump* the MySQL frequently. I can’t remember the name, but there is a module, which makes running the cron job easily. Install the module.

    You do a lot of things in GUI, which means a lot of things are in MySQL, which is not file-based. Yes, what you changed is reflected in the database, but you might want to take notes on what you did. Understanding all the DB schema is hardest thing. What this also means that even if you delete the module folder in the server, all the stuff is left in the database. In order to keep the database clean, you need to export and import the database often. If you played with several modules to test out, make sure you have a backup of the database before that.

  3. KeriCDN says:

    I don’t use Drupal and probably never will, I just love that you used the word ‘retarded’ in your title.

  4. Rick Martin says:

    @takaaki I agree with experimenting with Drupal locally. And I’ve been doing that using MAMP (http://mamp.info). I still think that the command line is the quickest way to install and uninstall themes and modules. I’d have never expected that, but it just works really well.

  5. takaaki says:

    Just to add. If you learn svn, go wtih Versions or svnX for GUI software. Beanstalk gives a free and coolest Ui for the server.

    If you go with Git, talk to me. Git is what is hot right now.

    But with Drupal development, a lot of things happen in database. Learn how to export data using PHPMyAdmin. This http://codex.wordpress.org/Backing_Up_Your_Database is all you need, methinks.

  6. Alex says:

    If you’re backing up the database and are already used to the command line I’d recommend the command line. PHPMyAdmin might run into a memory or time limit (depending on how PHP is installed), while the command line shouldn’t. And if you only do a limited amount of stuff when logging in via the command line, all a user has to do is press the up arrow, and the last command they typed in will appear, so there’s no need to type it again (apart from perhaps change the file name).

  7. Alex says:

    *depending on how PHP is configured.

  8. Rick Martin says:

    @takaaki Thanks for that link. I’ve been meaning to learn a little more about databases. That will certainly helo.

  9. Tom says:

    I took a look at Cyberduck and decided to stick with Filezilla, the same program I use at work on a Windows PC and on my desktop, a Ubuntu PC. Cyberduck looked pretty flashy, but Filezilla just made more sense, especially at work where I have to use Putty to move files from one directory to another because I do not have direct access to the drupal folders. Other than that, and the initial headaches we had setting up Dalian Big Link at work, I’ve had no problems getting it going and maintaining it on my own website.

  10. Rick Martin says:

    @Tom — Yeah, I’m not a huge fan of Cyberduck, but I tried Filezilla only to be super confused by the interface. I think I have a handle on it now, but it just isn’t very intuitive and makes me use my brain too much. Not good.

    I’d love to see how Big Link has grown since way back when. Well have to chat more about it in a non-public place sometime.

    By the way, I saw your blog post about moving… Where are you now?

Leave a Reply

Ads: 顔 脱毛 電話占い フランチャイズ 福祉車両 イギリス 留学 結婚祝い 個別指導 化粧品 資産運用 留学 墨田区 中古マンション ホテル 菊陽 フィットネスクラブ 相模原市 不動産 広島 専門学校