PGP Signed Comments

| | Comments (1)

As an intellectual exercise, more than for any practical reason, I implemented OpenPGP Signing of Movable Type Comments on my weblog. As Krishnan Nair Srijith, the author of the Movable Type plugin, points out, "installing Crypt::OpenPGP's prerequisites is no easy work :)" So much so, that if I had know how much work it would be, I might not have attempted it. Nevertheless, I am glad that I did, if only because I learned a little bit about Perl in the process, perhaps enough to pique my curiosity to learn more.

My experience installing the prerequisite local Perl modules for Crypt::OpenPGP in my home directory can be summed up as follows:

Create the following directories in your home directory:

mkdir usr

mkdir usr/local

Set the environment variable (my shell is "/bin/bash")

export PERL5LIB="/home_directory/usr/local/lib/perl/5.6.1:\
/path_to_home_directory/usr/local/share/perl/5.6.1:" You may eventually want to add this line to your .bash_profile so that it will set the variables every time you log in.

You can see if you have properly set the environment variables by typing the command

perl -V

(Note that the flag is a capital "V"). Your library path (path_to_home_directory/usr/local/lib/perl/5.6.1) should be listed under @INC.

Download the required modules from http://www.cpan.org. The README in Crypt:OpenPGP lists the prerequisite modules, although some of these may also have prerequisites on your system.

Unpack the module with:

tar -xvzf module_name.tar.gz

cd module_directory

perl Makefile.PL PREFIX=/path_to_home_directory/usr
make test
make
make install

Repeat until all the modules are installed without errors, and finally install Crypt::OpenPGP. You then need to edit your Movable Type templates to take advantage of the new plugin. Be sure that you have put an ASCII copy of your PGP Public Key (e.g. http://www.williamsonday.com/pgp.asc on your site so that you can test the key verification feature of the plugin.

I found that once I had properly set the environment variable (which took me some time to get right), most of compilation errors that I experienced resulted from my having not yet installed a prerequisite to the prerequisite module.

NOTE: Although installing the local modules manually rather that automatically through CPAN was somewhat tedious and time-consuming, I found that it was the only way that I was able to make the local installation work properly.

Also, Srijith suggests that it may be a good idea to edit OpenPGPComment.pl to set the variable called DEBUG to 0.

Categories

1 Comments

Bill Day said:

When I was upgrading OpenPGPComment, I realized that in order for it to recognize my local perl installation, I had to add lines to the top of my script as follows:

As mentioned before, you find the exact directories by executing perl -V and replacing the global Perl installation's base directory with your home directory.

Modifying @INC is quite easy. The best approach is to use the lib module (pragma), by adding the following snippet at the top of any of your scripts that require the locally installed modules.


use lib qw(/home/stas/lib/perl5/5.00503/
/home/stas/lib/perl5/site_perl/5.005);

Installing mod_perl without superuser privileges

Leave a comment

About this Entry

This page contains a single entry by Bill Day published on April 3, 2004 10:49 PM.

Goodnight, sweet prince was the previous entry in this blog.

Cool Site of the Day is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Disclaimer

The views expressed on this website are those of the author and webmaster alone (with the exception of links to or quotations from other sources), and do not represent the views of his employer, family, friends, associates or any other person. The author expressly disclaims responsibility for any material to which this site links, any site which links to this site, and any contributions by other persons — including but not limited to links, comments or trackbacks. No statement on this website should be regarded or relied upon as legal or business advice of any kind. Persons seeking legal advice should consult a lawyer licensed in the relevant jurisdiction. This site does not create an attorney-client relationship, nor does reading it, contributing to it, or commenting upon it.

Powered by Movable Type 4.2-en