Tempêtes et verre de toaka gasy

Vue imprenable des bas-cotés de la planète, à Antananarivo.
Billet classé dans la catégorie : web

samedi 13 mars 2004

[ 12:02  ] Publishing a blosxom blog on a Mac.com account

This post will probably irritate some french speaking readers as well as lovers of the english language, but this is a quick and dirty adaptation of an e-mail which may be useful for other people.

Many MacOS X users users are interested in running a blosxom blog ; they may also have a mac.com account.

Following a request in the blosxom mailing list, here is a short description of my configuration for publishing a blosxom blog on a mac.com account.

.Mac does not run CGIs, so Blosxom runs on my local machine.

1/ Initial setup

My datadir must be readable by the www user, so I put it at :

$datadir = "/Users/my_macintosh_username/blosxom/posts";

(replace my_macintosh_username by your short login name)

The plugins are configured this way :

# --- Plugins (Optional) -----

# Where are my plugins kept?

$plugin_dir = "/Users/my_macintosh_username/blosxom/plugins";

# Where should my modules keep their state information?

$plugin_state_dir = "$plugin_dir/state";

I setup the access rights for the state directory (/Users/my_macintosh_username/blosxom/plugins/state) to 775, owner www, group my_macintosh_username.

Blosxom is used to generate static pages on the Sites directory of my home, so that I can preview the site before uploading to .Mac through the URL http://127.0.0.1/~my_macintosh_username

# --- Static Rendering -----

# Where are this blog's static files to be created?

$static_dir = "/Users/my_macintosh_username/Sites";

2/ Day to day use

After writing a post, I run a shell script which generates the static pages :

perl /Library/WebServer/CGI-Executables/blosxom.cgi -password="My_static_password_here" ${*}

This script contains also instructions to rename some files to my liking (for instance, I find it easier having index.rss renamed rss.xml, index.atom renamed atom.xml...) and delete other files which I don't want to upload (for instance the daily archives, because monthly archives are enough for me...).

I can then check my writing by browsing at http://127.0.0.1/~my_macintosh_username.
After doing so, I upload to my iDisk through a shell script invoking rsync :

rsync -vaz --size-only --exclude=.DS_Store --stats --progress ~/Sites/ /Volumes/my_dotmac_login/Sites/

(replace my_dotmac_login by what is adequate). Of course, you'll have first to mount your iDisk to run the above.

To speedup the rsync process, you can add other --exclude options, for instance for the older archives. In fact, my current script contains :

rsync -vaz --size-only --exclude=.DS_Store --exclude=2002 --exclude=2003 --exclude=myPictures --stats --progress ~/Sites/ /Volumes/barijaona/Sites/

3/ Further enhancements you can consider

My setup uses the prefs plugin, which I use instead of Rael Dornsfed's config plugin because of some problems I encountered with static rendering, and can be downloaded here.

Among other things, this plugin is used to set a meta variable to the base address, whether blosxom runs in dynamic or static mode (http://127.0.0.1/cgi-bin/blosxom.cgi or http://blog.barijaona.com).

I use this meta variable in my templates in a <base ...> HTML directive, so that links within the blog function both in dynamic and static rendering.
Commentaires du blog hébergés par Disqus


<- Cause (... publie, émets) toujours
Première sortie convalescente ->
 Accueil |  Humour | Macintosh | Bidouilles | Sélection | Éditeur 

© 2004 Barijaona Ramaholimihaso
Réagissez par les liens de commentaires ou par e-mail :