Archive for the ‘website’ Category

Photo Gallery

Sunday, May 13th, 2007

I have finally got a photo gallery up and running. It is still a work in progress, but contains many of my photos from the last two years. I am continuing to add more all the time and will hopefully begin adding Christine’s photos soon as well. You can access it by clicking on “Photo Gallery” in the “Links” section on the right of the blog homepage. Also, if you click on the “Random Image” on the right side of the page it will take you to the gallery embedded in my blog. The embedded version doesn’t yet look as good as the native version, but I’m working on it.

To Chris’s Photo Gallery

For anyone that’s interested I am using Gallery 2 which is a great program with a clean layout. It allows for viewing photos and videos and includes a slideshow feature, allows for rating photos, and leaving comments.

exim4 setup

Saturday, October 1st, 2005

This howto is for exim4 setup on Debian Sarge and is likely a bit dated by now.

It was a big process getting exim4 working on debian. The main problem is because most of the howto’s out there are for those wanting to use exim4 as a relay to send mail to their ISP, but I wanted by own mail server. So here is how I did it:

Install Exim4

Install exim4 and the heavy daemon, needed for authentication against system passwords.

apt-get install exim4 exim4-daemon-heavy

Then answer the following questions:

Split configuration: Yes #seems like the logical thing to do
General type of mail configuration: internet site #I can deliver mail myself
System Mail Name: northfolk.ca #what should be after @ in e-mails
IP addresses to listen on: #leave blank to listen for all addresses
Other destinations for which mais is accepted: northfolk.ca #probaly not necessary if /etc/hosts is correctly configured, but I’ll be safe
Domains to relay for: #leave blank
Machines to relay for: 192.168.0.0/24 #I’ll relay for my local network without requiring authentication
Keep number of DNS-queries minimal: No #I’ve no idea what this means :-)

Use Maildirs

Set exim to use maildirs (because I will also use Courier for imap access)

edit /etc/exim4/update-exim4.conf.conf
add the following line at the bottom:

dc_localdelivery=’maildir_home’

Setup Authentication

I had the most difficulty here. /usr/share/doc/exim4-base/README.SMTP-AUTH has most of the necessary information:

Install sasl2 and add Debian-exim to the sasl group.

apt-get install sasl2-bin
adduser Debian-exim sasl

Then edit /etc/exim4/conf.d/auth/30_exim4-config_examples. Mine looks like this:

plain_saslauthd_server:
driver = plaintext
public_name = PLAIN
server_condition = ${if saslauthd{{$2}{$3}}{1}{0}}
server_set_id = $2
server_prompts = :
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif
#
login_saslauthd_server:
driver = plaintext
public_name = LOGIN
server_prompts = “Username:: : Password::”
# don’t send system passwords over unencrypted connections
# server_advertise_condition = ${if eq{$tls_cipher}{}{0}{1}}
server_condition = ${if saslauthd{{$1}{$2}}{1}{0}}
server_set_id = $1
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif

Generate a certifacate by running

/usr/share/doc/exim4-base/examples/exim-gencert

Okay. That’s all fine, but here is what the document didn’t tell me:

edit /etc/default/saslauthd

# This needs to be uncommented before saslauthd will be run automatically
START=yes

# You must specify the authentication mechanisms you wish to use.
# This defaults to “pam” for PAM support, but may also include
# “shadow” or “sasldb”, like this:
# MECHANISMS=”pam shadow”

MECHANISMS=”shadow”

The defaults for this file were to not run saslauthd automatically, and authentication mechanism was set to pam. We need shadow, so either set to shadow or add to pam.

The other thing I need to do was enable TLS (which is not enabled by default). The following will enable TLS and will only allow secure connections.

Create a new file /etc/exim4/conf.d/main/00_local

with the line:

MAIN_TLS_ENABLE = true

Restart Services

/etc/init.d/saslauthd restart
/etc/init.d/exim4 restart

You’re Done!!!

And that’s it. It took me over a week to put all the pieces together (I hope I haven’t forgotten anything with this howto), but now you can do it in 10 minutes.

Apache 2 Setup

Sunday, September 25th, 2005

I’ve had some experience with Apache 2, mostly adding aliases. For the multi-blog setup for Wordpress, I wanted to use virtual document roots, but still be able to set up aliases for the main website.

For example, I want chris.northfolk.ca or christine.northfolk.ca or john or tim or whoever.northfolk.ca to use a virtual document root specified /var/srv but www.northfolk.ca to use the default /var/www for a document root and still be able to add aliases for www.northfolk.ca that aren’t available for the blogs.

In the end, it was very simple, but took several hours to figure out (as is usually the case). All I had to do was rename /etc/apache2/sites-enabled/000-default to 002-default. Then specify ServerName www.northfolk.ca under the VirtualRoot section. I also removed the NameVirtualHost heading because Apache will report an error if this exists twice and specify port 80 becuase Apache does not allow * and *:80 to coexist.

#NameVirtualHost *

ServerName www.northfolk.ca
ServerAlias northfolk.ca

ServerAdmin webmaster@localhost

DocumentRoot /var/www/

Then I created a new file 001-wordpress to allow for virtual document roots:

NameVirtualHost *:80


UseCanonicalName Off
VirtualDocumentRoot /srv/www/%0
Options All


Options FollowSymLinks
AllowOverride All

Apache will try to match the virtual server with the higher number file first, then fall back to the lowest number file. So if the hostname is www.northfolk.ca or northfolk.ca Apache will use the 002 file, and if it is anything else it will fall back to the 001 file. This will allow me to add new blogs without having to modify the Apache configuration files. I only need to add a link at /var/srv/

northfolk.ca registered

Sunday, September 25th, 2005

I’ve registered northfolk.ca with easyDNS for the home of our new website. I chose them because they had a well organised website and I knew they supported dynamic DNS, which is a requirement for me. The cost of a static IP in Shanghai is RMB 1500 per month (about $210) and 10X the cost of a regular ADSL connection.

The plan for the website is to have the regular, static content (transfered from www.acmeart.com/~chris) running on zope and a blog section running on wordpress.

I’ll offer a blog to any member of my family and hope to be able to have a summary page combining several blogs together.