276 lines
27 KiB
Plaintext
276 lines
27 KiB
Plaintext
|
|
Episode: 259
|
||
|
|
Title: HPR0259: Drupal: From blank to blog in 30 minutes
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0259/hpr0259.mp3
|
||
|
|
Transcribed: 2025-10-07 14:57:29
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
3
|
||
|
|
Let's get started.
|
||
|
|
The following presentation from the Utah Open Source Conference held August 28th through
|
||
|
|
30th, 2008, is underwritten by Tier 4, providing scalable, reliable, affordable co-location services
|
||
|
|
to businesses and individuals worldwide, tier4.com.
|
||
|
|
Streaming and podcast hosting bandwidth for this and many other presentations at podcast.utos.org
|
||
|
|
has been provided by Tier 4.
|
||
|
|
The presentation entitled Drupal from Blank to Blog in 30 Minutes was presented by Derek Howard.
|
||
|
|
Drupal is a content management system.
|
||
|
|
Let me hand out some course pieces so you can follow along.
|
||
|
|
Drupal is a content management system that is going to allow you to manage the content of your website in a database
|
||
|
|
so that you can put things in and then have the system automatically generate pieces, keep things up to date,
|
||
|
|
allow interaction with multiple users so that you deal with more of the high-level concepts of what it is that you want to present,
|
||
|
|
whether that is just some very simple website or something more complex.
|
||
|
|
So what kinds of things can you do with Drupal?
|
||
|
|
Well, probably the first thing that most people think of nowadays is putting up a blog, whether it's a company blog or a personal blog,
|
||
|
|
someplace where you can keep a running tally of your thoughts, ideas, events, other things that you do very typically are galleries.
|
||
|
|
You want to share your photos, you want to be able to share designs, other artwork.
|
||
|
|
You might also want to run forums where people can log in, exchange ideas, can argue back and forth, do whatever you want to.
|
||
|
|
Another thing that you can do with Drupal straight out is that you can do collaborative offering.
|
||
|
|
So if you wanted to work on a book or some kind of massive document, it has tools to allow you to do that.
|
||
|
|
And because Drupal is expensive and can be added on, there's so much more that can be done with it as well.
|
||
|
|
Starting into Drupal, probably the first thing you need to do is find out what are the things you need to be able to run an installation or what you need to have to host Drupal.
|
||
|
|
First off, you need a web server. The recommended web server is the Apache web server.
|
||
|
|
It also will work with the Microsoft IIS, so you can't get it to run there as well.
|
||
|
|
You need also to have PHP. Drupal is primarily a PHP based engine that drives the content management portions of the site.
|
||
|
|
Recommended that you use the PHP 5.2 or higher, but it also works very nicely with the PHP 4.7 as well.
|
||
|
|
And then you need to have a database server. And it will use either the MySQL or Postgres, depending on which one you have a preference.
|
||
|
|
One caveat that I have on using the Postgres is some modules haven't been abstracted correctly, and they have direct MySQL calls, because Drupal grew up out of being on MySQL as its only database.
|
||
|
|
So if you go into Drupal, be aware that if you pick and look at some of the modules that are older, you may have some problems with that.
|
||
|
|
But what I've seen is a lot of the currently modified and supported modules are all abstracted so that you can use the Postgres.
|
||
|
|
So that's all you need for running Drupal. That can be obtained with a lot of different hosting accounts nowadays.
|
||
|
|
So planning out your Drupal installation, you've got several things that you need to do to plan things out as far as what you want to pick up and to select.
|
||
|
|
In Drupal, there's primarily three different versions that Drupal that are available right now. There is a 7X release, which is the ongoing development work.
|
||
|
|
It is unstable and should be used primarily for a developer type of environment. So you want to create modules, you want to extend Drupal functionality. That would be where you would do development work.
|
||
|
|
If you're looking for a production system, then you need to either take a look at the Drupal 6 or the Drupal 5X releases.
|
||
|
|
Drupal 5 has been around for quite some time, very stable. It's going to support some features in some of the older modules that you may not find in the Drupal 6X.
|
||
|
|
The Drupal 6 has now been out for about a year. The reason to go to the Drupal 6X is that they've made some extreme improvements on its performance.
|
||
|
|
Much faster parsing, much better system for plugin-in additional modules has better template caching, has better data management. It just seems to run a lot better.
|
||
|
|
If you have a critical module for business reasons that only runs on the 5, it's still available, but it's pretty much co-locked and only very set or very serious security problems will be fixed in that.
|
||
|
|
After you select your base module, or your base system, you'll want to take a look at modules that you might want to install and run for your Drupal installation.
|
||
|
|
You'll find things that you might take a look at would be media files or particular project management type things. Let me just switch over to the Drupal.
|
||
|
|
How do you have looked at Drupal before this presentation?
|
||
|
|
Drupal has a lot of different modules. You can see here on the left we've got the two main production releases and then you have modules.
|
||
|
|
To best navigate the Drupal site, I really recommend that you get yourself a setup or login for that because being logged in in part of the Drupal community allows you to run filters and sort various modules and themes by the platform so it makes it easier to find things that are compatible.
|
||
|
|
If we take a look at the modules and we can filter down modules, we see that we have quite a few things.
|
||
|
|
So anywhere from event planning to e-commerce, editors, media is one area that I'm going to show because I'd like to be able to have some photo capabilities.
|
||
|
|
So we've got photo albums, various different slideshows. The one that I'm going to show as part of this installation is I'm going to take a look at the image module and then image assist.
|
||
|
|
The image module is going to allow us to upload images to be stored within the Drupal installation and it's going to do some things for me like create thumbnails and preview sizes and kind of manage and optimize my images so that they're not necessarily my huge raw photos.
|
||
|
|
And then the image assist is going to allow me to actually link and embed those images directly within any of the types of text or stories or blog postings that I would want to have on the Drupal site.
|
||
|
|
So we've got modules. Next is themes. Out of the box, Drupal supports or has I think it's four or five default themes.
|
||
|
|
But one of the nice things about Drupal is that you can find a large number of additional themes. You can go into the.
|
||
|
|
Come back over here to the Drupal site.
|
||
|
|
We can find various themes that we could add to our site to give it a better look and feel than maybe what comes out of the box.
|
||
|
|
These little thumbnail views don't give you enough of the view of what it can do. There's a site called theme garden.org which allows you to see the themes on a live website.
|
||
|
|
It's kind of a lot like the zen garden is for cascading style sheets for just showing what can be done overall with cascading style sheets.
|
||
|
|
And for the demonstration that I would like to do, I thought this life fantastic would be a nice little template to use.
|
||
|
|
And then finally, after you've selected your collection of base modules that you're going to add on your themes, you probably want to go through and do one last check for compatibility to see whether or not there's any warnings of whether this module is only my SQL.
|
||
|
|
So if it's been properly abstracted, if there's any kinds of issues along like that, most of the 6X has been properly abstracted.
|
||
|
|
So it's mostly a 5X release issue that you'd have to worry about.
|
||
|
|
Getting to work, verify your server is set up. And most of the times that's going to be just talking either to the hosting provider or if you're the hosting provider when you're running your own server, make sure you've got the patchy, you've got your PHP, you've got the database, and you're ready to go that way.
|
||
|
|
You'll need to download your software, modules, and themes. Depending on whether you have shell access on the server where you're going to be hosting this will depend on whether you unpack and upload it or whether you just untie the system files in place on the server.
|
||
|
|
And once you have the files on the web server, you're going to use web browser to do your file configuration directly on the host itself.
|
||
|
|
Go through your answers, question an answer on the setup, go through the installation of additional modules.
|
||
|
|
So that in a nutshell is what we're going to have to deal with to get Drupal up and going. So who's ready? You ready to see this live?
|
||
|
|
I have a user, Joe, he's got a basic web hosting account somewhere. And this is his initial login page he got from the setup of the host.
|
||
|
|
Pretty boring and need some serious work. So Joe comes in and is logged into his account.
|
||
|
|
Oops, caps lock off. So into the public directory, we can see he's got one directory of file.
|
||
|
|
We're going to get rid of that and replace it with a Drupal installation.
|
||
|
|
So that's gone. And then we had I had in a download file or directory the Drupal components of what I wanted to install for this system.
|
||
|
|
So here I have the base Drupal installation. I have my two image modules and then down here at the bottom I have the theme module that I wanted to take and put over the top.
|
||
|
|
So the first thing is I need to extract Drupal into my public HTML directory.
|
||
|
|
So just taking a quick look at that, Drupal is set to install into a directory and then push everything out from there. So during my installation I'm going to step out that first directory structure so it installs correctly right here in place.
|
||
|
|
So I now have Drupal basically installed into my directory and ready to begin configuration.
|
||
|
|
How many of you go through the readmeas and the installs like the good person?
|
||
|
|
As last resort. So we're going to do this like most of you probably do get this last resort. We'll come here and we'll just launch it up.
|
||
|
|
So that's so good and at least came up and asked me what kind of language I want to install. So the English is my language.
|
||
|
|
First off is it tells me that I have some issues that need to be resolved. I have to set up a default settings file and I need to get the permission set.
|
||
|
|
And then I also have a directory sites and default files that I need to get set up before I can continue.
|
||
|
|
Let's go over and I need to copy the sites default settings to sites default settings.
|
||
|
|
And I also need to give permission so that the web server can be able to write that.
|
||
|
|
And in this particular setting the web server is a member of this user's private group.
|
||
|
|
So all I'm going to have to do on this is give it read write permissions for the group on that.
|
||
|
|
So that takes care of the first piece that we had that it was asking for.
|
||
|
|
The other is that it asked for a directory and that was in the site default and it needs a files directory.
|
||
|
|
This is going to be where it's going to store any of your uploaded images, attachment files.
|
||
|
|
So those kinds of items will be stored here.
|
||
|
|
So we'll create that and then we also need to give the web server rights to that directory as well.
|
||
|
|
Okay, back over, reload, finish with our error messages and ready to continue on.
|
||
|
|
Here's where we get to choose the database that we've been getting access to for this account.
|
||
|
|
I'm just going to show the straight forward my SQL.
|
||
|
|
The postgres is going to be pretty much the same kinds of questions and answers going through the configuration.
|
||
|
|
So I'll ask for the database name and in this case it is Joe user.
|
||
|
|
The user name for logging into the database Joe user.
|
||
|
|
The password and down here we have advanced options.
|
||
|
|
If you needed to specify a database host other than local host, you'd enter that here.
|
||
|
|
If you needed to specify a port other than the default communication port for the server that you're talking to, you'd do that.
|
||
|
|
Down here we have a cable prefix.
|
||
|
|
By default if you don't use this you can have one Drupal installation per database.
|
||
|
|
Now if Joe user can have multiple databases then he can put up multiple Drupal installations each having its own full database to support it.
|
||
|
|
If you get just one database for your account on that host and you think you might want to run multiple instances of Drupal, you can put on a prefix so that it can sort things out.
|
||
|
|
So we might put in this case Drupal 1 underscore.
|
||
|
|
So all of the tables associated with this installation will have this prefix in the database.
|
||
|
|
So it makes it very easy to support multiple Drupal installations from a single database system.
|
||
|
|
So we'll get that stuff, we'll save and continue.
|
||
|
|
Okay, we now have a Drupal installation telling us that we need to walk down the default settings.php.
|
||
|
|
So let's go back over to here and we're going to change that so that the web server doesn't have rights to that file anymore.
|
||
|
|
And we should be ready to go with now the configuration of Drupal.
|
||
|
|
This first piece here, the site name, is going to be what is the name of this Drupal site.
|
||
|
|
It could be the URL, it could be the name of the user, it could be the company name, it could be a project name, whatever it is that you would like here.
|
||
|
|
So I'm going to put for this Joe user and it's going to ask for the site email address.
|
||
|
|
This is going to be the email address that any confirmation emails would come from.
|
||
|
|
So when a person goes to a registered account, the confirmation communication will come from this particular account.
|
||
|
|
So this will be the user name for the administrator.
|
||
|
|
The first account that is created in Drupal is going to be kind of a special one.
|
||
|
|
It's going to have full rights to everything.
|
||
|
|
Accounts made after that, you'll have to put them into the correct role for managing or doing whatever you have to do.
|
||
|
|
So you can have spaces in it, you'll allow that, just know, underscores, punctuations are not allowed, except for the period items and underscores.
|
||
|
|
So question marks and other, you know, the specials aren't going to be allowed.
|
||
|
|
So we get the email address, finally a password.
|
||
|
|
I'll grade you on how strong your password is.
|
||
|
|
Tell you whether or not you're able to type the same thing twice.
|
||
|
|
You can set the default time zone for your Drupal installation.
|
||
|
|
So in this case, I've got that set for a mountain.
|
||
|
|
It automatically will pick the machine's time zone that you have set.
|
||
|
|
So if you've got it just to UTC, that's what you'll be seeing here, and you could adjust it.
|
||
|
|
This next area is clean URLs.
|
||
|
|
If your installation supports the, okay, blank, it's the mod rewrite, if it supports mod rewrite correctly, you'll be able to say whether or not you have enabled clean URLs or not.
|
||
|
|
Clean URLs make it really nice because what it happens to do is it gets rid of some of the nastiness up here with this question mark parameter that is being passed in on the URL.
|
||
|
|
In this situation, I don't have mod rewrite set for the mod user type of logins.
|
||
|
|
But if we moved it over to a full domain or something like that, fairly easy to get set up with the mod rewrite that gets the clean URLs.
|
||
|
|
And then we've got whether or not to check for updates or saving continuum.
|
||
|
|
Okay, installation is completely main now, visit our new site.
|
||
|
|
Okay, first thing it does is it brings up kind of a message that's letting you know that you have a fresh site that has nothing done to it.
|
||
|
|
We have no content, and we need to get some administration pieces done.
|
||
|
|
By default on Drupal, it allows in the user management, it allows that everybody can create, that visitors can create their account, and that no administration approval is required.
|
||
|
|
Probably not, you know, depends on your personal philosophy.
|
||
|
|
I think that people on my site should go through an approval process because they hate spammers.
|
||
|
|
So I'm going to change that right off.
|
||
|
|
We can write registration guidelines and information on the emails that goes out to people, welcome aboard, whether or not they can have a signature associated with their user account, whether or not they have a picture associated.
|
||
|
|
That's something that you could deal with in depth at a later point.
|
||
|
|
But right now I just wanted to turn off that users and kind of get looking at the overall system.
|
||
|
|
And clicking on the administered tab, it brings up kind of a console page that gives you some quick links and to some of the pieces that you will commonly deal with.
|
||
|
|
One of the things that you should probably take a look at and become fairly familiar with is this section down here on reports.
|
||
|
|
The status report is one that you want to visit, probably not necessarily on a daily basis, but you probably want to visit it a week or every other week.
|
||
|
|
Because what you will see is the status on the updates and configuration of the modules, themes, and that that you already have installed.
|
||
|
|
So if somebody updates that module or updates a theme that you're using, you'd like to know about it because maybe it's fixing about what I could leave your system exposed.
|
||
|
|
So let's run the Cron job, take a look and see if we get anything out of it.
|
||
|
|
So right now things are looking pretty good.
|
||
|
|
So our report system is looking pretty decent.
|
||
|
|
We can take a look also at your log entries so that you can see what's happening against your system.
|
||
|
|
This is where you'll see access issues where you'll see attempts at somebody to log into your system that is failing, giving you an idea if you're being hacked on.
|
||
|
|
So these two areas are probably good areas to take a look at at least once a week.
|
||
|
|
And we've got our basic system.
|
||
|
|
If we come back up here, we still have our welcome to Drupal.
|
||
|
|
You've got no content type of message.
|
||
|
|
So we still have some things that we want to take a look in the modules, probably the themes, and then we can start posting you some content.
|
||
|
|
So let's go take a look at the module list.
|
||
|
|
Modules are where you modify and configure and set up what kinds of actions that your Drupal installation can do.
|
||
|
|
There's a group of things that it just gets by default.
|
||
|
|
Let's scroll down here to the bottom. The court required pieces.
|
||
|
|
This is what everybody gets to be able to run any of modules.
|
||
|
|
You've got block manager. It manages blocks of content that can be displayed.
|
||
|
|
You have filtering to be able to search through and move through data.
|
||
|
|
You have node, which is the ability to actually have content pages or elements of content.
|
||
|
|
You have a user registration and login system. Those are the core components.
|
||
|
|
So you don't have to worry about creating your own user management system.
|
||
|
|
It's built right in. You have the ability with that to be able to flat groups, to create groups and levels of rights so that you can create not only full site administrators, but you could say I have a thumb manager type of user.
|
||
|
|
They have rights to manage and work with the form.
|
||
|
|
You've got all that.
|
||
|
|
Some of the things that we wanted to be able to do is I wanted to do the blog.
|
||
|
|
Maybe we'll turn on the contact piece.
|
||
|
|
We'll come and look at that.
|
||
|
|
We'll maybe turn on the form later if we have time.
|
||
|
|
But those two pieces I think will be enough to get us going with some of the other things that we're going to want to do.
|
||
|
|
I do believe so because I think that what you can do is under the site configuration.
|
||
|
|
Let's actually go turn on the upload.
|
||
|
|
This is the area where we primarily turn on and off modules. We have configuration pieces that we would have to deal with.
|
||
|
|
Here is file uploads. We can have information on maximum resolution, maximum total file size per user.
|
||
|
|
Defile sets out at one meg.
|
||
|
|
We've got default, maximum, per file, and total per user.
|
||
|
|
We can take a look at the image toolkit out of the box.
|
||
|
|
One of the things we're going to see when we install the image piece is it's going to allow us to use image magic tools.
|
||
|
|
At this point we do have some basic pieces. Let's try to create some content.
|
||
|
|
Since we were trying to look at mostly bringing up a blog.
|
||
|
|
We have areas where you can specify additional information of what the content is.
|
||
|
|
You can see revision information. You can create a log message, comment settings, file attachments.
|
||
|
|
You can change your authoring information.
|
||
|
|
We have options for how it's going to be published.
|
||
|
|
Let's take and save. We now have first post. We're seeing this down in Joe user's blog down through the hierarchy structure.
|
||
|
|
If we come up to the homepage, it's also been promoted there.
|
||
|
|
We can see elements and what kind of elements get promoted to that homepage.
|
||
|
|
I'll show you on that because we need that image module to really make that happen.
|
||
|
|
The question was what about image postings?
|
||
|
|
Let's go and add in those two new modules.
|
||
|
|
What I need to do is I need to be in my Drupal installation directory and I have a directory called Modules.
|
||
|
|
You can see that there is a collection of the modules that we have for the system.
|
||
|
|
We've got a lot of things, but we need to get the image module.
|
||
|
|
I've got this image module and it's going to untie just correctly right here.
|
||
|
|
Let's get that untied. We don't need to worry about stripping anything.
|
||
|
|
Let's get the images system. You now have those two new modules available in the directory structure, so I just need to come back over to the Drupal.
|
||
|
|
I need to go to Modules.
|
||
|
|
We've got first paste.
|
||
|
|
Down here at the bottom here is this new image collection.
|
||
|
|
I'm going to turn on image, the images system, attach, gallery, the import, and the advanced image magic options.
|
||
|
|
Remember what I told you? We got some things we need to fix, and that's from when we got things installed.
|
||
|
|
Right here we've got an image magic and clue file. We need to get moved to the correct location.
|
||
|
|
We've got this image magic and clue that needs to be copied into my includes directory.
|
||
|
|
That took care of the red one, but we need to select it, and then I also have an image import that needs to be done so let's go take care of those real quick.
|
||
|
|
Turn on the image magic. Now it has some information that we need to deal with.
|
||
|
|
The path to the convert binary. That looks good. Strip meta on anything below 150 by 150. All of that I think I can handle. We'll just take that.
|
||
|
|
We've got that and then images.
|
||
|
|
The default image path that is underneath the files directory like that, maximum upload. We've got a thumbnail at 100 by 100, a preview at 640 by 640, and if I leave the maximum width and height for the original it will leave it in the raw form of what it was uploaded.
|
||
|
|
I'm going to just do a quick little resizing on that if I can type.
|
||
|
|
We've got images.
|
||
|
|
I talked too much because I have this a little faster, but we've got the image import.
|
||
|
|
I'm going to actually pull this from
|
||
|
|
and then image gallery.
|
||
|
|
Back over to content.
|
||
|
|
I've got a gallery. Let's quickly go do some imports.
|
||
|
|
I've got a collection of photos that I've uploaded into that directory.
|
||
|
|
Let's select the gallery.
|
||
|
|
One of the things that may not have been intended is when I brought all those in because I didn't do anything to the gallery, it's going to promote all those photos to my front page.
|
||
|
|
Also, the first time that these were viewed it had to regenerate various thumbnails.
|
||
|
|
Quick thing on the content. Let me show you content management.
|
||
|
|
We are going to take a look at content types.
|
||
|
|
I don't want to promote that to my front page on gallery items.
|
||
|
|
I don't know for sure that might actually take some additional add-on modules and take a little bit of work on your functionality.
|
||
|
|
One of the things I'm going to do is take a look at things that have been promoted and things that are images.
|
||
|
|
Status is promoted.
|
||
|
|
We now see these are all my images that have been promoted to that front page.
|
||
|
|
One last thing before we go. We don't have an access to the gallery itself.
|
||
|
|
Let's go to navigation and I need to go to not under the create but I want to go to the gallery.
|
||
|
|
We need to turn on image galleries.
|
||
|
|
Now image gallery shows up in our navigation and we can see things along there.
|
||
|
|
I'm hoping this gives you a brief idea of what you can do with Drupal in a very short order.
|
||
|
|
Let's do some Q&A and if we've got time after that, I'll put on the other thing that we downloaded and take a look at that.
|
||
|
|
I don't recall directly out of the gallery.
|
||
|
|
We've got the title, disruption for the body.
|
||
|
|
If you're looking for something more, you'd probably either have to add on a module for annotation or find a way to modify the image module.
|
||
|
|
This was just one of the gallery choices that I had.
|
||
|
|
I think that some type of image media type of thing.
|
||
|
|
Many more websites without a lot of rich content, images, sound, movies, whether it's a link to YouTube or what have you.
|
||
|
|
I think media is key point nowadays.
|
||
|
|
It allows you to really drive the content, to really put a lot of information out there.
|
||
|
|
The potential to really explode the amount of data that you put on your website quickly hits a point where the taxonomy becomes probably an important one.
|
||
|
|
You can set up, whether you want unregistered users to be able to see content, whether they can take a look at things, whether they can comment.
|
||
|
|
We've got the anonymous user, the authenticated user. Those are the only two you get out of the box. Either you're not authenticated or you are.
|
||
|
|
The special is the person that was first came in as the Drupal admin. You might create another that is an admin if you want to give admin rights to another person.
|
||
|
|
That's probably one of the first things you do.
|
||
|
|
You can set that up too. If you're brave enough to allow anonymous users to be able to change your content, go for it.
|
||
|
|
The Drupal, quite honestly, I came into it sometime ago because I wanted to be able to have a system that I could extend rapidly.
|
||
|
|
I was familiar with a modularized PHP and so it landed and really had an adventure far off of that sense.
|
||
|
|
Sometimes it is a little difficult on having complete control over that mitigation menu.
|
||
|
|
I might be a little difficult and sometimes it takes a little work to get exactly what you want.
|
||
|
|
You know, really anything you can do with PHP, you can do with Drupal. If you're comfortable as a developer, adding a Drupal module can be as simple as about a half dozen functions and for five files to get a module installed if it's really simple.
|
||
|
|
If it's very complex with a lot of user rights and all that, you'll take a little bit of programming time, but it's fairly clean.
|
||
|
|
There's a lot of logic in this. One of the things that I'm wondering about is when a log in and they close down Firefox or ID, whatever, it may be.
|
||
|
|
Can you still click Go and it will completely be logged in? Or does the web server remember you or does Windows?
|
||
|
|
It is session-based based on either a cookie or a session ID that's passed up in the URL. And what PHP does is it keeps a stack of session variables based on your session ID.
|
||
|
|
It could be possible to steal that session ID and have it move to a different computer. It's always possible to do some hijacking, but they do a lot of security pieces to try to prevent those kinds of attacks.
|
||
|
|
They work really hard at trying to keep this very secure.
|
||
|
|
That would be a Windows issue of asking whether or not to remember the password. That's a browser.
|
||
|
|
I think we can take that one when I have a discussion on there if you'd like.
|
||
|
|
Thank you.
|
||
|
|
Thank you for listening to Hack or Public Radio.
|
||
|
|
This is HPR sponsored by Carol.net. So head on over to C-A-R-O dot N-E-C for all of us to meet.
|
||
|
|
Thank you.
|