打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Installing Drupal on Linux: an epic adventure
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:
    chmod -R 755
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!
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
drupal+mediaWiKi搭建过程
Debian下Apache2+Mysql5+Php5的安装配置
ubuntu install php-apache-mysql官方教程
Drupal 安装指南 -   X‘zone - 博客园
MEAN vs LAMP:哪个是你的下一个开发项目!?
如何安装Drupal 7?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服