User Tools

Site Tools


installing_dokuwiki_on_ubuntu_18.04_using_nginx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
installing_dokuwiki_on_ubuntu_18.04_using_nginx [2019/03/20 15:26]
admin removed
installing_dokuwiki_on_ubuntu_18.04_using_nginx [2019/03/20 15:27] (current)
admin created
Line 1: Line 1:
 +====== Installing dokuwiki on Ubuntu 18.04 using nginx ======
 +
 +An example of my nginx conf for this subdomain based wiki:
 +
 +<​code>​
 +server {
 +  server_name wiki.armchairscientist.co.uk;​
 +  root /​usr/​share/​dokuwiki;​
 +
 +  location / {
 +    index doku.php;
 +    try_files $uri $uri/ @dokuwiki;
 +  }
 +
 +  location ~ ^/​lib.*\.(gif|png|ico|jpg)$ {
 +    expires 30d;
 +  }
 +
 +  location ^~ /conf/ { return 403; }
 +  location ^~ /data/ { return 403; }
 +
 +  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 last;
 +  }
 +
 +  location ~ \.php$ {
 +    include fastcgi_params;​
 +    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;​
 +    fastcgi_pass unix:/​var/​run/​php/​php7.2-fpm.sock;​
 +  }
 +}
 +</​code>​
 +
 +Once that is set up, you'll notice an error with the CSS.  This is due to a string/​array concatenation bug.  You can fix this by replacing line 169 (''​$less->​importDir[] = DOKU_INC;''​) with the following three lines:
 +
 +<​code>​
 +  if(!is_array($less->​importDir))
 +    $less->​importDir = array();
 +    $less->​importDir[] = DOKU_INC;
 +</​code>​
 +
  
installing_dokuwiki_on_ubuntu_18.04_using_nginx.txt ยท Last modified: 2019/03/20 15:27 by admin