[Linux]Dokuwiki on Centos 6.3 安裝筆記
必要檔案
Apache 2.2.23 http://ftp.tc.edu.tw/pub/Apache//httpd/httpd-2.2.23.tar.gz
PHP 5.3.21 http://tw1.php.net/distributions/php-5.3.21.tar.gz
Dokuwiki http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2012-10-13.tgz
相依套件 ( 用 yum install 安裝即可 )
gcc-c++
make
expat-devel
perl
curl-devel
libxml2-devel
libjpeg-devel
libpng-devel
freetype-devel
安裝 Apache
1. 解開壓縮檔
tar zxvf httpd-2.2.23.tar.gz
2. 編譯程式
./configure --enable-dav-fs --enable-rewrite --enable-dav --enable-so --enable-cgi make make install
3. 透過 vi 產生啟動設定檔 ( /etc/init.d/httpd ) ,內容如下:
#!/bin/sh # # Startup script for the Apache Web Server # # chkconfig: 345 85 15 # description: Apache is a World Wide Web server. It is used to serve \ # HTML files and CGI. # processname: /usr/local/apache2/bin/httpd # pidfile: /usr/local/apache2/logs/httpd.pid # config: /usr/local/apache2/conf/httpd.conf # Source function library. . /etc/rc.d/init.d/functions # See how we were called. case "$1" in start) echo -n "Starting httpd:" daemon /usr/local/apache2/bin/httpd -DSSL echo touch /var/lock/subsys/httpd ;; stop) echo -n "Shutting down http:" killproc httpd echo rm -f /var/lock/subsys/httpd rm -f /var/run/httpd.pid ;; status) status httpd ;; restart) $0 stop $0 start ;; reload) echo -n "Reloading httpd:" killproc httpd -HUP echo ;; *) echo "Usage: $0 {start|stop|restart|reload|status}" exit 1 esac exit 0
4. 設定開機自動啟動 httpd
chmod 775 /etc/init.d/httpd chkconfig --add httpd
5. 建立 apache 服務啟動的身分
useradd -r -M -c "Apache Server" -d /dev/null -s /sbin/nologin apache
6. 修改 httpd.conf ( /usr/local/apache2/conf )
#User daemon #Group daemon User apache Group apache
安裝 PHP
1. 解開壓縮檔
tar zxvf php-5.3.21.tar.gz
2. 編譯程式
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/apache2/conf --prefix=/usr/local/php --enable-sockets --enable-ftp --with-zlib --with-freetype-dir --with-gd --with-curl --enable-mbstring --with-jpeg-dir make make install
3. 調整 Apache mime 設定,讓 Apache 可以支援 PHP ( /usr/local/apache2/conf/mime.types ),在檔案最後加入下面兩行設定
application/x-httpd-php php php4 phtml application/x-httpd-php-source phps
4. 調整防火牆 ( /etc/sysconfig/iptables ) 設定,要記得加在 REJECT 設定之前,讓 80 port 可以對外。
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
5. 建立測試檔案 index.php,如果沒有修改 httpd.conf 的路徑狀況下,將檔案放在 /usr/local/apache2/htdocs 下,檔案內容如下:
<?php phpinfo(); ?>
安裝 Dokuwiki
1. 解開壓縮檔
tar zxvf dokuwiki-2012-10-13.tgz
2. 放置到 /var/html 下
mkdir /var/html mv dokuwiki-2012-10-13 /var/html/wiki chown apache.apache -R /var/html/wiki
3. 更改 httpd.conf ,將 DocumentRoot 目錄更改到 /var/html 下
4. 重新啟動 Apache ( service httpd restart ),連接到 Wiki 下的目錄執行 install.php 進行安裝設定
5. 設定後就大功告成了,下次再來整理相關套件的使用了。