User Tools

Site Tools


dokuwiki:upgrade_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
dokuwiki:upgrade_dokuwiki [2020/07/15 09:30] – external edit 127.0.0.1dokuwiki:upgrade_dokuwiki [2025/04/29 13:19] (current) – [Re-enable security settings for Dokuwiki] peter
Line 7: Line 7:
 </code> </code>
  
-This will create the **dokuwiki-backup.tar.gz** backup.+<WRAP info> 
 +**NOTE:**  This will create the **dokuwiki-backup.tar.gz** backup. 
 + 
 +Alternatively, create a copy of the DokuWiki directory:  <code bash> 
 +cd /var/www 
 +cp -R dokuwiki dokuwiki-20250429 
 +</code> 
 + 
 +</WRAP> 
  
 ---- ----
Line 25: Line 34:
 wget http://.../dokuwiki-xxxx-xx-xx.tgz wget http://.../dokuwiki-xxxx-xx-xx.tgz
 </code> </code>
 +
 +<WRAP info>
 +**NOTE:** The latest stable version can usually be downloaded.
 +
 +<code bash>
 +cd ~
 +wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
 +</code>
 +
 +Sometimes the stable version may be corrupt and does not extract okay.  
 +
 +  * In this case try to download a specified version.
 +  * Visit https://download.dokuwiki.org/archive
 +  * And then get the actual version needed:  <code bash>
 +wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-2024-02-06b.tgz
 +</code>
 +
 +
 +</WRAP>
 +
  
 ---- ----
Line 44: Line 73:
 </code> </code>
                
-The quotes on cp assure that it will run as is, even if an alias is set.+<WRAP info> 
 +**NOTE:**  The quotes on **cp** assure that it will run as is, even if an alias is set. 
 +</WRAP> 
 + 
 +---- 
 + 
 +===== Set permissions for the updated files ===== 
 + 
 +<code bash> 
 +cd /var/www 
 +chown -R www-data:www-data dokuwiki 
 +</code> 
 + 
 +---- 
 + 
 +===== Re-enable security settings for Dokuwiki ===== 
 + 
 +Change directory to the Dokuwiki config directory. 
 + 
 +<code bash> 
 +cd /var/www/dokuwiki/conf 
 +</code> 
 + 
 +Edit the Dokuwiki config file, and set the **useacl** option to a 1. 
 + 
 +<file bash /var/www/dokuwiki/conf/dokuwiki.php> 
 +... 
 + 
 +/* Authentication Settings */ 
 +$conf['useacl'     = 1;                //Use Access Control Lists to restrict access? 
 + 
 +... 
 +</file> 
 + 
 +---- 
 + 
 +===== Restart NginX ===== 
 + 
 +<code bash> 
 +systemctl restart nginx.service 
 +</code> 
  
 ---- ----
Line 54: Line 124:
    
 if(function_exists('posix_geteuid')){ if(function_exists('posix_geteuid')){
-    // use posix to get current uid and gid +  // use posix to get current uid and gid 
-    $uid   = posix_geteuid(); +  $uid   = posix_geteuid(); 
-    $usr   = posix_getpwuid($uid); +  $usr   = posix_getpwuid($uid); 
-    $user  = $usr['name']; +  $user  = $usr['name']; 
-    $gid   = posix_getegid(); +  $gid   = posix_getegid(); 
-    $grp   = posix_getgrgid($gid); +  $grp   = posix_getgrgid($gid); 
-    $group = $grp['name'];+  $group = $grp['name'];
 }else{ }else{
-    // try to create a file and read it's ids +  // try to create a file and read it's ids 
-    $tmp = tempnam ('/tmp', 'check'); +  $tmp = tempnam ('/tmp', 'check'); 
-    $uid = fileowner($tmp); +  $uid = fileowner($tmp); 
-    $gid = filegroup($tmp);+  $gid = filegroup($tmp);
    
-    // try to run ls on it +  // try to run ls on it 
-    $out = `ls -l $tmp`; +  $out = `ls -l $tmp`; 
-    $lst = explode(' ',$out); +  $lst = explode(' ',$out); 
-    $user  = $lst[2]; +  $user  = $lst[2]; 
-    $group = $lst[3]; +  $group = $lst[3]; 
-    unlink($tmp);+  unlink($tmp);
 } }
    
dokuwiki/upgrade_dokuwiki.1594805433.txt.gz · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki