Mindtouch (Dekiwiki)

    版本為 11:35, 26 Dec 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    更多文章:

    說明

    Mindtouch (前身為 Dekiwiki),自 2013 年下半年起,官方對 OpenSource 版已停止繼續維護,最後版為 Mindtouch 10.1.4。

    系統環境:

    • CentOS 5.8 32-bit
    • Apache 2.2.3
    • Mono 2.10.8
    • Mindtouch 10.1.4
       

    原始檔下載連結:

    安裝 Mono 2.10.8

    Installing Dependencies
    http://fedoraproject.org/wiki/EPEL

    // for CentOS 5
    wget http://mirror01.idc.hinet.net/EPEL/5/i386/epel-release-5-4.noarch.rpm
    rpm -Uvh epel-release-5-4.noarch.rpm
    
    // for CentOS 6
    yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
    
    yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
    

    Downloading and Compiling
    http://origin-download.mono-project.com/sources/mono/

    cd /usr/src
    wget http://download.mono-project.com/sources/mono/mono-2.10.8.tar.gz
    tar xzf mono-2.10.8.tar.gz
    cd mono-2.10.8
    ./configure --prefix=/opt/mono-2.10.8
    make && make install
    

    TIP:

    如果安裝過程遇到錯誤 Out of memory 時,就執行

    ulimit -v unlimited

    Completed the installation

    # /opt/mono-2.10.8/bin/mono --version
    Mono JIT compiler version 2.10.8 (tarball Sun Jul  6 02:48:03 EDT 2014)
    Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
            TLS:           __thread
            SIGSEGV:       altstack
            Notifications: epoll
            Architecture:  x86
            Disabled:      none
            Misc:          softdebug
            LLVM:          supported, not enabled.
            GC:            Included Boehm (with typed GC and Parallel Mark)
    

    安裝 MySQL 與其他套件

    for CentOS 6

    yum install mysql-server httpd php-common php php-mysql php-gd \
    php-mbstring php-mcrypt wv links tidy html2ps mod_ssl \
    poppler-utils html2text mod_proxy_html
    

    Install Prince

    wget http://www.princexml.com/download/prince-11.3-1.centos6.x86_64.rpm
    rpm -ivh prince-11.3-1.centos6.x86_64.rpm 

    安裝 Mindtouch 10.1.4

    下載

    cd /etc/yum.repos.d
    wget http://repo.mindtouch.com/CentOS_5/home:mindtouch.repo -O mindtouch.repo

    或者,手動新增 /etc/yum.repo.d/mindtouch.repo

    [home_mindtouch]
    name=mindtouch's Home Project (CentOS_5)
    type=rpm-md
    baseurl=http://repo.mindtouch.com/CentOS_5/
    gpgcheck=1
    gpgkey=http://repo.mindtouch.com/CentOS_5/repodata/repomd.xml.key
    enabled=1
    

    開始安裝

    yum install mindtouch
    

    TIPs:

    如果有遇到任何問題,將 mindtouch 改成 dekiwiki 試試。

    初始化 Mindtouch

    設定 Apache
    新增 /etc/httpd/conf.d/deki-apache.conf

    <VirtualHost 192.168.7.51:80>
            ServerName www.osslab.org.tw
            #ServerAlias
    
            ErrorLog /var/log/httpd/error-dekiwiki.log
            CustomLog /var/log/httpd/access-dekiwiki.log common
    
            DocumentRoot "/var/www/dekiwiki"
    
            RewriteEngine On
            RewriteCond %{REQUEST_URI} ^/$
            RewriteRule ^/$ /index.php?title= [L,QSA,NE]
    
            RewriteCond %{REQUEST_URI} !^/(@api|editor|skins|config|deki)/
            RewriteCond %{REQUEST_URI} !^/index\.php
            RewriteCond %{REQUEST_URI} !^/favicon\.ico$
            RewriteCond %{REQUEST_URI} !^/robots\.txt$
            RewriteCond %{REQUEST_URI} !^/error/(.*)\.var$
            RewriteCond %{QUERY_STRING} ^$ [OR] %{REQUEST_URI} ^/Special:Search
            RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA,NE]
    
            # Bug: 5252 https rewrite/proxy rules
            RewriteCond %{HTTPS} =on
            RewriteCond %{REQUEST_URI} ^/@api/
            RewriteCond %{QUERY_STRING} !^(.*)dream.in.scheme= [NC]
            RewriteRule ^/@api/(.*)$ http://localhost:8081/$1?dream.in.scheme=https [QSA,P,L]
    
            RewriteCond %{HTTPS} =on
            RewriteCond %{REQUEST_URI} ^/@api/
            RewriteCond %{QUERY_STRING} ^(.*)dream.in.scheme= [NC]
            RewriteRule ^/@api/(.*)$ http://localhost:8081/$1 [QSA,P,L]
            # End Bug: 5252
    
            # deki-api uses encoded slashes in query parameters so AllowEncodedSlashes must be On
            AllowEncodedSlashes On
    
            # FIXME:
            # Some php flags we need. These are only needed until all
            # the short php open tags are changed to long in the source code.
            php_flag short_open_tag on
            # Allow short open tags and turn off E_NOTICE messages
            php_value error_reporting "E_ALL & ~E_NOTICE"
            # Setting php memory parameters
            # php_value memory_limit "128M"
            # php_value post_max_size "64M"
            # php_value upload_max_filesize "64M"
    
            # mod_proxy rules
            ProxyPass /@api http://localhost:8081 retry=1
            ProxyPassReverse /@api http://localhost:8081
            SetEnv force-proxy-request-1.0 1
            SetEnv proxy-nokeepalive 1
    
            <Proxy *>
              AddDefaultCharset off
              Order deny,allow
              Deny from all
              Allow from all
            </Proxy>
    </VirtualHost>
    
    <Directory "/var/www/dekiwiki">
            # Possible values for the Options directive are "None", "All",
            # or any combination of:
            #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
            #
            # Note that "MultiViews" must be named *explicitly* --- "Options All"
            # doesn't give it to you.
            #
            # The Options directive is both complicated and important.  Please see
            # http://httpd.apache.org/docs-2.2/mod/core.html#options
            # for more information.
            Options None
            # AllowOverride controls what directives may be placed in .htaccess files.
            # It can be "All", "None", or any combination of the keywords:
            #   Options FileInfo AuthConfig Limit
            AllowOverride All
            # Controls who can get stuff from this server.
            Order allow,deny
            Allow from all
    </Directory>
    

    設定 Mindtouch
    NOTE: 這裡是假設從舊網站轉移至新網站,不適用新安裝。

    複製舊網站的設定檔

    /etc/dekiwiki/mindtouch.deki.startup.xml
    /etc/dekiwiki/mindtouch.host.conf 
    

    修改 /etc/dekiwiki/mindtouch.host.conf

    ...
    #MONO="/usr/bin/mono"
    MONO="/opt/mono-2.10.8/bin/mono"
    ... 
    

    修改 /etc/dekiwiki/mindtouch.deki.startup.xml

    <host>www.osslab.tw</host>^M
    <host>m.osslab.tw</host>^M
    
    <db-server>localhost</db-server>^M
    <db-port>3306</db-port>^M
    <db-catalog>wikidb</db-catalog>^M
    <db-user>wikiuser</db-user>^M
    <db-password hidden="true">1234567890</db-password>^
    

    回復舊網站資料

    建立資料庫

    mysql -u root -p
    
    mysql> create database wikidb;
    mysql> create user 'wikiuser'@'localhost' identified by 'db_pass';
    mysql> grant all privileges on wikidb.* to 'wikiuser'@'localhost';
    

    回復舊資料庫

     mysql -u wikiuser -p wikidb < wikidb.sql
    

    回復網站程式

    cd /var/www
    mv dekiwiki dekiwiki_old
    tar xzf ~/web_backup/20140705-010335/html.tar.gz
    chown -R dekiwiki:apache dekiwiki/
    

    啟動 Mindtouch

    chkconfig mysqld on
    chkconfig httpd on
    chkconfig dekiwiki on
    
    service httpd start
    service dekiwiki start 
    
    Powered by MindTouch Core