Anchor CMS Blog Debian Jessie

Basic installation of anchor blog for Debian Jessie

Anchor is a super-simple, lightweight blog system, made to let you just write.

Basic installation of the anchor blog, version 0.9.2 with apache and mysql

Configuration summary

Debian Jessie 8 Debian Jessie 8
Package apache2 install
Files

/var/www/blog/anchor-cms-0.9.2/.htaccess ensure file exist

Options -indexes

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /

	# Allow any files or directories that exist to be displayed directly
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d

	# Rewrite all other URLs to index.php/URL
	RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
	ErrorDocument 404 index.php
</IfModule>

/var/www ensure directory exist

/var/www/blog Permissions: www-data : www-data ensure directory exist

/var/www/blog/anchor-cms-0.9.2 Permissions: www-data : www-data (Recursive) ensure directory exist

Hooks

Post install-anchor

- parameter 1: http://anchorcms.com/download
#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

unzip $1 -d /var/www/blog/

chown www-data:www-data -R /var/www/blog

Post enable-modrewrite

#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

a2enmod rewrite

/etc/init.d/apache2 reload

Post configure-apache

#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

a2dissite 000-default

/etc/init.d/apache2 reload
Package apache2.2-common install
Files

/etc/apache2/sites-enabled/blog.conf ensure file exist

<VirtualHost _default_:80>
        DocumentRoot /var/www/blog/anchor-cms-0.9.2/
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

/etc/apache2/sites-enabled ensure directory exist

Hooks

Post reload-apache

#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

# force reload apache after the files has been installed
/etc/init.d/apache2 reload
Package mysql-server install
Hooks

Post create-anchor-database

#!/bin/bash
# make sure you do not use an uninitialised variable
set -u

# script will exit at first error
set -e

echo "CREATE DATABASE anchor;" | mysql
Package curl install
Package php5-curl install
Package libapache2-mod-php5 install
Package php5-mcrypt install
Package php5-gd install
Package unzip install
Package php5-mysql install
Package php5-sqlite install

Quick Deployment
Advanced Deployment