Hello everyone,
I've tried to install Dokuwiki on my Ubuntu 14.04 server that has a LEMP stack (so Nginx) and from the Ubuntu repositories. I have one problem, the permissions are somewhere screwed.
I am getting
{DOCUMENT_ROOT}/conf/ is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/pages is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/attic is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/media is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/media_attic is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/media_meta is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/meta is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/cache is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/locks is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/index is not writable by DokuWiki. You need to fix the permission settings of this directory!
{DOCUMENT_ROOT}/data/tmp is not writable by DokuWiki. You need to fix the permission settings of this directory!
Ok, no big deal, this happens quite a lot so I went in and dove to those folders.
Because the biggest problem was the data folder I went to /var/lib/dokuwiki where the data folder is storaged
root@server:/var/lib/dokuwiki# ls -ls
total 12
4 drwx------ 2 www-data root 4096 Jan 12 11:02 acl
4 drwx------ 12 www-data root 4096 Jan 12 11:02 data
0 lrwxrwxrwx 1 root root 23 Jan 4 2014 inc -> /usr/share/dokuwiki/inc
4 drwxr-xr-x 4 root root 4096 Jan 12 11:02 lib
And this is where it gets odd, www-data has full permissions on that folder and nginx runs under this user
root@server:/var/lib/dokuwiki# ps -ef | grep nginx
root 7631 1 0 11:15 ? 00:00:00 nginx: master process /usr/sbin/nginx
www-data 7634 7631 0 11:15 ? 00:00:00 nginx: worker process
www-data 7635 7631 0 11:15 ? 00:00:00 nginx: worker process
www-data 7636 7631 0 11:15 ? 00:00:00 nginx: worker process
www-data 7637 7631 0 11:15 ? 00:00:00 nginx: worker process
Anyone has an idea why? Same for config folder (/etc/dokuwiki)
root@server:/etc# ls -ls | grep dokuwiki
4 drwxrwxr-x 2 root www-data 4096 Jan 12 11:02 dokuwiki
My nginx server config is
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/dokuwiki;
index doku.php index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
#Make install inaccessible after installation!
#location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }
location / {
try_files $uri $uri/ @dokuwiki;
}
location @dokuwiki {
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1&$args last;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}