安裝配置MoinMoin Wiki

heming96發表於2008-08-09

主要參考下這個文件:

如何安裝 MoinMoin Wiki

-

其他相關文件

Chapter 9. Debian伺服器篇

Linux Moin 安裝日記 (基於 mod_python)

MoinMoin Wiki 在Linux Apache下的安裝

附件為一個建立instance的指令碼 create_moin_instance.sh

[@more@]

#!/bin/bash


RUN=${HOME}/run
SHARE=${RUN}/share/moin
FARMDIR=${RUN}/etc/moinfarm

WWWDIR=${HOME}/www
WWWTEMPLATE=${WWWDIR}/MOIN-WIKI-TEMPLATE

#TIMESTAMP=`date '+%Y%m%d_%H%M%S.%N'`
TIMESTAMP=`date '+%Y%m%d_%H%M%S'`

# path to target instance location
INSTANCE=$1

DOMAIN=$2

if [ ! $3 ]
then
WIKINAME=$INSTANCE
else
WIKINAME=$3
fi

INSTANCEDIR=${FARMDIR}/${INSTANCE}
WWWINSTDIR=${WWWDIR}/${DOMAIN}
INSTANCECONFIG=${INSTANCEDIR}/${INSTANCE}.py

USER=`id -un`
GROUP=`id -gn`

SELF=`basename $0`

if [ ! $2 ]
then
echo "usage: $SELF []"
exit 2
fi

if [[ -e ${INSTANCEDIR} || -d ${INSTANCEDIR} ]]
then
echo "${INSTANCEDIR} already exists... exiting."
exit 1
fi

echo "Creating and populating instance directory ${INSTANCEDIR}"

mkdir -p ${INSTANCEDIR}
cp -R ${SHARE}/data ${INSTANCEDIR}
# BABY - not copying underlay nor wikiconfig.py
#cp -R $SHARE/underlay $INSTANCE
#cp $SHARE/config/wikiconfig.py $INSTANCE

echo " creating symlinks to see the themes from ${FARMDIR}/THEMES"
mv ${INSTANCEDIR}/data/plugin/theme ${INSTANCEDIR}/data/plugin/NO-theme
ln -s ../../../THEMES ${INSTANCEDIR}/data/plugin/theme

chown -R $USER.$GROUP ${INSTANCEDIR}
chmod -R ug+rwX ${INSTANCEDIR}
chmod -R o-rwx ${INSTANCEDIR}

echo "Creating and populating web directory ${WWWINSTDIR}"

if [[ -d ${WWWINSTDIR} ]]
then
cp -rp ${WWWTEMPLATE}/* ${WWWTEMPLATE}/.??* ${WWWINSTDIR}
else
cp -rp ${WWWTEMPLATE} ${WWWINSTDIR}
fi

# BABY This is no longer necesary since I use 'cp -p'
#chown -R $USER.$GROUP ${WWWINSTDIR}
#chmod -R ug+rwX ${WWWINSTDIR}
#chmod -R o-w+rX ${WWWINSTDIR}

echo "Creating instance configuration file ${INSTANCECONFIG}"
sed -e "s/NAMEOFWIKI/${WIKINAME}/g" -e "s/NAMEOFINSTANCE/${INSTANCE}/g" ${FARMDIR}/TEMPLATES/INSTEMPLATE.py >${INSTANCECONFIG}

echo "Generating farm configuration file ${FARMDIR}/farmconfig.${TIMESTAMP}.py"
sed -e "s/^ # GENERATE_FARM_INSTANCE_ENTRY #$/ ("${INSTANCE}/${INSTANCE}", r"^(www.)?${DOMAIN}/.*$"),n # GENERATE_FARM_INSTANCE_ENTRY #/"
${FARMDIR}/farmconfig.py >${FARMDIR}/farmconfig.${TIMESTAMP}.py

#echo ""
#echo "NOTE:"
#echo "Revise farm configuration in ${FARMDIR}/farmconfig.${TIMESTAMP}.py"
#echo "and, if it's OK, do:"
#echo " $ mv ${FARMDIR}/farmconfig.${TIMESTAMP}.py ${FARMDIR}/farmconfig.py"
#echo ""

echo " moving ${FARMDIR}/farmconfig.py ===> ${FARMDIR}/BACKUP_PRE-${INSTANCE}.${TIMESTAMP}-farmconfig.py"
cp -p ${FARMDIR}/farmconfig.py ${FARMDIR}/BACKUP_PRE-${INSTANCE}.${TIMESTAMP}-farmconfig.py
echo " moving ${FARMDIR}/farmconfig.${TIMESTAMP}.py ===> ${FARMDIR}/farmconfig.py"
mv ${FARMDIR}/farmconfig.${TIMESTAMP}.py ${FARMDIR}/farmconfig.py


echo "Ready."
echo "Old farm configuration file saved in ${FARMDIR}/BACKUP_PRE-${INSTANCE}.${TIMESTAMP}-farmconfig.py"

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9614263/viewspace-1008737/,如需轉載,請註明出處,否則將追究法律責任。

相關文章