pivotx multi-site setup

While setting up rhoda’s blog on tinola I came across a couple of hurdles converting from one site to multiple sites.

The pivotx manual helps with a section on running multiple websites. But not everything works that smoothly. So, here’s what I needed to do to make it work.

Firstly, make the “sites” directories for the current and new blog(s)

# go to the pivotx subdirectory of the root of the pivotx installation
cd /var/www/blog/pivotx

# make the sites directories
mkdir -p sites/blog.tinola.com
mkdir sites/rhoda.tinola.com

Then move the existing blog into the new sites subdirectory. The images directory may be at the root of the pivotx install.

mv db ../images sites/blog.tinola.com
cd sites/blog.tinola.com
ln -s ../../templates .

I started by following the instructions and moving the templates
directory down into the primary blog. However, that did not work out too
well, and the best move is to actually share the directory using a
symlink mainly because bits of pivotx still expected a templates
directory in the root. 

Now make the corresponding directories in the new blog

cd sites/rhoda.tinola.com
mkdir db images
ln -s ../../templates .

At this point I set up the DNS and virtual servers.

<VirtualHost *:80>
ServerAlias blog.tinola.com
DocumentRoot /var/www/blog
ErrorLog logs/blog.tinola.com-error_log
Customlog logs/blog.tinola.com-access_log combined
</VirtualHost>

<VirtualHost *:80>
ServerAlias rhoda.tinola.com
DocumentRoot /var/www/blog
ErrorLog logs/rhoda.tinola.com-error_log
Customlog logs/rhoda.tinola.com-access_log combined
</VirtualHost>

and then logged in to set up the new blog. That didn’t work too well
so then I remembered to fix all the permissions on the new blog’s
directories.

In sites/rhoda.tinola.com

chgrp -R apache *
chown g+w *

Then, to fix the remaining breakage I found by tailing the apache
error log that I needed to do this – again in sites/rhoda.tinola.com;

mkdir pivotx 
cd pivotx
ln -s ../../../editor_wysi .
ln -s ../templates templates

Then shift-reload and everything seemed to be ok – until I went to
edit a post, and found the editor widget was not working.  All I
got was a javascript alert(‘Real path failed); which is not exactly the
most helpful message.At least it was unique and grep told me that this
snippet in tiny_mce_gzip.php was at fault.

if (!$cachePath) {
   $msg = "Real Path ".$cachePath." failed";
   die("alert('".$msg."');");
}

Further up;

$cachePath = realpath("../db/cache/");

So in the pivotx root again

mkdir -p db/cache 
chgrp apache db/cache
chown g+w db/cache

 One gotcha. The editor_wysi component uses an eval of
javascript generated in tiny_mce_gzip.php. This is cached and will not
be reloaded. So if you see “Real path failed” then you need to clear
your browser cache after you’ve fixed the problem, or else you’ll end up
chasing this round and round until it dawns on you to check the expires
time in firebug. Then you feel rather stupid for a bit.

HTH

Any opinions, news, research, analyses, prices or other information ("information") contained on this Blog, constitutes marketing communication and it has not been prepared in accordance with legal requirements designed to promote the independence of investment research. Further, the information contained within this Blog does not contain (and should not be construed as containing) investment advice or an investment recommendation, or an offer of, or solicitation for, a transaction in any financial instrument. LMAX Group has not verified the accuracy or basis-in-fact of any claim or statement made by any third parties as comments for every Blog entry.

LMAX Group will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information. No representation or warranty is given as to the accuracy or completeness of the above information. While the produced information was obtained from sources deemed to be reliable, LMAX Group does not provide any guarantees about the reliability of such sources. Consequently any person acting on it does so entirely at his or her own risk. It is not a place to slander, use unacceptable language or to promote LMAX Group or any other FX and CFD provider and any such postings, excessive or unjust comments and attacks will not be allowed and will be removed from the site immediately.