Dokuwiki on the Pine64
#3
Installing Dokuwiki on the Pine64

I started with a 2GB Pine64 running longsleep's latest xenial ubuntu version. 
For these instructions:
Server address: 192.168.1.206
Wiki name: New Wiki
Wiki data file location: /mount/media/Media/Wiki


====== DokuWiki Setup ======

===== Install and configure PHP7 =====
(If installing on RaspberryPi using PHP5, see the [[DokuWiki Setup#Source Information|Source Information Section]])

Install PHP7
Code:
sudo apt-get install php7.0
sudo apt-get install php7.0-xml


Tighten up some security in php.ini by uncommenting and altering cgi.fix entry
Code:
sudo nano /etc/php/7.0/fpm/php.ini
   cgi.fix_pathinfo=0

Ensure that PHP processor looks for connections using a socket instead of a port on our local interface.
Code:
sudo nano /etc/php/7.0/fpm/pool.d/www.conf  
   listen = /var/run/php5-fpm.sock

Restart PHP7
Code:
sudo service php7.0-fpm restart


===== Install and configure Nginx =====

Install Nginx
Code:
 sudo apt-get install nginx
sudo service nginx start

Create the www directory
Code:
cd /usr/share/nginx
sudo mkdir www

Visit the server address in browser to verify that nginx is running and displays a welcome screen
Code:
192.168.1.206

Configure nginx default server block
Code:
sudo nano /etc/nginx/sites-available/default

Alter file to look like this:
Code:
server {
       listen 80 default_server;
       listen [::]:80 default_server;

       #root /var/www/html;
       root /usr/share/nginx/www;

       # Add index.php to the list if you are using PHP
       index index.php index.html index.htm index.nginx-debian.html;

       server_name 192.168.1.206;

       location / {
               # First attempt to serve request as file, then
               # as directory, then fall back to displaying a 404.
               try_files $uri $uri/ =404;
       }

       error_page 404 /404.html;

       error_page 500 502 503 504 /50x.html;
       location = /50x.html {
           root /usr/share/nginx/www;
       }

       # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
       #
       location ~ \.php$ {
               include snippets/fastcgi-php.conf;

               # With php7.0-cgi alone:
               #fastcgi_pass 127.0.0.1:9000;
               # With php7.0-fpm:
               fastcgi_pass unix:/run/php/php7.0-fpm.sock;
       }


       # deny access to .htaccess files, if Apache's document root
       # concurs with nginx's one
       #
       location ~ /\.ht {
               deny all;
       }
   location ~ /(data|conf|bin|inc)/ {
       deny all;
   }
}

Restart Nginx
Code:
sudo service nginx restart
 
===== Test PHP processing =====

Create test file
Code:
sudo sh -c 'echo "<?php phpinfo(); ?>" > /usr/share/nginx/www/info.php'  

In browser type
Code:
192.168.1.206/info.php

If everything is correctly configured, a PHP config screen will be displayed.

Remove the test file
Code:
sudo rm /usr/share/nginx/www/info.php

===== Install and configure Dokuwiki =====
Download the DokuWiki file into the home directory
Code:
cd ~
wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz

Extract the files and then delete the tarball
Code:
tar xzvf dokuwiki-stable.tgz
rm dokuwiki-stable.tgz
 
Change the name of the directory and move it to the web root
Code:
mv doku* wiki  
sudo mv wiki /usr/share/nginx/www/
 
Change the web root directory and change ownership
Code:
cd /usr/share/nginx/www/wiki  
sudo chown -R www-data data
sudo chown www-data lib/plugins/
sudo chown www-data conf
sudo chown www-data lib/ -R

Start Dokuwiki installer in browser
Code:
192.168.1.206/wiki/install.php  
 
Fill in the name of the wiki and other items.  Save.
(You may get a warning about the data directory.  Taken care of  next.)

===== Move wiki page file location =====
DokuWiki files are located by default at:
Code:
/usr/share/nginx/www/wiki

If starting fresh, move the data directory to the desired location:
Code:
sudo cp -R data /mount/media/Media/Wiki

Change the data directory to point to the wiki data directory
Code:
cd /usr/share/nginx/www/wiki/conf
sudo nano local.php
 $conf['savedir'] = '/mount/media/Media/Wiki/data';

 
Local.php will look something like this
Code:
$conf['title'] = 'New Wiki';
$conf['license'] = 'cc-by-sa';
$conf['savedir'] = '/mount/media/Media/Wiki/data';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
$conf['disableactions'] = 'register';

===== Plugins =====
 - Arctic Template
 - Avatar (sets avatar for discussion threads)
 - Add new page (creates input field for creating new pages)
 - Comment (allows edit comments in pages that don't display on page)
 - Discussion Plugin (adds discussion sections to all pages)
 - Color syntax (allows use of color text)
 - Searchindex manager (rebuild site index - useful after first install if using pre-existing data directory)
 - Wrap (text formatting)
 - Tag (page tagging)
 - Pagelist (required by tag plugin)
 - Sortablejs (table sorting)
 - Rater (page rating)

===== Configuration =====
 - Set "Maximum section edit level" = 0
 - Set "Minimum headers for TOC" = 10
 - Set the "From" email address to NewDokuWiki@gmail.com

(need to have email set up on Pine64.  See next post.)

===== Arctic Template Mods =====
 - Set sidebar to 'right'


====== Source Information ======
Install Dokuwiki on Ubuntu Using PHP5

Move Data Directory


Messages In This Thread
Dokuwiki on the Pine64 - by JCMPine64 - 05-04-2016, 08:31 PM
RE: Dokuwiki on the Pine64 - by tllim - 05-05-2016, 12:50 AM
RE: Dokuwiki on the Pine64 - by JCMPine64 - 05-05-2016, 08:00 AM
RE: Dokuwiki on the Pine64 - by JCMPine64 - 05-07-2016, 11:41 AM
RE: Dokuwiki on the Pine64 - by Luke - 05-07-2016, 01:05 PM
RE: Dokuwiki on the Pine64 - by swinging - 01-06-2017, 01:51 AM
RE: Dokuwiki on the Pine64 - by dkryder - 01-06-2017, 05:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question External storage problem for pine64 Dani6102 4 2,641 08-22-2023, 08:36 AM
Last Post: gulshan212
  Pine64 as wireless audio device S265 3 4,101 04-07-2022, 10:39 PM
Last Post: S265
  Pine64(+) and manjaro dsychan 0 1,462 04-05-2022, 11:32 PM
Last Post: dsychan
Thumbs Down Pine64 was a Useless Project pushpendrak 18 32,179 11-21-2020, 10:17 PM
Last Post: tllim
  Pine64 LCD rstcologne 0 3,445 09-22-2020, 12:43 PM
Last Post: rstcologne
  Pine64+ power button PaddyChan 0 3,116 09-14-2020, 09:55 AM
Last Post: PaddyChan
  Pine64 OS dpcons 2 5,480 03-02-2020, 04:32 PM
Last Post: dpcons
  Jailhouse supports Pine64+ vj-kumar 0 3,144 02-17-2020, 11:39 PM
Last Post: vj-kumar
  PINE64 board not powering up loki21century 2 6,264 11-25-2019, 12:19 PM
Last Post: Partymack711
  Pine64 not powering up. skylab 5 8,283 05-03-2019, 02:48 PM
Last Post: Mendota

Forum Jump:


Users browsing this thread: 1 Guest(s)