Posts Tagged ‘blogs’

Nucleus CMS on Apache2 / Debian

Tuesday, November 1st, 2005

While moving all my sites to Apache2 and PHP4.4 on a Debian server, I ran into a few problems. Not sure why, though.

All pages on all blogs came up blank and there was absolutely nothing in the Apache error log.

A test showed that the server returned zero bytes.

I ran the install.php script again, and it said

Your PHP version does not have support for MySQL :(

but phpmyadmin worked brilliantly, so MySQL was supported.

Anyway, after some experimenting, I added the line

extension=mysql.so

to /etc/php4/apache2/php.ini, restarted the web server and Nucleus worked again. I wonder why phpmyadmin worked anyway.

Update: it is in the Debian BTS.

Setting up Nucleus blogs

Saturday, July 24th, 2004

This site is run by Nucleus CMS, and this is just to recapitulate how it was set up. It wasn’t all that hard, but it might be useful to remember.

First step was to create the blog in Nucleus which is straightforward.

Second step was to clone the grey skin and two templates, and edit them to my liking. I didn’t change all that much, just enough to make it mine. The blog-settings obviously have to be changed to use the new skin, and the skin to use the new templates.

Now for the more interesting parts. I want my blogs to have separate domain names and I want URIs without the query string, the part after the question mark.

My Nucleus setup has a directory layout like this:

TOP/nucleus
TOP/nucleus/conf
TOP/nucleus/nucleus
TOP/nucleus/media
TOP/nucleus/linux
TOP/nucleus/othersite

TOP is the directory where I keep web-site’s files. The nucleus/conf directory contains the apache configuration files, nucleus/nucleus the installation of Nucleus, nucleus/media is the media uploads and nuclues/linux is the document root for this site. Other sites have their directories too.

Setting a blog up with a separat domain name requires a separate Apache setup, as a virtual host. I have the configuration file in nucleus/conf/linux.conf which is included from the main Apache configuration file. The most important thing is the DocumentRoot, which points to nuclues/linux.

DocumentRoot TOP/nucleus/linux

Here the index.php files looks like this:

<?php
$CONF['Self'] = 'http://linux.seindal.dk/index.php';
include('../nucleus/config.php');
selectBlog('linux');
selector();
?>

which is fairly straightforward, except for the absolute address of the index.php file. This is necessary since posting a comment would otherwise cause a change to my main Nucleus site.

With this setup the site can be used from the address http://linux.seindal.dk/.

The last part is to get Nucleus to work with URLs without a query string. Using long query strings are suboptimal in relation to some search engines, and it is suboptimal from an aesthetic point of view: an URL should be short and clear.

Since I have my own server, I can use the mod_rewrite approach, as explained in the Nucleus online docs. I have augmented the rules a bit to be more complete, and hardwired the blog specific parts:

RewriteEngine On
RewriteRule ^item([0-9]+).html				index.php?itemid=$1
RewriteRule ^archive([0-9]+-[0-9]+).html		index.php?archive=$1&blogid=2
RewriteRule ^archive.html				index.php?archivelist=linux
RewriteRule ^category([0-9]+).html			index.php?catid=$1&blogid=2
RewriteRule ^member([0-9]+).html			index.php?memberid=$1

As it is evident, the blogid of my site is 2, and the short name of the blog is ‘linux’. It eludes me completely why the arguments are used so inconsistently. What would be the problem with using either blogid or the short name every time? Of course, clarity and consistency would rise uncontrollably, but besides that?

With these rules in place, all that remains is to work through all the parts of the skin and the related templates to use links of the above kind.

The only other change I have made to my Nucleus installation is that I have installed the SmartParagraphs plugin. It makes writing a lot easier. I have extended the plugin a bit and fixed few bugs, as described on the Nucleus CMS forum. A gzipped copy of my updated SmartParagraphs plugins can be downloaded here: NP_SmartParagraphs.php.gz