tips:redirect_farm
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:redirect_farm [2012-05-02 01:33] – [Step 6: Configure the Animal] turnermm | tips:redirect_farm [2017-06-27 23:52] (current) – 144.91.58.132 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== The redirect farm ====== | ====== The redirect farm ====== | ||
+ | |||
+ | A setup that is very similar to the setup that is described on this page is now part of DokuWiki. The [[:farms]] documentation describes how it can be used. This page might still be useful as it describes some things like more advanced techniques how animals can be created that aren't covered in the new documentation yet that are still valid. Once this information has been transferred to the new documentation pages, this page should be deleted. | ||
In a farm, one single copy of wiki engine (the farmer) is used to run several individual wikis (the animals). For a generic introduction, | In a farm, one single copy of wiki engine (the farmer) is used to run several individual wikis (the animals). For a generic introduction, | ||
Line 219: | Line 221: | ||
</ | </ | ||
- | **Test:** Point your browser to '' | + | **Test:** Point your browser to '' |
=== Clear the farmer wiki === | === Clear the farmer wiki === | ||
Line 227: | Line 229: | ||
<code bash> | <code bash> | ||
rm install.php | rm install.php | ||
- | rm -r data | + | # rm -r data ### too dangerous for the time being |
- | rm conf/*.dist | + | mv data data.bak ### revert if there is a problem with loading the stylesheet vi csss.php |
</ | </ | ||
+ | |||
+ | At present, css.php tests for the existence of data/pages. Hopefully, this will be fixed: < | ||
==== Step 5: Create an Animal ==== | ==== Step 5: Create an Animal ==== | ||
Line 291: | Line 295: | ||
**Test:** '' | **Test:** '' | ||
- | If you find you need to set the basedir configuration option, uncomment the basedir setting the the above script, replacing it with the one needed for the current animal. | + | If you find you need to set the basedir configuration option, uncomment the basedir setting |
+ | |||
==== Step 7: Create Animal Data Directories ==== | ==== Step 7: Create Animal Data Directories ==== | ||
Line 312: | Line 316: | ||
===== Advanced Configuration ===== | ===== Advanced Configuration ===== | ||
- | ==== Using a Script to Setup an Animal ==== | + | ==== Using a Bash Script to Setup an Animal ==== |
Here's a little bash script which will perform the above steps in one go inside the directory it's executed in (if you're using this with other scripts you have to make sure you '' | Here's a little bash script which will perform the above steps in one go inside the directory it's executed in (if you're using this with other scripts you have to make sure you '' | ||
Line 323: | Line 327: | ||
exit 1 | exit 1 | ||
fi | fi | ||
+ | |||
+ | # set_basedir | ||
+ | # Author: Myron Turner | ||
+ | set_basedir() { | ||
+ | BARN=`pwd | awk -F/ '{ print $(NF) }'` | ||
+ | echo "'/" | ||
+ | } | ||
ANIMAL=${PWD}/ | ANIMAL=${PWD}/ | ||
Line 350: | Line 361: | ||
echo "<? | echo "<? | ||
\$conf[' | \$conf[' | ||
+ | # \$conf[' | ||
\$conf[' | \$conf[' | ||
Line 382: | Line 394: | ||
</ | </ | ||
+ | **basedir: | ||
+ | You may need to set the '' | ||
+ | # \$conf[' | ||
+ | This will create a '' | ||
+ | |||
+ | ==== Using a Powershell Script to Setup an Animal ==== | ||
+ | for those who prefer IIS, here is a small powershell script. You need to customize it to your Environment. Be aware, we use Active Directory and SSO. This script is still an alpha version! | ||
+ | Features of this script: | ||
+ | * Create AD Groups for Control ACL over AD Groups | ||
+ | * Set NTFS Permissions on IIS Server | ||
+ | * Enable SSO | ||
+ | |||
+ | Tested with IIS 8 and PHP 5.6 and Detritus. | ||
+ | <code New-DokuwikiAnimal.ps1> | ||
+ | <# | ||
+ | .SYNOPSIS | ||
+ | Legt Dokuwiki Animals an. | ||
+ | .DESCRIPTION | ||
+ | Legt Dokuwiki Animals an. Inklusive AD-Gruppen, ACL, Konfig, NTFS Rechte, .... | ||
+ | .EXAMPLE | ||
+ | New-DokuwikiAnimal.ps1 -Animal IT | ||
+ | .INPUTS | ||
+ | Animal | ||
+ | .OUTPUTS | ||
+ | Keine. | ||
+ | .NOTES | ||
+ | Author | ||
+ | Filename | ||
+ | Requires | ||
+ | |||
+ | Version | ||
+ | History | ||
+ | .LINK | ||
+ | |||
+ | #> | ||
+ | |||
+ | Param( | ||
+ | [Parameter(Mandatory=$false, | ||
+ | [String]$Animal=" | ||
+ | ) | ||
+ | |||
+ | clear-host | ||
+ | ### Parameters ### | ||
+ | $wwwroot =" | ||
+ | $farmpath = $wwwroot+" | ||
+ | $GroupOU = " | ||
+ | $wikiadmins = " | ||
+ | $GroupPreFix = " | ||
+ | $ErrorActionPreference = " | ||
+ | $before = Get-Date | ||
+ | $date = get-date -format yyyyMMdd-HHmm | ||
+ | |||
+ | ### Proof for administrative permissions (UAC) ### | ||
+ | If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]:: | ||
+ | { | ||
+ | Write-Warning "Not run as administrator! You failed! ;)" | ||
+ | break | ||
+ | } | ||
+ | |||
+ | Write-Host "Lade ActiveDirectory Module" | ||
+ | try | ||
+ | { | ||
+ | Import-Module ActiveDirectory | ||
+ | } | ||
+ | catch | ||
+ | { | ||
+ | Write-Warning " | ||
+ | break | ||
+ | } | ||
+ | |||
+ | If ($Animal -eq " | ||
+ | Write-Host "" | ||
+ | $Animal = $( Read-Host "How should the animal be named?" | ||
+ | Write-Host "" | ||
+ | } | ||
+ | |||
+ | $cleananimal = $($Animal -replace " ","" | ||
+ | $animalpath = $farmpath+" | ||
+ | try | ||
+ | { | ||
+ | new-item -Path $animalpath -ItemType directory| Out-Null | ||
+ | } | ||
+ | catch | ||
+ | { | ||
+ | break | ||
+ | } | ||
+ | |||
+ | $GroupRead = $GroupPreFix+$Animal+" | ||
+ | $GroupEditor = $GroupPreFix+$Animal+" | ||
+ | $GroupManager = $GroupPreFix+$Animal+" | ||
+ | $GroupAdmins = $GroupPreFix+$Animal+" | ||
+ | |||
+ | New-ADGroup -Name $GroupRead -SamAccountName $GroupRead -GroupCategory Security -GroupScope Global -DisplayName $GroupRead -Path $GroupOU | ||
+ | New-ADGroup -Name $GroupEditor -SamAccountName $GroupEditor -GroupCategory Security -GroupScope Global -DisplayName $GroupEditor -Path $GroupOU | ||
+ | New-ADGroup -Name $GroupManager -SamAccountName $GroupManager -GroupCategory Security -GroupScope Global -DisplayName $GroupManager -Path $GroupOU" | ||
+ | New-ADGroup -Name $GroupAdmins -SamAccountName $GroupAdmins -GroupCategory Security -GroupScope Global -DisplayName $GroupAdmins -Path $GroupOU | ||
+ | |||
+ | Add-ADGroupMember $GroupAdmins $wikiadmins | ||
+ | Add-ADGroupMember $GroupRead $GroupEditor, | ||
+ | |||
+ | |||
+ | $inherit = [system.security.accesscontrol.InheritanceFlags]" | ||
+ | $propagation = [system.security.accesscontrol.PropagationFlags]" | ||
+ | $modify = [System.Security.AccessControl.FileSystemRights]" | ||
+ | $read = [System.Security.AccessControl.FileSystemRights]" | ||
+ | |||
+ | $groups = @($GroupRead, | ||
+ | foreach ($group in $groups) { | ||
+ | |||
+ | $Acl = (Get-Item $wwwroot).GetAccessControl(' | ||
+ | $Ar = New-Object | ||
+ | $Acl.AddAccessRule($Ar) | ||
+ | Set-Acl $wwwroot $Acl | ||
+ | |||
+ | $Acl = (Get-Item $farmpath).GetAccessControl(' | ||
+ | $Ar = New-Object | ||
+ | $Acl.AddAccessRule($Ar) | ||
+ | Set-Acl $farmpath $Acl | ||
+ | |||
+ | $Acl = (Get-Item $($wwwroot+" | ||
+ | $Ar = New-Object | ||
+ | $Acl.AddAccessRule($Ar) | ||
+ | Set-Acl $($wwwroot+" | ||
+ | |||
+ | ##NTFS Für Animal | ||
+ | $Acl = (Get-Item $animalpath).GetAccessControl(' | ||
+ | IF ($group -eq $GroupEditor -OR $group -eq $GroupManager -OR $group -eq $GroupAdmin) { | ||
+ | $Ar = New-Object | ||
+ | } Else { | ||
+ | $Ar = New-Object | ||
+ | } | ||
+ | $Acl.AddAccessRule($Ar) | ||
+ | Set-Acl $animalpath $Acl | ||
+ | } | ||
+ | |||
+ | new-item -Path $($animalpath+" | ||
+ | new-item -Path $($animalpath+" | ||
+ | $verz = @(" | ||
+ | foreach ($ver in $verz) { | ||
+ | new-item -Path $($animalpath+" | ||
+ | } | ||
+ | $conffiles = @(" | ||
+ | foreach ($conffile in $conffiles) { | ||
+ | new-item -Path $($animalpath+" | ||
+ | } | ||
+ | Copy-Item -Path $($wwwroot+" | ||
+ | Copy-Item -Path $($wwwroot+" | ||
+ | Copy-Item -Path $($wwwroot+" | ||
+ | Copy-Item -Path $($wwwroot+" | ||
+ | |||
+ | ### Writing | ||
+ | $lc = $animalpath+" | ||
+ | "<? | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | $file_content = Get-Content " | ||
+ | [System.IO.File]:: | ||
+ | |||
+ | ##Set ACL | ||
+ | ### Writing acl.auth.php | ||
+ | $aclc = $animalpath+" | ||
+ | $file= " | ||
+ | "# acl.auth.php" | ||
+ | "# <?php exit()?>" | ||
+ | "# Don't modify the lines above" | Out-File $aclc -Append | ||
+ | "# Access Control Lists" | Out-File $aclc -Append | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | $file_content = Get-Content " | ||
+ | [System.IO.File]:: | ||
+ | |||
+ | ## Startseite | ||
+ | $startpage = $animalpath+" | ||
+ | " | ||
+ | "==== Usage of DokuWiki ====" |Out-File $startpage -Append | ||
+ | " | ||
+ | " | ||
+ | |||
+ | $file_content = Get-Content " | ||
+ | [System.IO.File]:: | ||
+ | </ | ||
+ | |||
+ | --- [[user> | ||
==== URL Rewriting ==== | ==== URL Rewriting ==== | ||
Line 388: | Line 611: | ||
==== Enabling/ | ==== Enabling/ | ||
- | Since Angua the plugins can be enabled and disabled per animal using the plugin manager | + | Since Angua the plugins can be enabled and disabled per animal using the plugin manager. Activating and deactivating is stored in the '' |
But before Angua you would need to change the following: | But before Angua you would need to change the following: | ||
tips/redirect_farm.1335915187.txt.gz · Last modified: 2012-05-02 01:33 by turnermm