To enable SSL for PmWiki, see http://www.pmwiki.org/wiki/Cookbook/SwitchToSSLMode.

Testing

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");  
?>

Rollout

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";

Can't edit a page

https://www.terraswarm.org/platforms/wiki/Main/PtolemyII was not editable and an image was being downloaded via http instead of https.

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.

Reportauthors messed up

The reportauthors wiki was having some css files served as http instead of https. The fix was to edit /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 .

Edit links at the bottom of reportauthors wiki did not work

Clicking on the edit link at the bottom of the reportauthors wiki did not work because the links used http://www.terraswarm.org instead of https://www.terraswarm.org