To enable SSL for PmWiki, see http://www.pmwiki.org/wiki/Cookbook/SwitchToSSLMode.
Locally, for testing we work in /home/www/cvswww/terraswarm/xcomm/wiki
.
/home/www/cvswww/terraswarm/xcomm/wiki/local/pgcust.php
was changed to be:
<?php if (!defined('PmWiki')) exit(); if (@$_SERVER['HTTPS'] != 'on' && @$_SERVER['SERVER_PORT'] != '443') { header("Location: https://${_SERVER['SERVER_NAME']}/xcomm/wiki"); exit("<html><body> <a href="https://${_SERVER['SERVER_NAME']}xcomm/wiki">Please use SSL. </a> </body></html>"); } #$ScriptUrl = 'https://www.example.com/pmwiki/pmwiki.php'; #$PubDirUrl = 'https://www.example.com/pmwiki/pub'; $PubDirUrl = "https://${_SERVER['SERVER_NAME']}/php/${_SERVER['SERVER_NAME']}/pmwiki/pub"; $EnablePathInfo = 1; $SERVER_NAME = $_SERVER['SERVER_NAME']; #$ScriptUrl = "http://$SERVER_NAME/xcomm/wiki"; $ScriptUrl = "https://$SERVER_NAME/xcomm/wiki"; $UploadUrlFmt = "$ScriptUrl/uploads"; $WikiGroup = "xcomm"; $WikiTitle = "TerraSwarm Executive Committee (xcomm)"; #$PageLogoUrl = "http://www.terraswarm.org/img/Logo4Sphere90x90.png"; $PageLogoUrl = "https://www.terraswarm.org/img/Logo4Sphere90x90.png"; #log_event("scada/wiki/local/pgcust.php: ScriptUrl: $ScriptUrl"); ?>
Updated /home/www/php/wiki.php
:
if (@$_SERVER['HTTPS'] != 'on' && @$_SERVER['SERVER_PORT'] != '443') { header("Location: https://${_SERVER['SERVER_NAME']}${_SERVER['SCRIPT_URL']}"); exit("<html><body> <a href="https://${_SERVER['SERVER_NAME']}${_SERVER['SCRIPT_URL']}">Please use SSL. </a> </body></html>"); } ... $PubDirUrl = "https://${_SERVER['SERVER_NAME']}/php/${_SERVER['SERVER_NAME']}/pmwiki/pub";
And /home/www/php/pmwiki/pub/skins/monobook/monobook.php
was updated:
#$HTMLHeaderFmt[] = "<link rel='stylesheet' type='text/css' href='$SkinDirUrl/monobook.css' />n";to
SDV( $MonobookPubDirUrl, "$PubDirUrl/skins/monobook" ); $HTMLHeaderFmt[] = "<link rel='stylesheet' type='text/css' href="$MonobookPubDirUrl/monobook.css"/>n";
The workaround was to edit /home/www/cvswww/terraswarm/platforms/wiki/local/pgcust.php
:
$ScriptUrl = "https://$SERVER_NAME/platforms/wiki";
The real solution is to update each pgcust
file and the script that creates wiki pages.
/home/www/cvswww/terraswarm/reportauthors/wiki/local/pgcust.php
and make the following edit:
#$PubDirUrl = "http://$SERVER_NAME/reportauthors/wiki/pub"; $PubDirUrl = "https://$SERVER_NAME/reportauthors/wiki/pub";Also, links needed to be created:
cd /home/www/cvswww/terraswarm/reportauthors/wiki/pub ln -s ../../../../../php/pmwiki/pub/skins . ln -s ../../../../../php/pmwiki/pub/attachtable .