logo       

Re: wikifarm: msg#00530

org.wikimedia.mediawiki

Subject: Re: wikifarm


On 30 Mar 2005, at 12:10, Jamie Bliss wrote:

It's been mentioned that if you hack the vars in LocalSettings.php so
that the includes, maintenance, and languages directories are one
place (eg, a global location), but extensions, images, and skins are
someplace else (a user-specific location), you can change the
variables so it works. (I should try it just to see how it works.)

That sounds like a lot of work! Here's how I do it. Feel free to leave my .signature on. I got into the habit of putting at least one colon in front back in the 80's, when I was pretty active in a shell script mailing list... ;-)
----------------
#!/bin/bash
##
# Link the wiki files into another directory for use as a copy.
#
# $1: where to put the wiki
#
# Where the originals are
basedir=/Library/WebServer/include/wiki

# Should not need to change anything below this line.
#
# Where the target website is
#
if [ ! -d "$1" ]; then
echo $0 error, $1 does not exist; exit 999;
fi

#
# Resolve relative name, if needed.
#
stardir="$PWD"
cd "$1"
targetdir="$PWD"
cd "$startdir"

#
# Setup the base wiki directory.
#
umask=027
[ -d "$targetdir/wiki" ] || mkdir "$targetdir/wiki"
chgrp www "$targetdir/wiki"
targetdir="$targetdir/wiki"

#
# Hard-link files in $1 directory to $2 directory, both of which exist,
# recursively doing the same in any subdirs found.
# Paths must be absolute.
#
depth=-1
function linkall() {
echo
((depth=$depth+1))
for (( i=$depth; $i > 0; i=$i-1 )) ; do
echo -n ' ';
done
echo -n "linking $1: "
local here="$PWD"
cd "$1"
local f
for f in *
do
if [ -d "$f" ]; then
mkdir "$2/$f"; chgrp www "$2/$f"; linkall "$1/$f" "$2/$f" ;
else
echo -n '.';
ln "$1/$f" "$2/$f";
fi
done
cd "$here"
echo -n '/'
((depth=$depth-1))
}

linkall "$basedir" "$targetdir"
echo

#
# Explicitly handle exceptions.
#
chmod 770 "$targetdir/images"
chmod 770 "$targetdir/config"
rm "$targetdir/LocalSettings.php"

echo
echo "Now go to http://hostname/wiki/config and set up the configuration"
echo "REMEMBER remove or write protect the config directory afterward!"
echo

:::: If busses stop at a bus station, and trains stop at a train station, what happens at a work station?
:::: Jan Steinman <http://www.IslandSeeds.org/wiki>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise