User Tools

Site Tools


sysadmin:wiki

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
sysadmin:wiki [2025/11/19 15:04] mlivolsisysadmin:wiki [2025/11/19 15:26] (current) mlivolsi
Line 16: Line 16:
   * Don't follow verbatim ChatGPT or Gemini, as they will make you nuts if you listen to them.    * Don't follow verbatim ChatGPT or Gemini, as they will make you nuts if you listen to them. 
  
-Step 1: sudo to root +**Steps**
-Step 2: cd /var/www and make the directory wiki +
-Step 3: cd wiki +
-Step 4: get the latest copy: curl -o doku.tgz https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz +
-Step 5: Extract the wiki: tar -xzvf doku.tgz +
-Step 6: Rename the resulting directory: mv dokuwiki-2025-05-14b dokuwiki +
-Step 7: change ownership to www-data:www-data for everything under /var/www/wiki +
-Step 8: cd /etc/apache2/sites-available +
-Step 9: Create a file called wiki.conf and make sure it looks similar to the following:+
  
-''<VirtualHost *:8009>+  * Step 1: sudo to root 
 +  * Step 2: cd /var/www and make the directory wiki 
 +  * Step 3: cd wiki 
 +  * Step 4: get the latest copy: curl -o doku.tgz https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz 
 +  * Step 5: Extract the wiki: tar -xzvf doku.tgz 
 +  * Step 6: Rename the resulting directory: mv dokuwiki-2025-05-14b dokuwiki 
 +  * Step 7: change ownership to www-data:www-data for everything under /var/www/wiki 
 +  * Step 8: cd /etc/apache2/sites-available 
 +  * Step 9: Create a file called wiki.conf and make sure it looks similar to the following: 
 +<code> 
 +  <VirtualHost *:xxxx>
     ServerAdmin webmaster@localhost     ServerAdmin webmaster@localhost
     ServerName  wiki.mikelivolsi.com     ServerName  wiki.mikelivolsi.com
Line 58: Line 60:
     ErrorLog ${APACHE_LOG_DIR}/wiki_error.log     ErrorLog ${APACHE_LOG_DIR}/wiki_error.log
     CustomLog ${APACHE_LOG_DIR}/wiki_access.log combined     CustomLog ${APACHE_LOG_DIR}/wiki_access.log combined
-</VirtualHost>''+</VirtualHost>
  
 +</code>
 +
 +  * Step 10 - Make configuration visible: a2ensite wiki
 +  * Step 11 - Edit the docu-wiki configuration: vi /var/www/wiki/conf/dokuwiki.php
 +  * Step 12 - Make the following changes:
 +
 +<code>
 +$conf['baseurl'] = '/';
 +$conf['basedir'] = '/wiki';
 +$conf['useurlrewriting'] = false;  // keep false for reverse proxy
 +</code>
 +
 +  * Step 13 - enable re-write if not already enabled: a2enmod rewrite
 +  * Step 14 - Enable the configuration: systemctl restart apache2
 +  * Step 15 - Make sure to configure your site with the username, etc.. via your browser
 +
 +              http://<your ip>/install.php
 +
 +  * Step 16 - Login to your nginx site
 +  * Step 17 - cd /etc/nginx/sites-available
 +  * Step 18 - Before this block, add the subsequent block in this doc,  above it !!!
 +
 +  * ** >>> NOTE <<<** If should come before any asset declarations, like I had for wordpress:
 +
 +<code>
 +    # Static assets for WordPress
 +    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
 +        expires max;
 +        log_not_found off;
 +    }
 + </code>
 +
 +My block
 +<code>
 +    # -------------------------------
 +    # DokuWiki reverse proxy
 +    # -------------------------------
 +    location ^~ /wiki/ {
 +        proxy_pass http://192.168.1.x:xxxx/;
 +        proxy_set_header Host $host;
 +        proxy_set_header X-Real-IP $remote_addr;
 +        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 +        proxy_set_header X-Forwarded-Proto $scheme;
 +
 +        # Important for DokuWiki
 +        proxy_set_header X-Forwarded-Host $host;
 +        proxy_set_header X-Forwarded-Port $server_port;
 +
 +        proxy_redirect off;
 +    }
 +
 +    # Redirect /wiki (no trailing slash)
 +    location = /wiki {
 +        return 301 /wiki/;
 +    }
 +</code>
 +
 +  * Restart nginx: systemctl restart nginx
 +
 +Afterwards, if you go to your site.. like "https://www.mikelivolsi.com/wiki" it will take you to your wiki. 
 +
 +
 +**Notes**
 +
 +   Certificates are handled by the front-end server, so the back-end can run http
  
  
    
sysadmin/wiki.1763564652.txt.gz · Last modified: by mlivolsi