Kallobombus Setup

This page documents my initial Kallobombus setup. When I got the server, it had practically nothing installed. Here are my collected notes.

Kallobombus

1. set the root password

2. click the reconfigure networking button

3. verify that it’s reachable: `ping 192.121.170.192`

4. connect using ssh

If that doesn’t work, you might have to create a serial console, connect, and issue a `service ssh start`.

As root:

apt-get update
apt-get upgrade
apt-get autoremove
apt-get install emacs rsync sudo
adduser alex
usermod -a -G sudo alex
login alex
mkdir bin
emacs bin/restore

Save this as bin/restore:

#!/bin/bash
cd
for d in \
    .bash_aliases .bashrc .emacs .forward .gitconfig .profile \
    .rc2mail Makefile bin elisp password.pl rsync.conf src ssl
    alexschroeder alexschroeder.ch \
    arabisch-lernen arabisch-lernen.org \
    campaignwiki campaignwiki.org \
    claudia \
    communitywiki communitywiki.org \
    helmut \
    hug \
    mark \
    oddmuse oddmuse.org \
    orientalisch orientalisch.info \
    paper \
    zengarden;
do
    sudo rsync -ogazi kensanata@theshire.emacs.cl:$d .
done

Continue as alex:

bin/restore
for d in alexschroeder arabisch-lernen campaignwiki \
    claudia communitywiki helmut hug mark oddmuse \
    orientalisch paper zengarden; do
    bin/fix-data-dir-permissions
done

Return to root, install the rest, get a copy of setup:

apt-get install less ssh w3m libwww-perl \
  libxml-rss-perl libmime-base64-perl libxml-libxml-perl \
  git apache2 munin monit make telnet \
  checksecurity lockfile-progs bsd-mailx mutt cron-apt \
  fail2ban strace libtime-modules-perl \
  bzip2 unzip dialog makepatch man info \
  subversion git python-pygments libmime-tools-perl \
  libnet-smtp-ssl-perl libauthen-sasl-perl \
  colordiff
apt-get remove tripwire
dpkg-reconfigure locales # pick en_US.UTF-8

Once you’re here, w3m http://localhost/ should already work and show the first wiki. I’ll write more on Kallobombus Apache.

http://localhost/

Kallobombus Apache

Also, as alex:

EDITOR=emacs crontab -e

Copy the cronjobs from the old server:

MAILTO=kensanata@gmail.com
1. 02  5  *   *   *     /home/alex/bin/maintain-campaignwiki
1. 47 4,16 *  *   *     /home/alex/bin/backup
1. 28  4  *   *   *     /home/alex/bin/subscriptions

The entries are commented because we don’t want to start running the scripts until the new site is up and running! Here’s my checklist.

1. set $EditAllowed = 0 on the old sites

2. change the DNS entries

3. run bin/restore on the new site to get the most recent copy

4. set $EditAllowed = 1 on the new sites

5. uncomment crontab

6. crontab -r (remove) on the old site!

Wiki Migration

Back to my checklist.

1. set $EditAllowed = 0 on the old sites (locking all the sites)

2. run bin/restore on the new site to get the most recent copy

3. change the DNS entries

4. set $EditAllowed = 1 on the new sites

5. uncomment crontab

Locking all the wikis by modifying their config files takes too long. My Campaign Wiki site uses namespaces and each needs to be locked!

alex@psithyrus:~$ find -name pageidx|wc -l
177

The solution is to add the noedit file. But I need to remember which wikis have already been locked.

alex@psithyrus:~$ find -name noedit
./communitywiki/noedit
./zengarden/noedit
./campaignwiki/TheAlderKing/noedit
./campaignwiki/PerseusSektor/noedit
./campaignwiki/GoldenLanterns/noedit
./campaignwiki/Kaylash/noedit

Creating the necessary files:

for f in $(find -name pageidx); do
  d=$(dirname "$f");
  if [[ ! -f "$d/noedit" ]]; then
    touch "$d/noedit";
  fi;
done

This creates the noedit files as user alex, where as the others where created by the user www-data. On the new system, removing these is easy:

find -user alex -name noedit -exec rm {} \;

Comments

(Please contact me if you want to remove your comment.)

Didn’t you unlock the already locked wikis with your last command?

– Harald 2014-07-05 12:43 UTC

Harald

---

No. This is not apparent from the main page, but the locks created by users using the wiki interface will be owned by www-data. The locks I created using the shell will be owned by alex. The find command at the end only found the locks I created and skipped the ones that had been created by users.

– Alex Schroeder 2014-07-05 14:58 UTC

Alex Schroeder