Shared install tweaks

Discussion corner for Developers of Serendipity.
Post Reply

Do you run a shared Serendipity install?

Yes, I have access to my own server
0
No votes
Yes, on a web host
1
25%
No, I don't need it
3
75%
No, I thought I couldn't do it with my host
0
No votes
 
Total votes: 4

Cynebeald
Regular
Posts: 10
Joined: Sun Jan 06, 2008 8:11 pm

Shared install tweaks

Post by Cynebeald »

I'm running several blogs on a single host, but I don't have server or shell access. But, our webhost lets us create subdomains as subdirectories. So, what I did was that I installed the shared base in a subdomain, and created a .htaccess to deny all.

Then, I had to modify the deployment files so they would include the right files (currently, the deployment files assume that the shared install is in the include_path, which I can't set). First, I hardcoded the new path, but then I changed it so that it uses a constant defined in a single file. Would the developers be interested in the patch?

Also, since I don't have shell access, I wrote a little shell script (using a recursive directory copy function I found on php.net) that would copy and link the necessary files for me (note that I also share plugins, I'm not sure if this is a problem or not).

Code: Select all

<?php
ini_set('track_errors',1);
require_once ('./copydirr.inc.php');
function symlink_verbose($from,$to) {
  echo "linking $from to $to";
	if (symlink($to,$from)) {
		echo "OK <br />";
	} else {
		echo "<strong>Error</string>: ".$php_errormsg."<br />";
	}
}

if (empty($_GET["dest"]) ) {
  echo "bad params";
	die;
}


$root = "/your/website/root";
$base_install = $root . '/s9y';
$linkables = array('/templates','/htmlarea','/plugins');
$deployment = "/deployment";

$dest = $root . $_GET['dest'];

foreach ($linkables as $dir) {
  symlink_verbose($dest.$dir,$base_install.$dir);
}

copydirr($base_install.$deployment,$dest,0777,true);

?>
Post Reply