2014年8月15日 星期五

[研究] phpBB 3.0.12 論壇套件快速安裝程式 (CentOS 7.0 x86_x64)

[研究] phpBB 3.0.12 論壇套件快速安裝程式 (CentOS 7.0  x86_x64)

2014-08-15

這篇測試最擔心的是 CentOS 7.0 用 MariaDB 取代 MySQL,在某些網站/論壇安裝時候會出錯,不知 phpbb 會成功 or 失敗。

phpbb 官方網站
https://www.phpbb.com/

直接下載
https://www.phpbb.com/files/release/phpBB-3.0.12.zip
https://www.phpbb.com/files/release/phpBB-3.0.12.tar.bz2

繁體中文支援網站 - 竹貓星球
http://phpbb-tw.net/phpbb/

正體中文語言包
https://www.phpbb.com/customise/db/translation/mandarin_chinese_traditional_script/

直接下載 mandarin_chinese_traditional_script_1_0_5.zip
https://www.phpbb.com/customise/db/download/id_91411

[教學] phpBB 3 中文化語言檔與中文化按鈕安裝方法
http://phpbb-tw.net/phpbb/viewtopic.php?f=116&t=49968

資料庫名稱:phpbbDB
資料庫帳號:phpbbUser
資料庫密碼:phpbbPassword
可以依據自己喜好變更 (記得要修改快速安裝程式內容) 

快速安裝程式 phpbb3.0.12_centos7.0x64_install.sh 如下

* 你可以用 putty.exe 連上 CentOS,用 vi  phpbb3.0.12_centos6.4x64_install.sh 後把內容貼上,執行  chmod  +x  *.sh 變成可執行,再執行  ./phpbb3.0.12_centos6.4x64_install.sh

* 或在 MS-Windows 上寫好,用 WinSCP.exe 丟到 CentOS,執行 yum  -y  install  dos2unix,再執行  dos2unix   phpbb3.0.12_centos6.4x64_install.sh 轉成 Unix-Like 格式,再執行  ./phpbb3.0.12_centos6.4x64_install.sh

# phpbb3.0.12_centos7.0x64_install.sh
echo -e "\033[31;42m ********** Install phpbb 3.0.12 on CentOS 7.0 x64 ********** \033[0m"
echo -e "\033[31m 2014-08-15 ********** \033[0m"

# CentOS 7.0 上 iptable 有 Bug
# 先啟動,才能設定
systemctl restart firewalld

#要暫時開放 http port,可執行
firewall-cmd --add-service=http

#要永久開放 http port,可執行
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-port=22/tcp
systemctl restart firewalld
firewall-cmd  --list-all

#要停掉
#systemctl stop firewalld

#常用 firewall-cmd 命令
# firewall-cmd --state
# firewall-cmd --list-all
# firewall-cmd --list-interfaces
# firewall-cmd --get-service
# firewall-cmd --query-service service_name
# firewall-cmd --add-port=8080/tcp

#service iptables start
#iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#iptables -A INPUT -p icmp -j ACCEPT
#iptables -A INPUT -i lo -j ACCEPT
#iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
#iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
#iptables -A FORWARD -j REJECT --reject-with icmp-host-prohibited

# save iptables firewall rules to /etc/sysconfig/iptables
# iptables-save  or service iptables save
#service iptables save

# check rules after iptables restart
#service iptables restart

# show all rules
# service iptables status or iptables -L
#service iptables status

if [ "`cat /proc/version | grep centos | grep el7`" != "" ]; then
  OS="CentOS 7.x"
  echo "Detection your OS is CentOS 7.x"
else
  echo "[ERROR] Only Support CentOS 7.x"
  exit
fi

# Check SELinux status
if  [ "`grep SELINUX=disabled /etc/selinux/config`" == "" ]; then

# disable SELinux now
/usr/sbin/setenforce 0

# disable SELinux after every reboot
# echo "/usr/sbin/setenforce 0" >> /etc/rc.local  

#or
# disable SELinux always
sed -i -e "s@SELINUX=enforcing@#SELINUX=enforcing@"   /etc/selinux/config
sed -i -e "s@SELINUX=permissive@#SELINUX=permissive@"   /etc/selinux/config
sed -i -e "/SELINUX=/aSELINUX=disabled"   /etc/selinux/config
fi

# Kill nptd on running...
ProcessID="`ps aux | grep ntpd | awk '{print $2}' `"
for i in $ProcessID
do
  echo $i
  kill -9 $i
done
ntpdate tick.stdtime.gov.tw

# Kill yum on running...
ProcessID="`ps aux | grep yum | awk '{print $2}' `"
for i in $ProcessID
do
  echo $i
  kill -9 $i
done

if  [ "`grep SELINUX=disabled /etc/selinux/config`" == "" ]; then
/usr/sbin/setenforce 0
echo "/usr/sbin/setenforce 0" >> /etc/rc.local  
fi

# CentOS 7.0 用 MariaDB 取代 MySQL 
#yum -y install mysql mysql-server httpd php php-mysql php-mbstring php-gd
yum -y install  mariadb  mariadb-server httpd php php-mysql php-mbstring php-gd

#chkconfig httpd on
systemctl  enable  httpd

