[pmwiki-users] Trying to move stuff out of the web path

Hans design5 at softflow.co.uk
Thu Nov 9 13:45:15 CST 2006


Thursday, November 9, 2006, 7:32:25 PM, Sandy wrote:

> <?php if (!defined('PmWiki')) exit();
> $FarmPubDirUrl = 'http://www.onebit.ca/sites/wikipub';
> ## Browser can find that directory and list its contents nicely.

> $SkinLibDirs = array(
>    "./pub/skins/\$Skin"      => "$PubDirUrl/skins/\$Skin",
>    "home/mhschoen/www/sites/wikipub/skins/\$Skin" => 
> "$FarmPubDirUrl/skins/\$Skin",
>    );


> For comparison, the config.php (in
> http://www.onebit.ca/sites/site1/)
> is:

> <?php include('/home/mhschoen/pmwiki/pmwiki.php');

you may try this in farmconfig.php:

$SiteRoot = str_replace("pmwiki","", $FarmD);
$SkinLibDirs = array(
#    "$FarmD/pub/skins/\$Skin"     => "$FarmPubDirUrl/skins/\$Skin",
      "./pub/skins/\$Skin"      => "$PubDirUrl/skins/\$Skin",
      "$SiteRoot/www/sites/wikipub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin",
      );

This defines a var $SiteRoot which should give the filepath to $FarmD
where pmwiki.php lives, less the directory string of it (less pmwiki).
That variable is used then in the SkinLibDirs array to give an
absolute filepath to your skin directory.

Pm suggested another possible way of using $_SERVER['DOCUMENT_ROOT']
to construct an absolute file path, but I have not tried this.
what I suggests above seems to work for me.


> I feel totally lost here. Too many tools I know nothing about. Is 
> everything in the public directory (the default install), really that
> insecure?

I don't think it is that insecure, with the right .htacces files with
proper restrictions in various directories. I think PmWiki does a good
job for a default installation, although setting it up a a farm may
need a little extra caution, if you don't want a field inside the Farm
directory. But that is a different set of questions.

much luck, hope this help a little!
Hans





More information about the pmwiki-users mailing list