User Tools

Site Tools


webapps:dokuwiki

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
webapps:dokuwiki [2021/06/18 17:02] lucidwebapps:dokuwiki [2023/11/29 14:16] (current) – [DokuWiki Installation] lucid
Line 1: Line 1:
 ====== DokuWiki Installation ====== ====== DokuWiki Installation ======
  
-This install guide is a how-to for installing DokuWiki Ubuntu server 20.04.+This install guide is a how-to for installing DokuWiki Ubuntu server 22.04.
  
 ===== Prerequisites ===== ===== Prerequisites =====
 Packages required for DokuWiki to work: Packages required for DokuWiki to work:
  
-  sudo apt install php7.4 php7.4-common php7.4-cli php7.4-gd php7.4-mbstring php7.4-mysql php7.4-xml php7.4-ldap php7.4-fpm+  sudo apt install php8.1 php8.1-common php8.1-cli php8.1-gd php8.1-mbstring php8.1-mysql php8.1-xml php8.1-ldap php8.1-fpm
   sudo apt install nginx   sudo apt install nginx
  
-===== Compiling mcrypt PHP module =====+===== DokuWiki ===== 
 +Download and extract DokuWiki stable to the proper directory. 
 +  wget -c https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz 
 +  sudo tar -xvf "dokuwiki-stable.tgz" -C /var/www/ 
 +  sudo mv /var/www/dokuwiki* /var/www/dokuwiki
  
-First Check whether the mcrypt PHP module is present:+===== Configure nginx ===== 
 +Need to make the configuration file for nginx to point to the correct files. Make sure to change the domain to the correct one, a generic placeholder wiki.domainname.tld is used for this example config. 
 +  sudo nano /etc/nginx/conf.d/dokuwiki.conf 
 +Paste in the below configuration and save.
  
-  php -m | grep mcrypt+<code> 
 +server { 
 +    listen 80; 
 +    listen 443 ssl; 
 +    server_name wiki.domainname.tld; 
 +    root /var/www/dokuwiki/;
  
-To install the mcrypt PHP module we first need to satisfy the following prerequisites:+    access_log /var/log/nginx/dokuwiki.access.log; 
 +    error_log /var/log/nginx/dokuwiki.error.log;
  
-  sudo apt install php-dev libmcrypt-dev php-pear+    #ssl on; 
 +    #ssl_certificate /etc/letsencrypt/live/wiki.domainname.tld/fullchain.pem; 
 +    #ssl_certificate_key /etc/letsencrypt/live/wiki.domainname.tld/privkey.pem; 
 +    #ssl_session_timeout 5m; 
 +    #ssl_ciphers 'AES256+EECDH:AES256+EDH:!aNULL'; 
 +    #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
 +    #ssl_prefer_server_ciphers on;
  
-Now we are ready to install mcrypt PHP module on our Ubuntu 20.04 system:+    #add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:;"; 
 +    #add_header X-XSS-Protection "1; mode=block";
  
-  sudo pecl channel-update pecl.php.net +    index index.html index.php doku.php;
-  sudo pecl install mcrypt-1.0.4 +
-   +
-Open the ''/etc/php/7.4/cli/php.ini'' file and insert:+
  
-  extension=mcrypt.so+    location / { 
 +        try_files $uri $uri/ @dokuwiki; 
 +    }
  
-All doneWhen successful, checking for the presence of the mcrypt PHP module should produce the following output:+    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; 
 +    }
  
-  php -m grep mcrypt +    location ~ /(data|conf|bin|inc)/
-  mcrypt+        deny all; 
 +    }
  
 +    location ~* \.(css|js|gif|jpe?g|png)$ {
 +        expires 1M;
 +        add_header Pragma public;
 +        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
 +    }
  
