| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| WIKISITENAME="mywiki" |
| |
| |
| MYDOMAIN="localdomain" |
| |
| |
| WIKIFRONTPAGE="FrontPage" |
| |
| |
| WIKILOCATION=/var/www/ |
| |
| |
| WIKIINSTANCE="wikifarm" |
| |
| |
| |
| WIKIURLPREFIX="staticfiles" |
| |
| |
| WIKISUPERUSER="YourName" |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| WIKIRESTRICTEDIT="no" |
| |
| |
| WIKIMAILSMARTHOST="" |
| WIKIMAILFROM="" |
| WIKIMAILLOGIN="" |
| |
| |
| WIKILANGUAGE="en" |
| |
| |
| PREFIX=/usr |
| |
| |
| SHARE=$PREFIX/share/moin/ |
| |
| |
| USER=apache |
| GROUP=$USER |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| cd $WIKILOCATION |
| mkdir -p ${WIKIINSTANCE}/cgi-bin/ |
| mkdir -p ${WIKIINSTANCE}/${WIKISITENAME}.${MYDOMAIN}/ |
| cp -r ${SHARE}data/* ${WIKIINSTANCE}/${WIKISITENAME}.${MYDOMAIN}/ |
| cp -r ${SHARE}data ${WIKIINSTANCE}/ |
| cp -r ${SHARE}htdocs $WIKIINSTANCE |
| cp -r ${SHARE}underlay $WIKIINSTANCE |
| 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 |
| |
| |
| |
| |
| <VirtualHost *:80> |
| ServerName ${WIKISITENAME}.${MYDOMAIN}/ |
| ServerAdmin webmaster@${MYDOMAIN} |
| ErrorLog logs/wiki-${WIKISITENAME}.error_log |
| CustomLog logs/wiki-${WIKISITENAME}.access_log common |
| Alias /${WIKIURLPREFIX} "${WIKILOCATION}${WIKIINSTANCE}/htdocs/" |
| Alias /favicon.ico "${WIKILOCATION}${WIKIINSTANCE}/favicon.ico" |
| ScriptAlias / "${WIKILOCATION}${WIKIINSTANCE}/cgi-bin/moin.cgi/" |
| </VirtualHost> |
| APACHECONF |
| |
| |
| |
| |
| |
| |
| |
| |
| cat <<WIKICONFIG > ${WIKIINSTANCE}/cgi-bin/farmconfig.py |
| |
| |
| |
| |
| |
| |
| |
| |
| """ |
| MoinMoin - Configuration for a wiki farm |
| |
| If you run a single wiki only, you can keep the "wikis" list "as is" |
| (it has a single rule mapping all requests to mywiki.py). |
| |
| 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. |
| """ |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| wikis = [ |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ("${WIKISITENAME}", r"^${WIKISITENAME}.${MYDOMAIN}/.*$"), |
| ] |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| from MoinMoin.multiconfig import DefaultConfig |
| |
| |
| |
| |
| class FarmConfig(DefaultConfig): |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| data_underlay_dir = '${WIKILOCATION}${WIKIINSTANCE}/underlay/' |
| |
| |
| |
| |
| |
| url_prefix = '/${WIKIURLPREFIX}' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| navi_bar = [ |
| |
| |
| u'RecentChanges', |
| u'FindPage', |
| u'HelpContents', |
| ] |
| |
| |
| |
| page_category_regex = u'^Category[A-Z]' |
| page_dict_regex = u'[a-z]Dict$' |
| page_group_regex = u'[a-z]Group$' |
| page_template_regex = u'[a-z]Template$' |
| |
| |
| |
| |
| show_hosts = 1 |
| |
| |
| |
| show_interwiki = 1 |
| |
| |
| |
| |
| WIKICONFIG |
| |
| |
| |
| cat <<WIKICONFIG > ${WIKIINSTANCE}/cgi-bin/${WIKISITENAME}.py |
| |
| |
| |
| |
| |
| |
| |
| |
| """ |
| This is a sample config for a wiki that is part of a wiki farm and uses |
| farmconfig for common stuff. Here we define what has to be different from |
| the farm's common settings. |
| """ |
| |
| |
| from farmconfig import FarmConfig |
| |
| |
| class Config(FarmConfig): |
| |
| |
| sitename = u'${WIKISITENAME}' |
| interwikiname = '${WIKISITENAME}' |
| |
| |
| |
| |
| |
| |
| |
| page_front_page = u"${WIKIFRONTPAGE}" |
| |
| logo_string = u'<img src="/${WIKIURLPREFIX}/common/moinmoin.png" alt="MoinMoin Logo">' |
| |
| |
| theme_default = 'modern' |
| |
| |
| |
| |
| |
| |
| |
| language_default = '${WIKILANGUAGE}' |
| |
| data_dir = '${WIKILOCATION}${WIKIINSTANCE}/${WIKISITENAME}.${MYDOMAIN}/' |
| WIKICONFIG |
| |
| |
| if [ "$WIKISUPERUSER" != "" ]; then |
| |
| sed -i -e ' |
| /#superuser/s/#// |
| s/YourName/'$WIKISUPERUSER'/' ${WIKIINSTANCE}/cgi-bin/farmconfig.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/farmconfig.py |
| |
| fi |
| |
| if [ "$WIKIMAILSMARTHOST" != "" ]; then |
| |
| sed -i -e ' |
| /#mail_smarthost/s/#//' ${WIKIINSTANCE}/cgi-bin/farmconfig.py |
| |
| fi |
| |
| if [ "$WIKIMAILFROM" != "" ];then |
| |
| sed -i -e ' |
| /#mail_from/s/#//' ${WIKIINSTANCE}/cgi-bin/farmconfig.py |
| |
| fi |
| |
| if [ "$WIKIMAILLOGIN" != "" ];then |
| |
| sed -i -e ' |
| /#mail_login/s/#//' ${WIKIINSTANCE}/cgi-bin/farmconfig.py |
| |
| fi |
| |
| |
| |
| |
| |
| |
| chown -R $USER.$GROUP $WIKIINSTANCE |
| chmod -R ug=rwx $WIKIINSTANCE |
| chmod -R o-rwx $WIKIINSTANCE |
| cd $WIKIINSTANCE |
| chown -R $USER.$GOUP cgi-bin |
| chmod -R ug=rx cgi-bin |
| chmod -R o-rwx cgi-bin |
| |
| |
| |
| |
| less <<LASTMESSAGE |
| |
| ------------------------------------------------------------ |
| *** WIKIFARM INSTANCE CREATED *** |
| ------------------------------------------------------------ |
| |
| To finish the installation do the following: |
| |
| 1. Restart the Web Server (service httpd restart) |
| |
| 2. Open your browser and try the address: |
| http://${WIKISITENAME}.${MYDOMAIN}/" |
| |
| ------------------------------------------------------------ |
| *** HOWTO CREATE NEW WIKIS *** |
| ------------------------------------------------------------ |
| |
| To create new wikis into the farm check the following |
| steps: |
| |
| 1. Update your farmconfig.py file adding the new |
| wiki definition. Ex. |
| |
| ("mywiki2", r"^mywiki2.${MYDOMAIN}/.*$"), |
| |
| 2. Create a directory to store your new wiki data. |
| Ex. |
| |
| mkdir ${WIKILOCATION}${WIKIINSTANCE}/mywiki2.${MYDOMAIN}/ |
| |
| 3. Copy the content of data directory into the |
| recently created directory. Ex.: |
| |
| cp -rv ${WIKILOCATION}${WIKIINSTANCE}/data/* \\ |
| ${WIKILOCATION}${WIKIINSTANCE}/mywiki2.${MYDOMAIN}/ |
| |
| 4. Create a copy of your cgi-bin/mywiki.py into |
| cgi-bin/mywiki2.py. Then modify mywiki2 with the new |
| and specific configuration, related to the second |
| wiki. Ex.: |
| |
| sitename = u'mywiki2' # [Unicode] |
| interwikiname = 'mywiki2' |
| data_dir = '/var/www/wikifarm/mywiki2.${MYDOMAIN}/' |
| |
| |
| ------------------------------------------------------------ |
| *** GET TROUBLES ? *** |
| ------------------------------------------------------------ |
| |
| If you get some error when try to reach your wiki through |
| the web browser, check the following: |
| |
| 1. Add in your DNS or HOSTS file a record to your |
| wiki address. For example, if your domain is |
| ${MYDOMAIN} and your wiki is in a host with the ip |
| 192.168.0.1, and you want a wiki address like |
| http://${WIKISITENAME}.${MYDOMAIN}/ it is possible |
| that you should add a related CNAME record into your |
| DNS to your new wiki address, something like the |
| following: |
| |
| ${WIKISITENAME}.${MYDOMAIN}. IN CNAME ${MYDOMAINl}. |
| |
| Remeber to do a 'service named restart' after |
| changes. |
| |
| 2. Check Virtual Domain configuration in your Apache |
| server. It is possible that it is disabled so enable |
| it by uncomenting a line like the following: |
| |
| NameVirtualHost *:80 |
| |
| 3. It is possible that you want something in |
| http://${MYDOMAIN}/ other than the error that |
| sometimes appears there after you get your wiki |
| working into virtual domains. So you should create a |
| virtual domain for that address too and change the |
| DocumentoRoot param to wherever you want to load at |
| that moment. |
| |
| If you are still in troubles, you can write to: |
| <alain.reguera@gmail.com>. |
| |
| Other way ... |
| |
| Enjoy your installed wikifarm :). |
| |
| LASTMESSAGE |
| |