Section 9.3. Installing Blosxom

Now that you have Blosxom, you're just a few short steps away from your first blog entry. Customizing Blosxom for your particular environment requires just a couple of simple configuration changes. Open the blosxom script in your favorite text editor.

First make sure the first line of the script (#!/usr/bin/perl -w) correctly identifies the location of your Perl interpreter. If you're unsure and have access to the command line, type:

% which perl

/usr/local/bin/perl

Copy and paste the resulting output after the #! in the blosxom script (e.g., #!/usr/local/bin/perl -w). If you don't have access to the command line, ask your service provider or system administrator for help. Be sure there's no space between the #! and the path to Perl.

About the only thing Blosxom really needs to know is where you keep your blog entries. Change the $datadir line from:

my $datadir = '/Library/WebServer/Documents/blosxom';

to the appropriate directory path. For Mac OS X and Unix users, we recommend something alongside your web server's document directory:

my $datadir = '/Library/WebServer/Data/blosxom';

or:

my $datadir = '/usr/local/apache/data/blosxom';

Under Windows, somewhere like:

my $datadir = 'c:\Inetpub\wwwdata\blosxom';

If you'll be running Blosxom on your service provider's web server, somewhere in your home directory will do nicely:

my $datadir = '/home/sam/blosxom';

Wherever you choose, just be sure the directory is readable by the web server.

That said, you probably don't want to put Blosxom's data anywhere web-accessible (your server's document root or public_html directory). While, of course, your entries will end up being publicly viewable anyway, you may want to keep drafts or other assorted files that might end up in your Blosxom directory private.

Save the blosxom script, then move the it to your cgi-bin or other directory out of which you're able to run CGI scripts.

Mac OS X

/Library/WebServer/CGI-Executables

Unix with typical Apache installation

/usr/local/apache/cgi-bin

Windows

c:\Inetpub\wwwroot\Cgi-bin

Fairly typical service provider's web server

/home/sam/public_html/cgi-bin

You can do this either via your operating system's graphical file manager or on the command line; if your CGI directory were /home/sam/public_html/cgi-bin/, you'd say:

% mv blosxom /home/sam/public_html/cgi-bin

You may need to rename the blosxom script to blosxom.cgi so it's recognized by your web server as a CGI script. Again, you can do this via graphical file manager or on the command line:

% cd /home/sam/public_html/cgi-bin

% mv blosxom blosxom.cgi

Make sure your web server has permission to run the blosxom.cgi script by saying:

% chmod 755 blosxom.cgi

Note: Permissions vary from situation to situation; if you're unsure, ask your local administrator or service provider. That said, 755 is a reasonably safe bet.

Next, create the directory you specified as the $datadir to hold your blog entries. This directory and its contents must be readable (writable is not necessary) by the web server. If you chose /home/sam/blosxom, for instance, you'd say:

% mkdir /home/sam/blosxom

% chmod 755 /home/sam/blosxom

Your Blosxom weblog is ready to go.