Dokuwiki on the Pine64
#1
I got Dokuwiki running on PHP7 and Nginx, and it rocks.  I have my main wiki running on a RasPi2 and page loads take a second or two and page saves take 2-3.  On the Pine64 2GB it is under a second.  What a difference!

If anyone is interested, I can post the instructions.
  Reply
#2
(05-04-2016, 08:31 PM)JCMPine64 Wrote: I got Dokuwiki running on PHP7 and Nginx, and it rocks.  I have my main wiki running on a RasPi2 and page loads take a second or two and page saves take 2-3.  On the Pine64 2GB it is under a second.  What a difference!

If anyone is interested, I can post the instructions.

Please post the instruction and I will pin the thread.
  Reply
#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 [email protected]

(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
  Reply
#4
====== Email Setup ======
The password for gmail will be readable by root, so the best thing to do is to turn on two-step verification in Gmail.

Install Mail (mpack is for mail attachments, which I didn't install):
Code:
sudo apt-get install ssmtp
sudo apt-get install mailutils
sudo apt-get install mpack

Configure Mail:
Edit and modify/add lines as necessary
Code:
sudo nano /etc/ssmtp/ssmtp.conf

Code:
mailhub=smtp.gmail.com:587
hostname=HOSTNAME
[email protected]
AuthPass=PASSWORD
useSTARTTLS=YES

No need to restart the mail server.

Test Email:
Code:
echo "sample text" | mail -s "Subject" [email protected]

([email protected] is the destination address)

If you want to have Crontab email after each activity, set Crontab to use a specific email address:
Code:
sudo crontab -e
   [email protected]


====== Source Information ======
http://www.sbprojects.com/projects/raspb.../exim4.php

https://rpi.tnet.com/project/faqs/smtp

[url= https://rpi.tnet.com/project/faqs/smtp][/url]
  Reply
#5
Easy to understand and well documented process. Thanks! will give this a try in the near future
You can find me on IRC, Discord and Twitter


  Reply
#6
If anyone is interested, I can post the instructions.
บาคาร่าผ่านเว็บ
  Reply
#7
php5 is available in the debian build. php7 is unable to be found. rather that fight whatever battles necessary to eventually get a php7 enviroment in place is using php5 o.k. and i guess it does not present any problems?

edit: i used synaptic to install php5 and debian goes ahead and installs apache at the same time. interestingly now when i enter ip of pine64 board i get an apache welcome page instead of nginx , which i had installed last night prior to anything else and at first got a nginx welcome screen. i wonder why apache now overrules nginx. both are running
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  PINE64 board not powering up loki21century 0 25 09-20-2019, 04:29 AM
Last Post: loki21century
  Pine64 not powering up. skylab 5 396 05-03-2019, 02:48 PM
Last Post: Mendota
  Pine64 LTS vs Rock64 4 GB LTS gops 2 195 04-15-2019, 10:56 AM
Last Post: gops
Thumbs Down Pine64 was a Useless Project pushpendrak 14 3,153 03-07-2019, 08:48 AM
Last Post: dkryder
  Pine64+ 2GB board for sale with WiFi module and case ~clumsy~ 1 409 10-21-2018, 04:54 AM
Last Post: aeiltz
  Video Chat with Pine64 mathiraj 0 249 07-02-2018, 02:33 PM
Last Post: mathiraj
  Selling my PINE64 2GB Set Philippines / Asia only $115 racann 4 2,111 06-17-2018, 12:53 PM
Last Post: racann
  Supply DC power to Pine64 via Pi-2 Connector & Euler Bus? crapped 2 518 05-24-2018, 01:58 AM
Last Post: crapped
Shocked Selling my PINE64 2GB+ board with WIFI/BT module and extras $30 or best bid in ebay moondark 0 367 04-14-2018, 12:31 PM
Last Post: moondark
  Is possible to install Home Assistant on pine64 2gb? polv89 1 1,383 04-02-2018, 05:22 PM
Last Post: tllim

Forum Jump:


Users browsing this thread: 1 Guest(s)