Difference between revisions of "The Calaka system"

From Organic Design wiki
m (The Reinbek HTML site)
m (Calaka wiki)
Line 4: Line 4:
 
The Calaka wiki is a standard MediaWiki codebase with its script root in ''/var/www/domains/rene/calaka''. It uses friendly URLs (''$wgArticlePath = "/$1"'') and has the following Apache configuration section which is designed to fit in with the many other sites running on the server in the same virtual host container. The ''HTTP_HOST'' condition means that the rules will apply to any domain or sub-domain having "calaka" anywhere within it, unless the domain has already been matched by another rule prior to this section (e.g. ''svn.calaka.net'' or ''reinbek.calaka.net'').
 
The Calaka wiki is a standard MediaWiki codebase with its script root in ''/var/www/domains/rene/calaka''. It uses friendly URLs (''$wgArticlePath = "/$1"'') and has the following Apache configuration section which is designed to fit in with the many other sites running on the server in the same virtual host container. The ''HTTP_HOST'' condition means that the rules will apply to any domain or sub-domain having "calaka" anywhere within it, unless the domain has already been matched by another rule prior to this section (e.g. ''svn.calaka.net'' or ''reinbek.calaka.net'').
 
{{code|<pre>
 
{{code|<pre>
RewriteCond %{HTTP_HOST} calaka
+
RewriteCond %{HTTP_HOST} calaka
RewriteCond %{REQUEST_URI} ^/$
+
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* /var/www/domains/rene/calaka/index.php?title=Hauptseite&redirect=no [L]
+
RewriteRule .* /var/www/domains/rene/calaka/index.php?title=Hauptseite&redirect=no [L]
  
RewriteCond %{HTTP_HOST} calaka
+
RewriteCond %{HTTP_HOST} calaka
RewriteCond %{REQUEST_URI} ^/rene/calaka/thumb/./../.*\&
+
RewriteCond %{REQUEST_URI} ^/rene/calaka/thumb/./../.*\&
RewriteRule ^(.*?)\&(.*)$ $1\%26$2
+
RewriteRule ^(.*?)\&(.*)$ $1\%26$2
  
RewriteCond %{HTTP_HOST} calaka
+
RewriteCond %{HTTP_HOST} calaka
RewriteCond %{REQUEST_URI} ^/files/thumb/./../.+?/[0-9]+px-
+
RewriteCond %{REQUEST_URI} ^/files/thumb/./../.+?/[0-9]+px-
RewriteRule ^.+/(.+?)/([0-9]+)px- /var/www/domains/rene/calaka/thumb.php?w=$2&f=$1 [L]
+
RewriteRule ^.+/(.+?)/([0-9]+)px- /var/www/domains/rene/calaka/thumb.php?w=$2&f=$1 [L]
  
RewriteCond %{HTTP_HOST} calaka
+
RewriteCond %{HTTP_HOST} calaka
RewriteCond /var/www/domains/rene/calaka%{REQUEST_FILENAME} !-f
+
RewriteCond /var/www/domains/rene/calaka%{REQUEST_FILENAME} !-f
RewriteCond /var/www/domains/rene/calaka%{REQUEST_FILENAME} !-d
+
RewriteCond /var/www/domains/rene/calaka%{REQUEST_FILENAME} !-d
RewriteRule (.*) /var/www/domains/rene/calaka/index.php$1 [L]
+
RewriteRule (.*) /var/www/domains/rene/calaka/index.php$1 [L]
  
RewriteCond %{HTTP_HOST} calaka
+
RewriteCond %{HTTP_HOST} calaka
RewriteRule (.*) /var/www/domains/rene/calaka/$1 [L]
+
RewriteRule (.*) /var/www/domains/rene/calaka/$1 [L]
 
</pre>}}
 
</pre>}}
  

Revision as of 20:37, 16 April 2013

The Calaka system is running within the Organic Design server environment which has been installed with this procedure. To fit in with this structure, all the Calaka-specific installation has been put into the directory /var/www/domains/rene. Within this directory is the Calaka MediaWiki, the reinbek HTML site, and the Subversion repositories. These are all described in more detail below.

Calaka wiki

The Calaka wiki is a standard MediaWiki codebase with its script root in /var/www/domains/rene/calaka. It uses friendly URLs ($wgArticlePath = "/$1") and has the following Apache configuration section which is designed to fit in with the many other sites running on the server in the same virtual host container. The HTTP_HOST condition means that the rules will apply to any domain or sub-domain having "calaka" anywhere within it, unless the domain has already been matched by another rule prior to this section (e.g. svn.calaka.net or reinbek.calaka.net).

RewriteCond %{HTTP_HOST} calaka
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* /var/www/domains/rene/calaka/index.php?title=Hauptseite&redirect=no [L]

RewriteCond %{HTTP_HOST} calaka
RewriteCond %{REQUEST_URI} ^/rene/calaka/thumb/./../.*\&
RewriteRule ^(.*?)\&(.*)$ $1\%26$2

RewriteCond %{HTTP_HOST} calaka
RewriteCond %{REQUEST_URI} ^/files/thumb/./../.+?/[0-9]+px-
RewriteRule ^.+/(.+?)/([0-9]+)px- /var/www/domains/rene/calaka/thumb.php?w=$2&f=$1 [L]

RewriteCond %{HTTP_HOST} calaka
RewriteCond /var/www/domains/rene/calaka%{REQUEST_FILENAME} !-f
RewriteCond /var/www/domains/rene/calaka%{REQUEST_FILENAME} !-d
RewriteRule (.*) /var/www/domains/rene/calaka/index.php$1 [L]

RewriteCond %{HTTP_HOST} calaka
RewriteRule (.*) /var/www/domains/rene/calaka/$1 [L]

The Reinbek HTML site

Another plain HTML site is served from the /var/www/domains/rene/reinbek directory. This directory is an automatically updated subversion working copy of the reinbek repository. This automatic updating is achieved by adding the following one line shell script into /var/www/domains/rene/svn/reinbek/hooks/post-commit which simply calls svn update whenever a commit has completed to the reinbek repository.

#!/bin/sh
svn update /var/www/domains/rene/reinbek

This means that the reinbek site can be modified simply by adjusting the local working copy and committing the changes, there's no need to log into the server and update anything to make the changes take effect, and no need to wait as the update will occur immediately after the commit is complete.

The Apache configuration for the reinbek site is done with the following rules. These must appear before the calaka rules because the reinbek site's domain is reinbek.calaka.net which means that the calaka rules would also match the domain and apply. The rules are such that a dedicated domain such as reinbek.info could later be pointed at the server's IP and bring up the site without any configuration change being required.

RewriteCond %{HTTP_HOST} reinbek
RewriteRule (.*) /var/www/domains/rene/reinbek$1 [L]

Databases

Calaka has two databases, "calaka" and "reinbek" which are both accessible by the "calaka" user. The calaka database has 506 table which include many different currently unused applications such as wordpresses etc.

Subversion repositories