Glad you could stop by the Linux Basement site. Linux Basement is an informational Podcast about Linux, open source software and lots of other wonderful technology. If you want to find out more about open source technologies, subscribe and have a listen!

#linuxbasement is up at irc.freenode.net

MP3 Feed
Ogg Vorbis Feed
MP3 Feed (all episodes)
Ogg Feed (all episodes)

Video blog (not the show!)

 

Customizing Drupal - Part 1

Customizing your Drupal site.

With your fresh Drupal installation now on your localhost, you should begin to customize it.
Click on customize and configure, or Administer in the main menu.
You should see a big red error message saying, "One or more problems were deteted with your Drupal installation. Check the status report for more information."

Click on the link to status report, so that we can fix these problems. You will notice two things are causing this error. One, is Cron maintenance tasks have not been run. Go ahead and click "run cron manually." At another time I will show you how to make this run on a schedule with cron automatically. The second error is that the File system is not writable. We have to go in and create a file directory on our web server.

status report page

We need to change to our root web directory, and then do a mkdir to creat the files dirrectory.

 

cd /var/www

 

 

sudo mkdir files

 

 

sudo chmod 777 files

 

Now refresh the page and both errors should be gone. Now that we are not getting any base errors with our installation, lets go back and click on administration again. Right now, we're going to set up the guts of our site, and later we will worry about adding a differnent look, and more functionality. In the right column you should see a Menu block called site configuration. You can also use the site configuration block under administer on the left.

site configuration block

Several of these options need to be configured immediatly. Lets go ahead and do it. We start with clean URLs. This is one of the most important features to configure, because it is the difference between good search engine optimization, or all of your urls looking like you are swearing a lot (http://localhost/?@#$%). While this is not important to you in a testing environment, it is essential in a production environment, so you should get used to doing this for all of your Drupal installations. We need to tell Apache2 that it is ok to use Mod_rewrite to change the paths of our urls. First, we need to enable the module:

sudo a2enmod rewrite

Then we go to /etc/apache2/sites-available and modify the default configuration. You may use any text editor you would like, I prefer nano:

 

cd /etc/apache2/sites-available

 

 

sudo nano default

 

Under <Diretory /var/www/> change Allowoverride from None to All so that it looks like this:

 

        <Directory />

                Options FollowSymLinks

                AllowOverride None

        </Directory>

        <Directory /var/www/>

                Options Indexes FollowSymLinks MultiViews

                AllowOverride All

                Order allow,deny

                allow from all

                # This directive allows us to have apache2's default start page

                # in /apache2-default/, but still have / go to the right place

                #RedirectMatch ^/$ /apache2-default/

        </Directory>

 

Restart your web server:

 

sudo /etc/init.d/apache2 restart

 

Now, if you go back to the Clean URL's page, you will see that there is a link to the "run the clean URL test."  Before you run the test, notice what the path is to this page:

http://localhost/?q=admin/settings/clean-urls

See that ?q=admin, well that is what we want to get rid of, so that when you post a blog or news article, it does not have that gobbily goop in there. Go ahead and run the clean URL test. You should see the page refresh, and you now have the ability to change Clean URLs from Disabled to Enabled. Also note the path in the URL now

http://localhost/admin/settings/clean-urls

Cool huh? If you did the steps above, but your URL rewrites are not working, chances are, you forgot to copy over the .htaccess hidden file in your drupal installation. Make sure it is under /var/www/.htaccess and if it is not, go back to your origional tar and get the file and move it there. This is where Apache is getting its rewrite rules that makes clean URLs work.

 You can go in Date and Time to change your sites default settings for time zones. The next thing I would like you to take a look at is Site configuration -->Site information.

site information admin page

This is where you should customize the information about your site. These settings will show up in your themes, so make sure that you fill out everything you want. The mission and Footer are optional. Click on "save configuration" when you are done.

You now have a base site, with your information, and an SEO friendly format. In Part 2 we will go ahead and get a new theme, and load up some of my favorite modules to add more functionality to the site.

Working with the Zenwalk

Working with the Zenwalk distro (which lacks the a2enmod script), I was able to enable clean URLs without mod_rewrite. I recall making some textfile edit involving 'allowoverride' while looking for answers at the drupal site, but didn't document exactly what at the time...