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.
#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.
#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
#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
AuthUser=YOURADRRESS@gmail.com
AuthPass=PASSWORD
useSTARTTLS=YES

No need to restart the mail server.

Test Email:
Code:
echo "sample text" | mail -s "Subject" username@domain.com

(username@domain.com 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
   MAILTO=username@gmail.com


====== 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]
#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


#6
If anyone is interested, I can post the instructions.
บาคาร่าผ่านเว็บ
#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


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

Forum Jump:


Users browsing this thread: 1 Guest(s)