| Installing Drupal on Linux: an epic adventure |
Jan. 13, 2006
There's a certain class of programs that I refer to as the "cranky" ones. They may work great when all is said and done, but getting to that point can be really hard. For me, these include sendmail, QuarkXPress, and now Drupal.
As you may know, I started looking a few weeks ago for an easy-to-use CMS (content management system) for my neglected Practical Technology site. I just didn't have the time to keep it up to date manually with Dreamweaver, Fookes Software's NoteTab, and Nvu.
So, after considering numerous open-source CMS programs, I decided to give Drupal a shot on Kubuntu.
Kubuntu, while a great desktop, was not a good choice for me as a CMS server platform. So, I headed to Novell's OpenSUSE 10.
Now, if I had been doing this in a business setting, I would have used either SLES (SUSE Linux Enterprise Server) or RHEL (Red Hat Enterprise Linux). I run both of them in my office. But, I wanted to see if I could do this on a "free as in beer" distribution, so I went with OpenSUSE.
Unlike Kubuntu, with OpenSUSE I was able to quickly and easily grab the server components I needed to set the stage for Drupal. These were: MySQL 4.1.13, Apache 2.0.54, and PHP 4.4.0-6.
With all this in hand, you should keep in mind that Drupal, like all CMSs I know of (both open source and proprietary), is not a "click a button and install" program. All of them require a lot of hands-on work with initialization files and the like.
You may have noticed that I'm not using the newest and shiniest versions of MySQL or PHP. That's right. The reason I'm not using MySQL 5 is that Drupal, or at least Drupal 4.6.5, doesn't work well with it.
This was the first of my fights with installing Drupal. I knew this was likely to be a problem because other programs had had trouble with them. Both the newest MySQL database and PHP scripting language may be faster and have more features, but neither excels at backwards compatibility.
Unfortunately, many projects have not been doing a good job of updating their software to work with these new versions. Drupal, alas, is one of those.
For now, if you want to run MySQL 5 and Drupal together, you need to set MySQL to a mode in which it acts like MySQL 4. For details on how to that, you'll need to turn to MySQL's The Server SQL Mode page. For Drupal, the proper setting is "MYSQL40"
You'll also need to set PHP up with the following settings in its php.ini file: session.save_handler:user session.cache_limiter:none memory_limit:24M With Apache, you could set these instead with a .htaccess file, but I prefer to reserve the .htaccess file for security settings.
And, of course you have to have the proper database extensions installed for PHP. In my setup, for example, I had to have php4-mysql up and running.
You'll also need to manually set up a MySQL database for your Drupal-powered Web site. Fortunately, Drupal does supply a database schema, so you don't have to manually set up the database.
You can either do this at the MySQL command line, with a MySQL administration program like Navicat, or with the open-source phpMyAdmin, which is what I use. It's not as powerful as Navicat, but for Drupal purposes it has more than enough capabilities.
Once you've got the Drupal database schema loaded, you can move the Drupal files to your Web directory. The default location, in my case, is /srv/www/htdocs. Check your Apache settings to make sure you know exactly where it's looking for its Web files. You'll also need to make sure that Apache's httpd.conf file includes index.php in its DirectoryIndex index.html index.php line as above, or your Web browser won't find Drupal when you head to your site.
As you install the program, you'll also need to pay close attention to where you install the files, and to their directory permissions.
The owner of the directory should be the Web server user, while the group should only contain people who will be working on the site. For my purposes, I'm using my developers group.
The files and directories should be given 755 permission with the command: For moving the files around on this project, I find Midnight Commander to be invaluable. I think Commander is a must-have in any serious Linux user's toolbox.
To do a lot of what I've just described, you're going to need to be logged in as root. Be darn sure while you're logged in this way that you only make necessary changes and that you log on to a normal user when your work is done.
Before you're done with your new Web server directory, you'll also need to get rid of any unnecessary Web files and add two directories: files and files/pictures. While Drupal doesn't create these automatically, you'll need them for users to enter blog entries.
Finally, underneath your Web root directory, you'll have to edit the sites/defaults/settings.php file with the correct MySQL database information for your Drupal site and its base URL. If you don't have a Web site URL yet, localhost will work nicely for the base URL.
You must be very careful in editing this file. Use only an ASCII editor, not OpenOffice.org or the like. That's because even a single excess space at the end of a line can cause your Drupal site to not run properly.
Presuming that everything has gone well, you'll be looking, as I was, at a Drupal login screen. The first user on Drupal is the administrator so be certain to keep that in mind with your login name and password.
That didn't sound too bad did it? Well, it's not, but to get to that point, I had to do a lot of digging around the Drupal and MySQL sites.
If you're going to follow my footsteps, let me suggest that you bookmark now the Drupal Best Practices Guidelines. It does a decent job of covering the fundamentals. You may also want to pick up a copy of Building Online Communities with Drupal, phpBB, and WordPress from a bookstore. The first two-hundred pages are all Drupal and it contains some very handy material. The online handbook, which was, when I started the project, something of a mess, has recently been cleaned up and improved. That said, you're still likely to be spending a lot of your time looking for answers in the Drupal forums.
Still, when all is said and done, Drupal, as I start to set up my site, does work quite well and quickly. I'm looking forward to building a site in it. Setting it up in the first place, though, that was another story.
Good luck!
--Steven J. Vaughan-Nichols
Do you have comments on this story?
Talkback here NOTE: Please post your comments regarding our articles using the above link. Be sure to use this article's title as the "Subject" in your posts. Before you create a new thread, please check to see if a discussion thread is already running on the article you plan to comment on. Thanks!
(Click here for further information)
|
|
|
7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.
4 Legal Reasons to Control Internet Access
The Internet is obviously a valuable resource for many organizations. However, many are exposed to legal liability concerns because they fail to control Internet access. Learn if you're safe in this white paper.
Rapidly Resolve J2EE Application Problems
Whether you are in the process of building J2EE applications or have J2EE applications already running in production, you must ensure that they deliver the expected ROI. Learn how in this white paper.
Load Testing 2.0 for Web 2.0
There are many unknowns in stress testing Web 2.0 applications. Find out how to test the performance of Web 2.0 in this white paper.
Build Better Games Online
For the game infrastructure providers, life is complex. Making money from games has become more complicated. Why? Find out in this white paper.
Building a Virtual Infrastructure from Servers to Storage
This white paper discusses the virtual storage solutions that reduce cost, increase storage utilization, and address the challenges of backing up and restoring Server environments.
Gaining Faster Wireless Connections with WiMAX
Welcome to what is quickly becoming the hyperconnected world where anything that would benefit from being connected to the network will be connected. Learn more in this white paper.
Is Your Desktop a Security Threat?
The new wave of sophisticated crimeware not only targets specific companies, but also targets desktops and laptops as backdoor entryways into those business’ operations and resources. Learn how to stay safe in this white paper.
Increasing SAN Reliability by 100 Percent
Storage area networks (SAN) are a strong part of storage plans. Learn how to increase your reliability and uptime by 100 percent in this case study.
|
|
|
|
|