Setup of local wiki on Ubuntu

From Stephan

Jump to: navigation, search

For technical documentation on my PC, I also rather choose to quickly setup a wiki instead of dumping characters in a bunch of text files which I afterwards can not organize easily.

But for backup reasons, I try to change a few things on the standard configuration so the uploaded files and database files are on a location which are automatically backed up using a current online backup system I use (Dropbox).

First I install apache and php5 (with some standard additional extension packages):

sudo apt-get install apache2 php5 php5-mysql php5-gd php5-imagick mysql-server mysql-admin

Contents

Modify locations

Apache

sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/localwiki
mkdir /home/stephanbosal/Dropbox/www
sudo gedit /etc/apache2/sites-available/localwiki
sudo ln -s ../sites-available/localwiki  001-localwiki
sudo rm 000-default

Enable mod_rewrite

This is necessary for the short URLs to be used in wiki

sudo ln -s ../mods-available/rewrite.load ./rewrite.load
sudo /etc/init.d/apache2 restart

PHP

PHP does not really need to be modified, but we can use php to check some settings first: Add a file on the www-root (in this case /home/stephanbosal/Dropbox/www called index.php and enter this code in it:

<?php
     phpinfo();
?>

Now go to http://127.0.0.1 and you should see a page with a lot of configuration data. This can be helpful sometimes.

MySQL

sudo gedit /etc/mysql/my.cnf
/var/lib/mysql

Backup script

gedit ~/Dropbox/scripts/bckmysql.sh
#/bin/sh!
#If you do not have Upstart, change next line to sudo /etc/init.d/mysql stop
sudo stop mysql
sudo rsync -a --delete /var/lib/mysql /home/stephanbosal/Dropbox/backup/
#This is so Dropbox can read the files, at restore, do a chown/chmod to original settings (mysql:mysql 700):
sudo chown -R stephanbosal:stephanbosal /home/stephanbosal/Dropbox/backup/
sudo chmod -R 755 /home/stephanbosal/Dropbox/backup/
#If you do not have Upstart, change next line to sudo /etc/init.d/mysql start
sudo start mysql
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox