Mentat
Mentat is a single-user web content management program intended for power-users. It is written entirely in strict Perl and uses very fast in-memory SQLite for storage. It is distributed under a BSD License.
When Mentat was first hastily thrown together a decade ago, in 2001, I coded it to be simple, flexible and very easy to deploy. It started out as a CGI application and was later rewritten to use mod_perl. By today's standards, it is old-fashioned and lacks the advanced features of modern open-source content management systems. However, the strict, bloat-free 3000 line Perl codebase is well commented and remains easy to understand, extend and adapt by power-users.
Currently, Mentat is only suitable for the management of small to medium-sized websites by users at least somewhat competent in HTML.
As far as I know, Mentat only runs on Unix-based systems with Perl and Apache installed. The auto-generated web-server configuration assumes that you're using Apache with virtualhosts. The email notification mechanism requires an operational sendmail interface on an active mail server.
Unless you know what you're doing, you're probably better off with WordPress. That being said, you'll find the download link, installation instructions and other information on Mentat below.
Features and drawbacks
Features
- Fairly easy to deploy (no database setup required)
- Very small footprint (166KB install, 2 source files)
- Very fast
- Very simple, easy to use interface and editor with live preview.
- Allows editing, adding, deleting of pages, news entries and comments
- Rudimentary file manager and file editor
- Basic version control
- Quick multiple image uploading, thumbnail generation and automatic image optimization using
pngcrushandjpegtran - Beautiful rewritten URLs
- News entry system with RSS feed
- Threaded commenting system w. basic spam protection, moderation, avatar support and RSS comment feed
- WYSIWYG editor via TinyMCE
- Sitemap.xml auto-generation
- Email notifications
- No "themes" to upload. HTML can be edited directly in Admin interface.
- Discreet and minimal use of Javascript
- Very fast, file-based SQLite storage requiring no setup.
- Well-commented, easy to understand, open-source codebase.
Drawbacks
- Unidimensional page structure scales badly. Not at all suitable for very large websites.
- Single-user only
- Only supports UTF-8 text encoding
- No internationalization or multiple language support. Mentat is in English.
- No customisable meta-data for news entries (e.g. categories)
- No AJAX. None at all. CGI-based interface feels 10 years old, and it is.
- Since Mentat uses aggressive SQLite caching, each deployment instance will use at least 8 MB of memory per Apache worker. This makes Mentat ill-suited for a very large number of deployments on a single server. It also means you can reduce memory use by running Apache in threaded mode.
Install Perl modules
First, you'll need to make sure Perl and Apache are installed on your server machine. If you're running a modern UNIX operating system, this will almost certainly be the case. Then, open the CPAN shell to install module dependencies by running the following command:
Use the install command to install the following packages:
Time::HiRes HTML::Entities HTTP::Date CGI DBI DBD::SQLite Image::Info Date::Manip
Download and deploy
Once you've expanded the tgz archive, change to the directory created, mentat, and execute the following command, replacing name_of_website with the name of your website in lowercase, no spaces, and destination folder as the target folder on your file system that you wish to store the Mentat installation in.
The install script will create the necessary Mentat directory structure and apply the correct file permissions. The default webserver user is assumed to be www. If not, you can add your webserver username as the third argument. For example, if you're running the latest iteration of Mac OS X, the webserver user will be _www:
The install script will then run, install the Mentat instance and dump out a piece of text that looks something like this:
PerlSwitches -I/destination_folder/cgi-bin/
<VirtualHost *:80>
ServerName name_of_website
DocumentRoot /destination_folder/html/
CustomLog /destination_folder/logs/name_of_website.log full
ScriptAlias /cgi-bin/ /destination_folder/cgi-bin/
<Files mentat.pl>
PerlSetEnv BASEDIR /destination_folder
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
Options ExecCGI
PerlSendHeader On
</Files>
RewriteEngine ON
RewriteRule ^/robots.txt /files/robots.txt [L,PT]
RewriteRule ^/favicon.ico /html/favicon.ico [L,PT]
RewriteRule ^/icons/(.*)\$ /icons/\$1 [L,PT]
RewriteRule ^/\$ /cgi-bin/mentat.pl?action=displaypage&name=index
RewriteRule ^/images/(.*)\$ /images/\$1 [L,PT]
RewriteRule ^/files/(.*)\$ /files/\$1 [L,PT]
RewriteRule ^/cgi-bin/(.*)\$ /cgi-bin/\$1 [L,PT]
RewriteRule ^/news/(.*)\$ /cgi-bin/mentat.pl?action=displaynews&newsitem=\$1 [L,PT]
RewriteRule ^/(.*)\$ /cgi-bin/mentat.pl?action=displaypage&name=\$1 [L,PT]
</VirtualHost>
Update the ServerName directive to the DNS name you'll be using for the website. Then add the virtualhost configuration to your Apache httpd.conf file and restart the webserver:
Your new Mentat deployment should now be accessible through the DNS name you assigned to it. Be sure to immediately assign a login password in the Configuration Panel under Admin. You log into the system at /login.
Documentation and Links
Links
