webapps:dokuwiki
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| webapps:dokuwiki [2021/06/18 17:02] – lucid | webapps: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 | + | This install guide is a how-to for installing DokuWiki Ubuntu server |
| ===== Prerequisites ===== | ===== Prerequisites ===== | ||
| Packages required for DokuWiki to work: | Packages required for DokuWiki to work: | ||
| - | sudo apt install | + | sudo apt install |
| 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:// | ||
| + | sudo tar -xvf " | ||
| + | sudo mv / | ||
| - | First Check whether | + | ===== 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 | ||
| + | sudo nano / | ||
| + | Paste in the below configuration and save. | ||
| - | php -m | grep mcrypt | + | < |
| + | server { | ||
| + | listen 80; | ||
| + | listen 443 ssl; | ||
| + | server_name wiki.domainname.tld; | ||
| + | root / | ||
| - | To install the mcrypt PHP module we first need to satisfy the following prerequisites: | + | access_log / |
| + | error_log / | ||
| - | sudo apt install php-dev libmcrypt-dev php-pear | + | #ssl on; |
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| - | Now we are ready to install mcrypt PHP module on our Ubuntu 20.04 system: | + | #add_header Content-Security-Policy " |
| + | #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 ''/ | + | |
| - | extension=mcrypt.so | + | location / { |
| + | try_files $uri $uri/ @dokuwiki; | ||
| + | } | ||
| - | All done. When successful, checking for the presence of the mcrypt PHP module should produce the following output: | + | location @dokuwiki { |
| + | rewrite ^/_media/(.*) / | ||
| + | rewrite ^/ | ||
| + | rewrite ^/ | ||
| + | rewrite ^/(.*) / | ||
| + | } | ||
| - | php -m | grep mcrypt | + | location ~ /(data|conf|bin|inc)/ |
| - | | + | deny all; |
| + | } | ||
| + | location ~* \.(css|js|gif|jpe? | ||
| + | expires 1M; | ||
| + | add_header Pragma public; | ||
| + | add_header Cache-Control " | ||
| + | } | ||
| - | ===== DokuWiki ===== | + | location ~ \.php$ { |
| - | Download and extract DokuWiki stable to the proper directory. | + | |
| - | wget -c https:// | + | |
| - | mv dokuwiki-stable.tgz dokuwiki.tgz | + | |
| - | sudo tar -xvf dokuwiki.tgz -C /var/www/ | + | |
| - | + | | |
| - | ===== Let's Encrypt ===== | + | |
| - | For SSL use the EFF's PPA for the Let's Encrypt certbot. | + | |
| - | sudo add-apt-repository ppa: | + | |
| - | sudo apt update; sudo apt upgrade | + | } |
| - | sudo apt install python3-certbot-nginx | + | |
| - | sudo certbot --nginx certonly | + | |
| - | + | ||
| - | Cert and Key locations: | + | |
| - | | + | |
| - | / | + | |
| - | + | ||
| - | ------------- | + | |
| - | source: https:// | + | |
| - | + | ||
| - | ==== 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 / | + | |
| - | Paste in the below configuration and save. | + | |
| - | server | + | location ~ /\.ht { |
| + | deny all; | ||
| + | } | ||
| + | } | ||
| | | ||
| - | listen 443 ssl; | ||
| - | | ||
| - | root / | ||
| | | ||
| - | access_log / | + | #server { |
| - | | + | # |
| - | + | # | |
| - | ssl on; | + | # |
| - | | + | # |
| - | | + | #} |
| - | | + | </ |
| - | | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | add_header Content-Security-Policy " | + | |
| - | add_header X-XSS-Protection "1; mode=block"; | + | |
| - | + | ||
| - | index index.html index.php doku.php; | + | |
| - | + | ||
| - | location / { | + | |
| - | | + | |
| - | } | + | |
| - | + | ||
| - | location @dokuwiki { | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | } | + | |
| - | + | ||
| - | location ~ / | + | |
| - | deny all; | + | |
| - | } | + | |
| - | + | ||
| - | location ~* \.(css|js|gif|jpe? | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | } | + | |
| - | + | ||
| - | location ~ \.php$ { | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | } | + | |
| - | + | ||
| - | location ~ /\.ht { | + | |
| - | deny all; | + | |
| - | } | + | |
| - | } | + | |
| - | + | ||
| - | + | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | } | + | |
| 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 | + | sudo systemctl enable |
| 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 / | ||
| - | |||
| - | Copy the following | ||
| - | .dokuwiki div.page { | ||
| - | box-shadow: | ||
| - | } | ||
| - | .dokuwiki .pageId span { | ||
| - | box-shadow: | ||
| - | } | ||
| - | pre { | ||
| - | box-shadow: | ||
| - | } | ||
| - | |||
webapps/dokuwiki.1624035754.txt.gz · Last modified: 2021/06/18 17:02 by lucid