หน้าเว็บ

วันอาทิตย์ที่ 24 พฤศจิกายน พ.ศ. 2562

PHPBB3 : Install PHPBB3 V 3.0.12 On Ubuntu 18.04.3 และ Upgrade Version เป็น 3.0.14 รุ่นสุดท้าย

PHPBB3 : Install PHPBB3 V 3.0.12 On Ubuntu 18.04.3 และ Upgrade Version เป็น 3.0.14 รุ่นสุดท้าย
**** ไป Version 3.1 หรือ 3.2 ไม่ได้ เนื่องจาก ***
จาก 3.0 ไป 3.1 หรือ 3.2 ไม่ได้
1. MODs for 3.0.x are incompatible with 3.1.x and their functionality will be removed in the update process. Mod ที่จำเป็นต้องใช้ Blog Mod จะใช้ไม่ได้
2. Styles for 3.0.x cannot be installed or used on 3.1.x. Styles Template ไม่เข้ากัน
https://www.phpbb.com/community/viewtopic.php?t=2398876
https://www.phpbb.com/community/viewtopic.php?t=2402101

3. พบปัญหา PHP7 ถ้าจะใช้ Version 3.0 จะใช้ไม่ได้มี Bug
ถ้าใช้ PHP7.2 ไม่รองรับ 3.0 ต้อง 3.2 ถึงจะรองรับ PHP7
https://www.phpbb.com/customise/db/exte ... pic/162021
https://www.phpbb.com/community/viewtopic.php?t=2353436
https://www.phpbb.com/community/viewtop ... &t=2316556

Blog ไม่ขึ้น เมื่อใช้ที่ Version 3.0.12
เมื่อ Update เป็น 3.0.14 Blog ขึ้นแต่มี Error preg_replace() ใช้ไม่ได้
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 496: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4763: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)


ติดตั้ง Ubunt 18.04 และ PHPBB3 Version 3.0.12 เพื่อ Update เป็น 3.0.14
1. install Ubuntu 18.04.3 ต่อวง 0 เพื่อให้ได้ DHCP แล้วค่อยไปแก้ Network เป็น วง 2
2. copy config เดิมไว้ก่อน
  1. cp /etc/netplan/50-cloud-init.yaml 50-cloud-init.yaml.Backup
3. แก้ Network Fix IP เป็นวง 2
  1. nano /etc/netplan/50-cloud-init.yaml

  1. network:
  2.    version: 2
  3.    renderer: networkd
  4.    ethernets:
  5.       ens160:
  6.          addresses: [192.168.2.114/24]
  7.          gateway4: 192.168.2.2
  8.          nameservers:
  9.             addresses: [8.8.8.8,8.8.4.4,192.168.2.2]

4. Run netplan apply หรือ reboot
5. แก้ apt.conf
  1. nano /etc/apt/apt.conf
Acquire::http { Proxy "http://192.168.2.106:9999"; };
บาง update ไม่ได้ไม่มี Sources ใน 2.106 ให้ปิด apt.conf ไว้ แล้ว update upgrade ใหม่

6. Up และ Set locale
  1. apt-get update
  2. apt-get upgrade
  3. locale-gen en_US en_US.UTF-8 th_TH th_TH.UTF-8

7. Set time zome
  1. sudo timedatectl set-timezone Asia/Bangkok

ดู Time zone
  1. cat /etc/timezone

8. ติดตั้ง ntp
apt install ntp
nano /etc/ntp.conf
เพิ่ม
pool 192.168.2.2
  1. /etc/init.d/ntp restart
  2. ntpq -pn

ดูเวลาที่ sync มา
  1. date

9. สำคัญ ต้องติดตั้ง php5.6 เพื่อใช้งานจะได้ไม่มีปัญหา ตาม Blog
blog.php?u=3&b=1612

10. Database
  1. sudo apt-get install mysql-server


11. Creating phpBB Database and User
  1. sudo mysql -u root -p

ใส่รหัส mysql
เปลี่ยนรหัส root ถ้าจะใช้ root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxxx';

หรือ สร้าง user ใหม่
Create user 'sa'@'localhost' IDENTIFIED BY 'xxxxx';
  1. flush privileges;
  2. exit;


12. ติดตั้ง Phpmyadmin
  1. apt-get install phpmyadmin

