| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| WIKIFRONTPAGE="FrontPage" |
| |
| |
| WIKILOCATION=/var/www/ |
| |
| |
| |
| printf "Instance Name [wiki] : " |
| read WIKIINSTANCE |
| if [ ! $WIKIINSTANCE ];then |
| WIKIINSTANCE='wiki' |
| fi |
| |
| |
| if [ -d ${WIKILOCATION}/$WIKIINSTANCE ];then |
| echo "The instance '$WIKIINSTANCE' already exists." |
| exit; |
| fi |
| |
| |
| printf "Site Name [My Wiki] : " |
| read WIKISITENAME |
| if [ ! $WIKINAME ];then |
| WIKINAME='My Wiki' |
| fi |
| |
| |
| |
| |
| |
| |
| WIKIALIAS=$WIKIINSTANCE |
| |
| |
| |
| WIKIURLPREFIX=${WIKIINSTANCE}_staticfiles |
| |
| |
| printf "Site superuser [YourName] : " |
| read WIKISUPERUSER |
| if [ ! $WIKISUPERUSER ];then |
| WIKISUPERUSER='YourName' |
| fi |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| WIKIRESTRICTEDIT="no" |
| |
| |
| WIKIMAILSMARTHOST="" |
| WIKIMAILFROM="" |
| WIKIMAILLOGIN="" |
| |
| |
| WIKILANGUAGE="en" |
| |
| |
| PREFIX=/usr |
| |
| |
| SHARE=$PREFIX/share/moin/ |
| |
| |
| USER=apache |
| GROUP=$USER |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| echo "Creating instance ..." |
| cd $WIKILOCATION |
| mkdir $WIKIINSTANCE |
| cp -R ${SHARE}data $WIKIINSTANCE |
| cp -R ${SHARE}htdocs $WIKIINSTANCE |
| cp -R ${SHARE}underlay $WIKIINSTANCE |
| mkdir ${WIKIINSTANCE}/cgi-bin |
| cp ${SHARE}server/moin.cgi ${WIKIINSTANCE}/cgi-bin |
| |
| |
| |
| |
| sed -i -e " |
| s/\/path\/to\/wikiconfig/\/var\/www\/${WIKIINSTANCE}\/cgi-bin/ |
| s/\/path\/to\/farmconfig/\/var\/www\/${WIKIINSTANCE}\/cgi-bin\/farmconfig/ |
| " ${WIKILOCATION}${WIKIINSTANCE}/cgi-bin/moin.cgi |
| |
| |
| |
| |
| |
| |
| |
| |
| cat <<APACHECONF > /etc/httpd/conf.d/${WIKIINSTANCE}.conf |
| |
| |
| |
| |
| |
| |
| |
| |
| Alias /${WIKIURLPREFIX} "${WIKILOCATION}${WIKIINSTANCE}/htdocs/" |
| <Directory "${WIKILOCATION}${WIKIINSTANCE}/htdocs/"> |
| Order deny,allow |
| Allow from all |
| </Directory> |
| |
| ScriptAlias /${WIKIINSTANCE} "${WIKILOCATION}${WIKIINSTANCE}/cgi-bin/moin.cgi" |
| <Directory "${WIKILOCATION}${WIKIINSTANCE}/cgi-bin"> |
| Order deny,allow |
| Allow from all |
| </Directory> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| APACHECONF |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| cat <<WIKICONFIG > ${WIKIINSTANCE}/cgi-bin/wikiconfig.py |
| |
| |
| |
| |
| |
| |
| |
| |
| """ |
| MoinMoin - Configuration for a single wiki |
| |
| If you run a single wiki only, you can omit the farmconfig.py config |
| file and just use wikiconfig.py - it will be used for every request |
| we get in that case. |
| |
| Note that there are more config options than you'll find in |
| the version of this file that is installed by default; see |
| the module MoinMoin.multiconfig for a full list of names and their |
| default values. |
| |
| Also, the URL http://moinmoin.wikiwikiweb.de/HelpOnConfiguration has |
| a list of config options. |
| |
| ** Please do not use this file for a wiki farm. Use the sample file |
| from the wikifarm directory instead! ** |
| """ |
| |
| from MoinMoin.multiconfig import DefaultConfig |
| |
| |
| class Config(DefaultConfig): |
| |
| |
| |
| |
| sitename = u'${WIKISITENAME}' |
| |
| |
| |
| |
| logo_string = u'<img src="/${WIKIURLPREFIX}/common/moinmoin.png" alt="MoinMoin Logo">' |
| |
| |
| |
| |
| |
| |
| |
| page_front_page = u"${WIKIFRONTPAGE}" |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| data_dir = '${WIKILOCATION}${WIKIINSTANCE}/data/' |
| |
| |
| |
| |
| |
| |
| data_underlay_dir = '${WIKILOCATION}${WIKIINSTANCE}/underlay/' |
| |
| |
| |
| |
| |
| url_prefix = '/${WIKIURLPREFIX}' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| navi_bar = [ |
| |
| |
| u'RecentChanges', |
| u'FindPage', |
| u'SiteNavigation', |
| u'HelpContents', |
| ] |
| |
| |
| theme_default = 'modern' |
| |
| |
| |
| |
| |
| |
| |
| |
| language_default = '${WIKILANGUAGE}' |
| |
| |
| page_category_regex = u'^Category[A-Z]' |
| page_dict_regex = u'[a-z]Dict$' |
| page_form_regex = u'[a-z]Form$' |
| page_group_regex = u'[a-z]Group$' |
| page_template_regex = u'[a-z]Template$' |
| |
| |
| |
| |
| show_hosts = 1 |
| |
| |
| |
| WIKICONFIG |
| |
| |
| |
| |
| |
| if [ "$WIKISUPERUSER" != "" ]; then |
| |
| sed -i -e ' |
| /#superuser/s/#// |
| s/YourName/'$WIKISUPERUSER'/' ${WIKIINSTANCE}/cgi-bin/wikiconfig.py |
| |
| fi |
| |
| if [ "$WIKIRESTRICTEDIT" = "yes" ]; then |
| |
| sed -i -r -e ' |
| /#acl_rights_before/s/#// |
| /#acl_rights_default/s/#// |
| /#[\t ]*u"EditGroup/s/#// |
| /#[\t ]*u"AdminGroup/s/#//' ${WIKIINSTANCE}/cgi-bin/wikiconfig.py |
| |
| fi |
| |
| if [ "$WIKIMAILSMARTHOST" != "" ]; then |
| |
| sed -i -e ' |
| /#mail_smarthost/s/#//' ${WIKIINSTANCE}/cgi-bin/wikiconfig.py |
| |
| fi |
| |
| if [ "$WIKIMAILFROM" != "" ];then |
| |
| sed -i -e ' |
| /#mail_from/s/#//' ${WIKIINSTANCE}/cgi-bin/wikiconfig.py |
| |
| fi |
| |
| if [ "$WIKIMAILLOGIN" != "" ];then |
| |
| sed -i -e ' |
| /#mail_login/s/#//' ${WIKIINSTANCE}/cgi-bin/wikiconfig.py |
| |
| fi |
| |
| |
| |
| |
| |
| |
| |
| echo 'Setting permissions ...' |
| chown -R $USER.$GROUP $WIKIINSTANCE |
| chmod -R 750 $WIKIINSTANCE |
| |
| |
| |
| echo '---------------------------------------------' |
| echo ' *** The wiki instance had been created! *** ' |
| echo '---------------------------------------------' |
| echo 'To finish the installation do the following:' |
| echo " 1. Restart the Web Server (service httpd restart)" |
| echo " 2. Open your browser and try the address: http://localhost/${WIKIALIAS}" |
| echo ' 3. Enjoy your installed wiki :).' |
| echo '' |