Drupal 5.2 on Fedora

From Crashcourse Wiki

Jump to: navigation, search

Contents

Overview

What follows is a walkthrough of how to install and configure Drupal 5.2 on the latest version of Fedora (in this case, a fully-updated Fedora 8 Test 1, although I would think the directions should apply equally well to Fedora 7).

Sadly, following the instructions provided with Drupal and Fedora doesn't give you a working installation, so I'm going to point out the issues with the accompanying documentation and hope someone can fill in the blanks to finish off this tutorial.

We'll be using MySQL as the backend database for this example, so if you want to use something different, adjust the directions accordingly.

The database and usernames

For the purpose of this tutorial, I'm going to use the name "drupal" for the MySQL database and the username "dp" (with password "dp") for the MySQL username to manage that database. Those names are, of course, completely arbitrary.

The required MySQL packages

In addition to the standard MySQL packages, you'll need the "php-mysql" package as well, even though none of the documentation happens to mention this.

Creating the backend database

After getting into MySQL, create the database to be used for Drupal, and set up the username to be used to manage it:

mysql> create database dp52;
Query OK, 1 row affected (0.00 sec)

mysql> show tables from dp52;
Empty set (0.00 sec)

mysql>

Looks good so far. Now set up the username "dp" with password "dp", giving it the appropriate privileges for the "drupal" database:

mysql> grant all privileges on dp52.* to 'dp'@'localhost'
    -> identified by 'dp';
Query OK, 0 rows affected (0.01 sec)

mysql> select user,host,password from mysql.user;
+------+-----------------------+------------------+
| user | host                  | password         |
+------+-----------------------+------------------+
... snip ...
| dp   | localhost             | 077c6d4549229bfb | 
+------+-----------------------+------------------+
4 rows in set (0.00 sec)

mysql> flush privileges;

So that looks good. Onward.

Side note: The Fedora documentation file provides, as the MySQL instruction to grant privileges, the more verbose:

grant select, insert, update, ... etc etc ... on drupal.* ...

Is there any reason that simply granting all privileges wouldn't work just as well?

Installing and configuring the Drupal package

The Fedora Drupal package sets up Drupal a bit differently from the standard Drupal tarball so you have to follow the directions carefully. After installing Drupal, there is a directory of documentation files in /usr/share/doc/drupal-5.2.

First, read drupal-README.fedora, which states:

Follow the installation instructions in INSTALL.*.txt to complete the setup
of and connection of Drupal to the required database, including chmod 644 on 
/etc/drupal/default/settings.php, uncommenting the appropriate line in
/etc/httpd/conf.d/drupal.conf, and restarting httpd.

In the first place, that "644" should almost certainly be "666", so change the permissions on that file accordingly. In addition, here's the initial contents of the configuration file /etc/httpd/conf.d/drupal.conf:

Alias /drupal /usr/share/drupal

<Directory /usr/share/drupal/>
        Order Deny,Allow
        #Comment the following line and uncomment the next for public use
        Deny from all
        #Allow from all
        #Uncomment the following line for setup
        #Allow from 127.0.0.1
</Directory>

Simply following the instructions produces the updated file:

Alias /drupal /usr/share/drupal

<Directory /usr/share/drupal/>
        Order Deny,Allow
        #Comment the following line and uncomment the next for public use
        #Deny from all
        Allow from all
        #Uncomment the following line for setup
        Allow from 127.0.0.1
</Directory>

As a side note, is uncommenting that last line regarding 127.0.0.1 actually necessary? In any event, once all the above is done, restart the web server. At this point, you should now be ready to browse to and configure your Drupal install. Or so theory would have it.

The initial Drupal configuration

Browsing to the URL http://localhost/drupal does, in fact, drop you into the Drupal "Database configuration" menu, where you would (one thinks) select "mysql" as the database format, and "drupal", "dp" and "dp" as the database name, database username and database password, respectively, as created earlier, followed by "Save configuration."

This displays "Drupal installation complete," which looks promising. And you can further verify that this seemed to work by invoking MySQL using this new username, and checking the contents of the "drupal" database:

$ mysql -u dp -p
Enter password: dp

mysql> use drupal;

mysql> select uid,name,pass from users;
+-----+------+------+
| uid | name | pass |
+-----+------+------+
|   0 |      |      | 
+-----+------+------+
1 row in set (0.00 sec)

Assuming that that correctly represents the state of the "drupal" database before any administrative accounts have been added, we can return to the browser to continue the configuration.

At that configuration screen, the first instruction tells us to "Create your administrator account," and this is where things start to go badly. If we click on the link "create the first account," we're asked to supply only a username and e-mail address, so I'll fill in an arbitrary "rday" and "rpjday@mindspring.com", which seems reasonable. Note that I'm not asked for a password for this account, which will become an issue shortly.

After I enter that data, and click on "Create new account," I am immediately told, "Access denied, You are not authorized to access this page." So what went wrong? I can't log in to Drupal using the "rday" username since I'm required to enter a password as well, and I never specified one.

Using MySQL, I can verify that the "drupal" database does indeed have a new entry in the "users" table:

mysql> select uid,name,pass from users;
+-----+------+----------------------------------+
| uid | name | pass                             |
+-----+------+----------------------------------+
|   0 |      |                                  | 
|   1 | rday | f67967c6efa4d8f1e4abce197a926b37 | 
+-----+------+----------------------------------+

But that entry appears to have a password, and I have no idea what that represents. I never selected a password when creating that table entry, so I don't know how to log in.

At this point, I'm stuck, so if someone wants to clear this up, that would be just ducky.

UPDATE: Ah, I think I might know the problem -- Drupal might be trying to e-mail the temporary password and I'm not sure SMTP is configured properly to allow that. So it might just be mail that's the snag here.

Personal tools