#chkconfig mysqld on
systemctl  enable  mariadb

#service httpd restart
systemctl  restart   httpd

#service mysqld restart
systemctl  restart   mariadb

if test -f phpBB-3.0.12.tar.bz2
then
    echo "phpbb 3.0.12.tar.bz2 exist"
else
    yum -y install wget
    wget https://www.phpbb.com/files/release/phpBB-3.0.12.tar.bz2
fi

if test -f  "mandarin_chinese_traditional_script_1_0_5.zip"
then
    echo "mandarin_chinese_traditional_script_1_0_5.zip exist"
else
  yum -y install wget
  wget https://www.phpbb.com/customise/db/download/id_91411
  mv id_91411 "mandarin_chinese_traditional_script_1_0_5.zip"
fi

tar jxvf phpBB-3.0.12.tar.bz2 -C /var/www/html/
mv /var/www/html/phpBB3  /var/www/html/phpbb

# ------------------------------------------------------------
# 因為 1.0.5 版中文語系套件目錄包含特殊字元,小弟測試不出在 shell script 中處理的方法,只能最後手動處理

# unzip "mandarin_chinese_traditional_script_1_0_5.zip"
# cp -R "mandarin_chinese_(traditional_script)_1_0_5/mandarin_chinese_(traditional_script)???_1_0_5/."  /var/www/html/phpbb

#[root@localhost ~]# find /var/www/html/phpbb -name zh_cmn_hant
#/var/www/html/phpbb/language/zh_cmn_hant
#/var/www/html/phpbb/styles/prosilver/imageset/zh_cmn_hant
#/var/www/html/phpbb/styles/subsilver2/imageset/zh_cmn_hant
# ------------------------------------------------------------

mysql -e "create database phpbbDB"
mysql -e "show databases; "

mysql -e "grant all on phpbbDB.* to phpbbUser@localhost; "
mysql -e "set password for phpbbUser@localhost=password('phpbbPassword'); "
mysql -e "flush privileges; "
mysql -e "use mysql;  select Host,User,Password from user; "


chmod a+w  /var/www/html/phpbb/config.php

# ------ 手動處理 中文介面套件 -------
# ------------------------------------------------------------
[root@localhost ~]# unzip   mandarin_chinese_traditional_script_1_0_5.zip
# [root@localhost ~]# cd mandarin_chinese_traditional_script_1_0_5
# 下一行輸入  cd  m 後直接按下 tab 按鍵,不要自己手動輸入
# [root@localhost mandarin_chinese_traditional_script_1_0_5]# cd mandarin_chinese_\(traditional_script\)???_1_0_5/
# [root@localhost mandarin_chinese_(traditional_script)OCA_1_0_5]# ls
# language  styles
# [root@localhost mandarin_chinese_(traditional_script)???_1_0_5]# cp -R . /var/www/html/phpbb
# [root@localhost mandarin_chinese_(traditional_script)???_1_0_5]#
# ------------------------------------------------------------
# 檢查
#[root@localhost ~]# find /var/www/html/phpbb -name zh_cmn_hant
# 結果應該這樣
#/var/www/html/phpbb/language/zh_cmn_hant
#/var/www/html/phpbb/styles/prosilver/imageset/zh_cmn_hant
#/var/www/html/phpbb/styles/subsilver2/imageset/zh_cmn_hant
# ------------------------------------------------------------

# 上面做好後,手動啟動瀏覽器,輸入 http://localhost/phpbb
# firefox http://localhost/phpbb &

# echo "When you finish Web-based Installation, press any key to continue ..."
# read


接下來進行 Web 介面安裝設定

(下圖) 因為 1.0.5 版中文語系套件目錄包含特殊字元,小弟測試不出在 shell script 中處理的方法,只能最後手動處理

(下圖) 切換成 "正體中文",按下 Change 按鈕






















(下圖) 照網頁說面刪除 install 目錄,拿掉 config.php 寫入權限

(下圖) 按下 F5 更新網頁畫面,警告訊息該消失了





安裝成功了

(完)

相關文章

[研究] phpBB 3.0.12 論壇套件快速安裝程式 (CentOS 7.0  x86_x64)
http://shaurong.blogspot.com/2014/08/phpbb-3012-centos-70-x86x64.html

[研究] phpBB 3.0.12 論壇套件快速安裝程式 (CentOS 6.4 x64)
http://shaurong.blogspot.com/2013/10/phpbb-3012-centos-64-x64.html

[研究] phpbb 3.0.10 快速安裝程式 (CentOS 6.2 x86)
http://shaurong.blogspot.tw/2012/01/phpbb-3.html

[研究] phpbb 3.0.10 安裝RSS模組(simple syndication 1.1.1b)
http://shaurong.blogspot.tw/2012/01/phpbb-3010-rsssimple-syndication-111b.html
simple syndication 1.1.1b 最後一次改版為 2007-06-20
http://sourceforge.net/projects/canver/files/phpBB3%20MODs/

[研究] phpbb 3.0.10 安裝TOP5模組(Integrated Topiclist 2.0 beta)
http://shaurong.blogspot.tw/2012/01/top5integrated-topiclist-2.html

沒有留言:

張貼留言