diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/pmwiki.sh.erb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/templates/pmwiki.sh.erb b/templates/pmwiki.sh.erb index 20cebf0..789f6cb 100644 --- a/templates/pmwiki.sh.erb +++ b/templates/pmwiki.sh.erb @@ -108,9 +108,20 @@ function pmwiki_install { exit 1 fi - mkdir -p $SITES/$site/wiki + # Create folder structure + ( + mkdir -p $SITES/$site/wiki + cd $SITES/$site/wiki + ln -s field.php index.php + mkdir -p local uploads wiki.d cookbook + chown $site. wiki.d + chown root.$site local/config.php + ) + + # Setup dispatcher echo '<?php include("/var/www/data/wiki/pmwiki.php"); ?>' > $SITES/$site/wiki/field.php + # Setup redirections echo > $SITES/$site/wiki/.htaccess <<-EOF Options +FollowSymLinks RewriteEngine on @@ -118,20 +129,13 @@ RewriteRule ^/?$ https://$site.<%= domain %>/Main/HomePage [R=permanent,QSA,L] RewriteRule ^([^/a-z].*) field.php?n=$1 [QSA,L] EOF + # Setup config file echo > $SITES/$site/wiki/local/config.php <<-EOF <?php if (!defined('PmWiki')) exit(); $ScriptUrl = "https://$site.<%= domain %>"; $EnablePathInfo = 1; EOF - - ( - cd $SITES/$site/wiki - ln -s field.php index.php - mkdir -p local uploads wiki.d cookbook - chown $site. wiki.d - chown root.$site local/config.php - ) } # Main procedure |