Set up dokuwiki on ubuntu 16.04

sudo apt-get update
sudo apt-get install nginx
sudo service nginx start
sudo apt-get install php-fpm php-gd php7.0-xml


edit:/etc/php/7.0/fpm/php.ini
with cgi.fix_pathinfo=0

sudo service php7.0-fpm restart

content of /etc/nginx/site-available/wiki


server {    listen  80;
    root /usr/share/nginx/html;    
    index index.php index.html index.htm;
    server_name wiki.wikihost.tk;
    location / {        try_files $uri $uri/ /index.html;    }
    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;    location = /50x.html {        root /usr/share/nginx/html;    }
    location ~ \.php$ {        try_files $uri =404;        fastcgi_pass unix:/run/php/php7.0-fpm.sock;        fastcgi_index index.php;        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        include fastcgi_params;    }
    location ~ /\.ht {        deny all;    }
    location ~ /(data|conf|bin|inc)/ {        deny all;    }
location = / {
 return 301 http://$host/wiki/doku.php;
}
}



Test php:
sudo sh -c 'echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/info.php'

open in browser
server_domain_or_IP_address/info.php

Install dokuwiki
cd ~
wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz

This will download a tarball into your current directory. Extract the directory structure by typing:

tar xzvf dokuwiki-stable.tgz

We can now delete the tarball by typing:

rm dokuwiki-stable.tgz

Let’s change the name of the directory to whatever path we’d like to access our wiki from. We will use wiki for this guide:

mv doku* wiki

We should move our directory into our web root. This will allow us to access our server by typing our domain followed by /wiki. Move the directory now:

sudo mv wiki /usr/share/nginx/www/

Before we continue, we need to do some additional security steps, or the installer will complain that it cannot access certain areas. Change to the directory you just moved:

cd /usr/share/nginx/www/wiki

The web process needs to have certain access to some files and directories within the wiki structure.

sudo chown -R www-data data
sudo chown www-data lib/plugins/
sudo chown www-data conf

Now, we are ready to install DokuWiki through the web browser using an installer script.

In your browser, go to your domain or IP address followed by the wiki sub directory and install.php:

server_domain_or_IP_address/wiki/install.php
 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s