Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Dokuwiki Setup
##Install some extra packages for FPM
sudo aptitude install php5-fpm php5-gd php5-mcrypt
##Tigten PHP security
#Disable path info
sudo cp /etc/php5/fpm/php.ini /etc/php5/fpm/php.ini.default
sudo sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php5/fpm/php.ini
#Change PHP to use sockets instead of ports --already done by default in Debian & Ubuntu
sudo sed -i 's/listen = .*/listen = \/var\/run\/php5-fpm.sock/' /etc/php5/fpm/pool.d/www.conf
##Download the latest DokuWiki from the website:
sudo tar zxvf dokuwiki-*.tgz -C /home/www/wiki
sudo chown -R www-data:www-data /home/www/wiki
##Setup NginX
server {
listen 80;
access_log /home/www/;
error_log /home/www/ warn;
index index.html index.htm;
root /home/www/;
location /wiki {
root /home/www/;
index index.php doku.php index.html index.htm;
#Secure DokuWiki
location ~ /(data|conf|bin|inc)/ { deny all; }
location ~ /(install.php|\.ht) { deny all; }
#Serve non-php files directly from NginX
location ~ /lib/^((?!php).)*$ {
expires 30d;
#Connection with PHP5 FPM
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $uri;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.