-===== DokuWiki ===== +    location ~ \.php$ { 
-Download and extract DokuWiki stable to the proper directory+        fastcgi_split_path_info ^(.+\.php)(/.+)$
-  wget -c https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz +        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
-  mv dokuwiki-stable.tgz dokuwiki.tgz +        fastcgi_index index.php; 
-  sudo tar -xvf dokuwiki.tgz -C /var/www/ +        include fastcgi_params; 
- +        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
-===== Let's Encrypt ===== +        fastcgi_intercept_errors off; 
-For SSL use the EFF's PPA for the Let's Encrypt certbot. +        fastcgi_buffer_size 16k; 
-  sudo add-apt-repository ppa:certbot/certbot +        fastcgi_buffers 4 16k; 
-  sudo apt updatesudo apt upgrade +    }
-  sudo apt install python3-certbot-nginx +
-  sudo certbot --nginx certonly +
- +
-Cert and Key locations: +
-  /etc/letsencrypt/live/wiki.domainname.tld/fullchain.pem +
-  /etc/letsencrypt/live/wiki.domainname.tld/privkey.pem +
- +
-------------- +
-source: https://certbot.eff.org/lets-encrypt/ubuntuxenial-nginx +
- +
-==== Renewing Certificate ==== +
-  sudo certbot renew +
- +
-===== Configure nginx ===== +
-Need to make the configuration file for nginx to point to the correct files. Make sure to change the domain to the correct one, a generic placeholder wiki.domainname.tld is used for this example config. +
-  sudo nano /etc/nginx/conf.d/dokuwiki.conf +
-Paste in the below configuration and save.+
  
-  server {+    location ~ /\.ht { 
 +        deny all; 
 +    } 
 +}
      
-  listen 443 ssl; 
-   server_name wiki.domainname.tld; 
-   root /var/www/dokuwiki/; 
      
-  access_log /var/log/nginx/dokuwiki.access.log; +#server {  
-   error_log /var/log/nginx/dokuwiki.error.log; +#    listen 80; 
-   +#    server_name wiki.domainname.tld; 
-  ssl on; +#    add_header Strict-Transport-Security max-age=2592000; 
-   ssl_certificate /etc/letsencrypt/live/wiki.domainname.tld/fullchain.pem; +#    rewrite ^ https://wiki.domainname.tld$request_uri? permanent; 
-   ssl_certificate_key /etc/letsencrypt/live/wiki.domainname.tld/privkey.pem; +#} 
-   ssl_session_timeout 5m; +</code>
-   ssl_ciphers 'AES256+EECDH:AES256+EDH:!aNULL'; +
-   ssl_protocols TLSv1 TLSv1.1 TLSv1.2; +
-   ssl_prefer_server_ciphers on; +
-   +
-  add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:;"; +
-  add_header X-XSS-Protection "1; mode=block"; +
-   +
-  index index.html index.php doku.php; +
-   +
-  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 last; +
-   } +
-   +
-  location ~ /(data|conf|bin|inc)/+
-   deny all; +
-   } +
-   +
-  location ~* \.(css|js|gif|jpe?g|png)$ { +
-   expires 1M; +
-   add_header Pragma public; +
-   add_header Cache-Control "public, must-revalidate, proxy-revalidate"; +
-   } +
-   +
-  location ~ \.php$ { +
-   fastcgi_split_path_info ^(.+\.php)(/.+)$; +
-   fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; +
-   fastcgi_index index.php; +
-   include fastcgi_params; +
-   fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +
-   fastcgi_intercept_errors off; +
-   fastcgi_buffer_size 16k; +
-   fastcgi_buffers 4 16k; +
-   } +
-   +
-  location ~ /\.ht { +
-   deny all; +
-   } +
-  } +
-   +
-   +
-  server {  +
-   listen 80; +
-   server_name wiki.domainname.tld; +
-   add_header Strict-Transport-Security max-age=2592000; +
-   rewrite ^ https://wiki.domainname.tld$request_uri? permanent; +
-  }+
  
 Here we are going to change the permissions on the web root files so that the web server can use and modify them.  Here we are going to change the permissions on the web root files so that the web server can use and modify them. 
Line 134: Line 94:
  
 Start nginx and php-fpm, and enable php-fpm to start at boot. Start nginx and php-fpm, and enable php-fpm to start at boot.
-  sudo systemctl start nginx php7.4-fpm +  sudo systemctl start nginx php8.1-fpm 
-  sudo systemctl enable php7.4-fpm+  sudo systemctl enable php8.1-fpm
  
  
Line 142: Line 102:
  
 From there you can configure everything for the initial setup of DokuWiki. From there you can configure everything for the initial setup of DokuWiki.
- 
-==== Removing the Glow ==== 
-Make userstyle.css in /conf 
-  sudo vim /var/www/dokuwiki/conf/userstyle.css 
- 
-Copy the following 
-  .dokuwiki div.page { 
-  box-shadow: none; 
-  } 
-  .dokuwiki .pageId span { 
-  box-shadow: none; 
-  } 
-  pre { 
-  box-shadow: none; 
-  } 
- 
webapps/dokuwiki.1624035754.txt.gz · Last modified: 2021/06/18 17:02 by lucid