เลือก apache
จะสร้าง user phpmyadmin ให้
ใส่รหัส 2 ครั้ง
ลองเข้า
192.168.2.114/phpmyadmin

ด้วย user root ในข้อ 11 หรือ user phpmyadmin ก็ได้

13. นำไฟล์ phpbb3_3.0.12 เข้าเครื่อง download มาหรือ wget มา หรือลง ftp เอาก็ได้
ในไฟล์ไปที่ www แล้วแตกไฟล์

14. ติดตั้งตามขึ้นตอนข้อที่ 19.
https://intranet.sci.com/blog.php?u=281&b=1750

15. จะเข้า Ldap ไม่ได้ จะเป็นหน้า ขาว Bug phpbb3
ดู log จะพบ
  1. tail -f /var/log/apache2/error.log
[Sat Nov 23 10:03:57.894290 2019] [:error] [pid 4332] [client 192.168.0.244:49572] PHP Fatal error: Cannot redeclare ldap_escape() in /var/www/html/includes/auth/auth_ldap.php on line 300, referer: http://192.168.2.114/adm/index.php?sid= ... 215f59d847

วิธีแก้

แก้ไฟล์ auth_ldap.php อยู่ใน Floder includes
/**
* Escapes an LDAP AttributeValue
*/
if (!function_exists('ldap_escape'))
{
function ldap_escape($string)
{
return str_replace(array('*', '\\', '(', ')'), array('\\*', '\\\\', '\\(', '\\)'), $string);
}
}

https://www.phpbb.com/community/viewtopic.php?t=2263381

16. ใส่ข้อมูล ldap แล้วไม่ผ่าน Error
Information
Could not find a login identity for admin.
ชื่ออื่นจะไม่ผ่าน login admin ต้องใช้ user administrator เท่านั้น
Information
The specified e-mail attribute does not exist.
ใส่ mail ไม่ผ่าน ไม่ต้องใส่ ถึงจะผ่าน
17. ทดลอง login user domain
18. นำ Database เก่ามา restore database sci_phpbb
จะเอาเข้าไม่ได้เพราะ file ใหญ่
ต้องแก้
  1. nano /etc/php/5.6/apache2/php.ini
แก้ 3 ค่า
upload_max_filesize = 50M
post_max_size = 50M
max_file_uploads = 50
restart apache
  1. /etc/init.d/apache2 restart
สร้าง database sci_phpbb แล้วนำ database เก่ามา Restore

19. ทดลอง copy file จากเครื่องเดิม ยกเว้น sci, file, _install_ ทดลองก่อนยังไม่ต้องเอามาเพราะไฟล์พวกนี้ใหญ่และเยอะ
copy inculde ต้องแก้ auth_ldap.php ตามด้านบนข้อ 15 ด้วย ไม่งั่นจะจอขาว
เอาไฟล์จากเครื่องจริงมาทับ

20. ทดลองเข้าดูจะต้องเข้าได้ก่อน และ Login ได้ แต่เมนูด้านข้างจะไม่มี
ต้อง เข้า ACP ไป Restart Template และ Teme ก่อน ข้อมูลต่าง ๆ Menu Link Blog ก็จะกลับมา พร้อมใช้งาน
ถ้ามีหน้าขาวว่างปล่างต้องดู log ว่ามี Error อะไร

21. Step Upgrade 3.0.12 --> 3.0.14
1. แตกไฟล์ 3.0.14 full ที่ Download มา https://download.phpbb.com/pub/release/3.0/3.0.14/
2. นำ Floder install ไปว่างไว้ใน /var/www/html (หรือ Floder อื่น Root ของ Apache และกำหนด สิทธ์ www-data และ 775)
3. เข้า 192.168.2.114/install/database_update.php
4. ลบหรือเปลี่ยนชื่อ install folder

21. สร้าง Database และนำ Database มา restore database sci และ อื่นๆ ที่จะใช้ แล้วค่อยทดลอง copy ใน Folder sci มาจะนาน
และ copy file มาด้วย
เสร็จขึ้นตอนการ Update ทดลอง ดู Menu ต่าง ๆ อาจจะมี Error ค่อยแก้



ไม่มีความคิดเห็น:

แสดงความคิดเห็น