舜仔
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 移機並升級XOOPS超舊網站 ###### tags: `移機`, `XOOPS` 建立日期: 2021/11/17 因上面需求我接手一個超舊的Xoops網站, 上面說,只要維持該網站可以正常使用就好~~ 其他的我不用管,然後我就入坑了... 最近政府因為資安意識抬頭, 開始進行弱掃並要求修補 然後我手頭的這台主機CentOS已經超過支援期限, 裡面的Apache、PHP、MySQL全都是超舊版本... 無法更新... 只能下載原始碼自己編譯.... 只要不小心沒搞好就完了...不敢動~ 最近有個php的重大弱點被指名月底前限期改善, 不然就直接限制網路服務(斷網).... ![](https://i.imgur.com/jLcvJVt.png) ![](https://i.imgur.com/4y2BQEC.png) 好吧...只好嘗試移機並升級看看 ## 當前環境 ### 主機環境 軟體 CentOS 6 -> 7.X PHP 5.6.40 (cli) -> 7.4+ < 8 Apache 2.2.15 -> 最新 MySQL 5.5.62 -> 最新 XOOPS 2.5.7 -> 2.5.10 硬體 RAM 4G HDD 80G CPU 2核 ### XOOPS當前最新版本 Xoops輕鬆架網站上面看到今年06/15釋出的 XOOPS 輕鬆架 20210615 架站安裝導引檔(XOOPS 2.5.11 Beta) https://campus-xoops.tn.edu.tw/modules/tad_uploader/index.php?of_cat_sn=11 2.5.11正在Beta 查一下正體中文版的最後正式版與限制 XOOPS 2.5.10 正體中文版 釋出時間: 2019/05/03 限制: PHP >= 5.4 最後補丁檔釋出時間: 2021/10/06 (支援PHP7.4以上) https://campus-xoops.tn.edu.tw/modules/tad_modules/xoops.php 最後的正式版竟然是2019年 !! 補釘時間比Beta版新~ 有一個好處, 就是所使用的套件應該都支援2.5.10吧 XD ### XOOPS支援 xoops 2.5.10 透過補丁可支援PHP 7.4以上 那PHP 8呢? 套件是否也都支援PHP 8呢? 一步一步來... 先嘗試在PHP 7.4成功在考慮PHP 8 ## 測試環境選擇 WSL + CentOS 7 (放棄) 載點 https://github.com/mishamosher/CentOS-WSL 已用微軟內建防毒、KVRT、大蜘蛛掃過沒毒 教學 https://www.how2shout.com/how-to/install-centos-on-windows-10-subsystem-for-linux.html 然後參照我之前WSL相關的筆記 不過當時那篇文章是ubuntu / nginx, 我現在是CentOS / apache, 指令雖然不一樣但概念一樣 ### 測試環境建立 #### 更新yum源 see. http://ilms.csu.edu.tw/6736/doc/35571 #### 替換systemctl 使用WSL / Docker建立CentOS的話, 無法使用systemctl、service指令, 不然會發生`Failed to get D-Bus connection: Operation not permitted` 因為Docker的設計理念是在容器裡面不運行後台服務 網路上的解決方法是用python替換systemctl https://superuser.com/a/1556780 ``` sudo mv /usr/bin/systemctl /usr/bin/systemctl.old curl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py >temp sudo mv temp /usr/bin/systemctl sudo chmod +x /usr/bin/systemctl ``` #### 安裝資料庫 CentOS Linux 7 安裝 MySQL/MariaDB 資料庫教學 https://blog.gtwang.org/linux/centos-7-install-mariadb-mysql-server-tutorial/ 改root密碼就好,其他安全性沒差 啟動:`systemctl start mariadb` #### 伺服器 (這段事後補的)忘了安裝apache...失策!! 但發現已經有了 XD 安裝PHP的這一節會自動安裝 如果要裝的話要在php前XD `yum install -y httpd` 啟動:`systemctl start httpd` #### 安裝PHP 7.X版最後一個版本的就是7.4 參考這篇:[CentOS 7 上安裝 PHP 7.4](https://blog.hmes.kh.edu.tw/wordpress/wang1126/2021/03/10/285/) ``` systemctl start httpd systemctl start php-fpm ``` 電腦意外當機 然後systemctl就沒再執行成功過了.... 整個刪了重來... 裝完後資料庫mariadb服務就無法啟動... 直接移除重裝mariadb `ERROR:systemctl:Unit mariadb.service not found.` 移除mariadb改mysql... https://ithelp.ithome.com.tw/articles/10214666 ``` yum remove -y mariadb yum remove -y mariadb* yum install yum-utils -y yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm -y yum install mysql-community-server -y systemctl start mysqld ``` 啟動失敗.... WSL + CentOS放棄~ ## 測試環境選擇 VM CentOS 7 照網路上一般作法安裝 防火牆要開通 sudo setsebool -P httpd_read_user_content 1

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully