跳转到帖子
在手机APP中查看

一个更好的浏览方法。了解更多

PHP论坛人

主屏幕上的全屏APP,带有推送通知、徽章等。

在iOS和iPadOS上安装此APP
  1. 在Safari中轻敲分享图标
  2. 滚动菜单并轻敲添加到主屏幕
  3. 轻敲右上角的添加按钮。
在安卓上安装此APP
  1. 轻敲浏览器右上角的三个点菜单 (⋮) 。
  2. 轻敲添加到主屏幕安装APP
  3. 轻敲安装进行确认。

所有动态

此动态墙会自动更新

  1. 今天
  2. Invision Community論壇啟用 Redis 加速 為什麼論壇需要 Redis? 提升讀取速度:記憶體存取比硬碟快數十倍,顯著提升頁面加載速度 。 減輕資料庫壓力:大幅降低 MySQL 的查詢負載,讓資料庫在高負載時仍能穩定運作 。 改善使用者體驗:減少瀏覽延遲,特別是在高併發存取時能維持流暢度 。 檢查論壇是否啟用Redis 論壇後端 -> 系統 -> 獲得支援 -> 快取引擎:None (表示未啟用Redis) 設置Redis加速 論壇後端 -> 系統 -> 進階配置 -> 資料儲存 -> 預設情況是 如果在安裝LNMP過程中,有確實安裝Redis,就能選擇 資料儲存方式 -> Redis 快取方式 -> Redis IPS論壇有兩個地方可啟用Redis,在此由自己的VPS硬體配置決定開啟或關掉誰 Redis server address -> 127.0.0.1 Redis port number -> 6379 使用Redis來減少MySQL Overhead -> v 是 Redis將用於會話、管理主題瀏覽數 -> 儲存 接下來,出現選項 [下載 constants.php],按下按鈕,下載constants.php這個檔案 再使用SFTP將constants.php上傳到IPS論壇的根目錄 為什麼需要 constants.php? 論壇會透過此檔案定義Redis連線與快取設定 若檔案不存在,Redis將不會生效 當SFTP上傳 constants.php 這個檔案後,回到瀏覽器,按下 [繼續] 接下來,SSH登入 修正檔案擁有者與權限,設為 www-data (避免Nginx/PHP 使用者無法讀寫) chown www-data:www-data /var/www/域名.com/constants.php cd /var/www/域名.com 確認輸出顯示為 www-data www-data ls -l 回到瀏覽器,論壇後端 -> 系統 -> 獲得支援 -> 可以看到 快取引擎:Redis 表示論壇已啟用Redis
  3. Invision Community論壇啟用偽靜態與自訂友善網址 事前準備 在前面步驟,已於Nginx配置了偽靜態規則 (/etc/nginx/rewrite/ips.conf) 現在,還需要到IPS論壇後端開啟偽靜態功能,並修改網址的顯示方式 ------------------------------------ IPS論壇後端,也需要設置偽靜態 ------------------------------------ 論壇後端 -> 系統 -> 搜尋引擎最佳化 -> 偽靜態網址? -> [v] 是 -> 確認 回到論壇前端,論壇網址將不再顯示 index.php 自訂友善網址格式 如果希望網址更簡潔 (移除標題文字),可依以下步驟調整: https://域名.com/topic/2-新主題標題/ 改法為 論壇後端 -> 系統 -> 進階配置 -> 友善網址 -> 看到友善網址後面連接 -?? 問號的 -> 編輯 -> 友善網址 -> 只刪掉 -{?} 然後按下確認,千萬別改錯了 這種 -{?} 要修改的地方很多,並且插件安裝越多,也就修改越多 以後再安裝什麼插件,一樣要來此處修改它,別忘了 修改好後的友善網址 ------------------------- 清除快取 ------------------------- 論壇後端 -> 系統 -> 支援 -> 清除快取 完成以上步驟後,論壇網址將從: https://域名.com/topic/2-新主題標題/ 變為更簡潔的格式: https://域名.com/topic/2/ 注意事項 修改網址結構可能影響搜尋引擎收錄,建議在 Google Search Console 提交新的網站地圖 若為已經有流量的老站,不建議頻繁變更網址結構
  4. 前几天
  5. Jack回复到 Jack的主题在 Debian 13
    Linux配置完成後,開始手搓LNMP,或者安裝寶塔面板並安裝LNMP 手搓LNMP for Invision Community 5.0 手搓LNMP for vBulletin 手搓LNMP for XenForo 寶塔面板
  6. 之前的
  7. 大马猴注册了
  8. phpMyAdmin建立新的資料庫用戶名、資料庫用戶密碼、資料庫名 ---------------------------------------------------------------------- phpMyAdmin建立新的資料庫用戶名、資料庫用戶密碼 ---------------------------------------------------------------------- phpMyAdmin首頁 -> 使用者帳號 -> 新增使用者帳號 通常是建立 域名_com ,但不能用中文字 使用者名稱:xxxx_com 主機名稱:localhost 密碼:請使用底下的產生密碼 -> 按 產生,將產生隨機密碼 如果你的VPS只安裝一個論壇,那麼權限都給出 全域權限 -> v 全選 -> 執行 將顯示 已新增了新的使用者。 ---------------------------------------------------------------------- phpMyAdmin建立資料庫名 ---------------------------------------------------------------------- phpMyAdmin首頁 -> 上方的資料庫選項 -> 建立新資料庫 -> 資料庫名 通常也是資料庫用戶名 xxxx_com 編碼與排序 -> 選擇 utf8mb4_unicode_ci -> 建立 ---------------------------------------------------------------------- 資料庫用戶名、資料庫用戶密碼、資料庫名 ---------------------------------------------------------------------- 資料庫用戶名 -> xxxx_com 資料庫用戶密碼 -> 自動產生的隨機密碼 資料庫名 -> xxxx_com
  9. 安裝phpMyAdmin、修改為 888 port、使用IP當phpMyAdmin的網址來管理資料庫 ---------------------------- 安裝phpMyAdmin ---------------------------- 開始修改 vi /etc/nginx/sites-available/default 搜尋內容 index index.html index.htm index.nginx-debian.html; 修改為 index index.html index.htm index.php; ESC儲存並離開 :wq 先到phpMyAdmin官網,最新版本是多少,例如 phpMyAdmin 5.2.3 https://www.phpmyadmin.net/ cd /root wget -P Downloads https://files.phpmyadmin.net/phpmyadmin.keyring wget -P Downloads https://files.phpmyadmin.net/phpMyAdmin/5.2.3/phpMyAdmin-5.2.3-all-languages.tar.gz cd Downloads gpg --import phpmyadmin.keyring wget https://files.phpmyadmin.net/phpMyAdmin/5.2.3/phpMyAdmin-5.2.3-all-languages.tar.gz.asc gpg --verify phpMyAdmin-5.2.3-all-languages.tar.gz.asc mkdir /var/www/html/phpMyAdmin tar xvf phpMyAdmin-5.2.3-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpMyAdmin cp /var/www/html/phpMyAdmin/config.sample.inc.php /var/www/html/phpMyAdmin/config.inc.php vi /var/www/html/phpMyAdmin/config.inc.php 搜尋 $cfg['blowfish_secret'] = ''; 修改為 $cfg['blowfish_secret'] = '自定一個長度為32位元的隨機字串'; ESC儲存並離開 :wq chmod 660 /var/www/html/phpMyAdmin/config.inc.php chown -R www-data:www-data /var/www/html/phpMyAdmin 重新加载Nginx nginx -t systemctl reload nginx 然後修改 (請注意這是搭配PHP 8.4的設置) vi /etc/nginx/sites-available/default 搜尋這代碼 location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } 然後,在這段代碼的底下,加入 location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; } ESC儲存並離開 :wq 重新加载Nginx nginx -t systemctl reload nginx 現在瀏覽器可以進入phpMyAdmin (此時 http 是用 80 port) http://你的IP/phpMyAdmin --------------------------------- phpMyAdmin改為 888 port --------------------------------- 我慣用伺服器IP當作phpMyAdmin的網址,並改為 888 port,利用防火牆擋住全部IP連入,限自己的IP才能連入phpMyAdmin 預設網站目錄是放在 /var/www/html/phpMyAdmin/ 修改為 888 port,才能連到phpMyAdmin vi /etc/nginx/sites-available/default 搜尋 listen 80 default_server; 修改為 listen 888 default_server; 下面那一行,使用 # 註解掉 #listen [::]:80 default_server; ESC儲存並離開 :wq 重新加载Nginx nginx -t systemctl reload nginx 重開機,再次確認是否能正確運行 reboot phpMyAdmin 已改為 888 port 然後雲主機的WAF防火牆、iptables防火牆,也要修改 888 port 只允許自己的IP才可以連入 這時,防火牆都修改完畢,瀏覽器進入你的伺服器IP http://你的IP:888/phpMyAdmin/ 你將看到這個訊息 尚未設定 phpMyAdmin 設定儲存空間,部份延伸功能將無法使用。了解原因。 或者前往任一個資料庫的「操作」分頁設定。 你需要下載 https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz 解壓縮 phpMyAdmin-latest-all-languages.tar.gz 尋找目錄中 /sql/create_tables.sql 找到 create_tables.sql 返回瀏覽器 phpMyAdmin -> 匯入 -> 要匯入的檔案 -> 選擇檔案 -> create_tables.sql -> 匯入 將顯示 完成匯入,共執行了 21 個查詢指令。 (create_tables.sql) 然後返回phpMyAdmin首頁 尚未設定 phpMyAdmin 設定儲存空間,部份延伸功能將無法使用。-----> 已經沒有顯示這一條訊息
  10. 安裝第三方Nginx 1.29、更改主機名 --------------- 安裝Nginx --------------- 本教學適用於 Debian 13 (需root權限),假設系統尚未安裝Nginx 此來源 https://n.wtf/ 提供第三方 Nginx(目前為 1.29.x),若想使用 Debian 官方版本可略過此步 增加 https://n.wtf GPG Key curl -sSL https://n.wtf/public.key | gpg --dearmor > /usr/share/keyrings/n.wtf.gpg 加入 https://n.wtf/ 的Nginx源 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/n.wtf.gpg] https://mirror-cdn.xtom.com/sb/nginx/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/n.wtf.list apt update apt install zip unzip apt install curl vim wget gnupg dpkg apt-transport-https lsb-release ca-certificates 安裝nginx apt install nginx-extras -y 瀏覽nginx版本,顯示 nginx version: nginx-n.wtf/1.29.4 nginx -V ---------------------------- 更改主機名 ---------------------------- 更改主機名,修改 hostname 可能影響提示字元或部分服務,非必要可略過 hostnamectl set-hostname 域名.com 離開SSH exit 再次SSH登入 將顯示為 Linux 域名.com 6.12.63+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.63-1 (2025-12-30) x86_64 ---------------------------- 配置Nginx ---------------------------- 預設網站目錄 mkdir -p /var/www/域名.com 新增 域名.com.conf vi /etc/nginx/sites-available/域名.com.conf server { listen 80; root /var/www/域名.com; index index.html index.htm; server_name 域名.com; location / { try_files $uri $uri/ =404; } } ESC儲存並離開 :wq 若 /etc/nginx/sites-enabled/ 已存在其他網站,請先確認不衝突 軟連結到 /etc/nginx/sites-enabled 目錄,讓它生效 ln -s /etc/nginx/sites-available/域名.com.conf /etc/nginx/sites-enabled/域名.com.conf 重新載入Nginx nginx -t systemctl reload nginx 在網站目錄中,新增一個index.html vi /var/www/域名.com/index.html 在此檔案中,複製並貼上 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>TEST</title> </head> <body> TEST </body> </html> ESC儲存並離開 :wq ---------------------------------- 開機啟動Nginx ---------------------------------- 開機啟動 systemctl enable nginx 啟動 systemctl start nginx 重開機 reboot 確認開機有自動啟動nginx,顯示 Active: active (running) systemctl status nginx 這時,瀏覽器可進入你的網站 http://域名.com/index.html
  11. 安裝資料庫MariaDB 11.8與配置,資料庫最佳化 4 - 8G RAM -------------------------------- 安裝MariaDB與配置 -------------------------------- 下載GPG Key curl -sSL https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor > /usr/share/keyrings/mariadb.gpg 加入MariaDB 11.8的源 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mariadb.gpg] https://mirror-cdn.xtom.com/mariadb/repo/11.8/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/mariadb.list 更新 apt update 安裝 MariaDB 11.8.x 最新穩定版 apt install mariadb-server mariadb-client Configuring mariadb-server Feedback plugin collects basic anonymous statistical information that can be used by the developers to improve MariaDB. This is an easy way to help with MariaDB development. Collected statistics can be viewed at http://mariadb.org/feedback-plugin Enable the Feedback plugin and submit anonymous usage information? <Yes> /<No> 選擇 <No> 瀏覽版本,已安裝 11.8.5-MariaDB mariadb -V ------------------- 安全設置 ------------------- mariadb-secure-installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! 注意:建議所有 MariaDB 運行此腳本的所有部分生產使用中的伺服器! 請仔細閱讀每個步驟! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. 為了登入 MariaDB 並確保其安全,我們需要 root 使用者目前的密碼。如果你剛剛安裝了MariaDB,並且尚未設定root密碼,則只需在此處按Enter 鍵即可。 Enter current password for root (enter for none): 輸入 root 的目前密碼 (不輸入): 按 Enter OK, successfully used password, moving on... 好的,密碼已成功使用,繼續... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. 設定root密碼或使用 unix_socket 可確保任何人在未經適當授權的情況下都無法登入MariaDB root使用者。 You already have your root account protected, so you can safely answer 'n'. 你的root帳戶已受到保護,因此你可以安全地回答 'n'。 Switch to unix_socket authentication [Y/n] 切換到 unix_socket 身份驗證 [Y/n] 按 n 若為單機伺服器,建議按 Y,使用 unix_socket 驗證(較安全) Change the root password? [Y/n] 更改root密碼? [Y/n] 按 y New password: 輸入你自定義root的密碼 Re-enter new password: 再次輸入你自定義root的密碼 By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. 預設情況下,MariaDB安裝有一個匿名用戶,允許任何人登入MariaDB,而無需為其建立用戶帳戶。這僅用於測試,並使安裝過程更加順利。你應該在進入生產環境之前刪除它們。 Remove anonymous users? [Y/n] 刪除匿名用戶? [Y/n] 按 y Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. 通常,只允許root從 'localhost' 連線。這可確保其他人無法從網路猜測root密碼。 Disallow root login remotely? [Y/n] 禁止遠端root登入? [Y/n] 要按 y By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. 預設情況下,MariaDB附帶一個名為 'test' 的資料庫,任何人都可以存取。這也僅用於測試,應在進入生產環境之前將其刪除。 Remove test database and access to it? [Y/n] 刪除測試資料庫並存取它? 按 y Reloading the privilege tables will ensure that all changes made so far will take effect immediately. 重新載入權限表將確保迄今為止所做的所有變更都會立即生效。 Reload privilege tables now? [Y/n] 現在重新載入權限表? [Y/n] 按 y All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! 重啟資料庫 systemctl restart mariadb -------------- UTF-8 -------------- vi /etc/mysql/mariadb.conf.d/50-client.cnf 在 [client] 底下,加入這一行 default-character-set = utf8mb4 # # This group is read by the client library # Use it for options that affect all clients, but not the server # [client] # Example of client certificate usage #ssl-cert = /etc/mysql/client-cert.pem #ssl-key = /etc/mysql/client-key.pem # # Allow only TLS encrypted connections #ssl-verify-server-cert = on default-character-set = utf8mb4 # This group is *never* read by mysql client library, though this # /etc/mysql/mariadb.cnf.d/client.cnf file is not read by Oracle MySQL # client anyway. # If you use the same .cnf file for MySQL and MariaDB, # use it for MariaDB-only client options [client-mariadb] ESC儲存並離開 :wq --------------------------------------------------------------------------------- 資料庫最佳化 / 數據庫優化 4 - 8 GB --------------------------------------------------------------------------------- 修改 vi /etc/mysql/mariadb.conf.d/50-server.cnf # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # this is read by the standalone daemon and embedded servers [server] # this is only for the mariadbd daemon [mariadbd] # # * Basic Settings # port = 3306 user = mariadb pid-file = /run/mysqld/mysqld.pid basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp # Broken reverse DNS slows down connections considerably and name resolve is # safe to skip if there are no "host by domain name" access grants #skip-name-resolve # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. #預設僅監聽 localhost,如需遠端連線請自行調整 bind-address = 127.0.0.1 # # * Fine Tuning # #MyISAM index buffer,多數 InnoDB 環境影響有限 key_buffer_size = 32M #大型資料庫匯入,需求可提高 max_allowed_packet = 1G table_open_cache = 384 sort_buffer_size = 1024K net_buffer_length = 8K read_buffer_size = 1024K read_rnd_buffer_size = 768K myisam_sort_buffer_size = 8M thread_cache_size = 128 tmp_table_size = 128M max_heap_table_size = 128M explicit_defaults_for_timestamp = true #skip-networking max_connections = 100 max_connect_errors = 100 open_files_limit = 65535 #若不使用主從複製或 PITR,可考慮關閉 binlog log-bin=mysql-bin binlog_format=mixed server-id = 1 expire_logs_days = 10 default_storage_engine = InnoDB # # * Logging and Replication # expire_logs_days = 10 # # * Character sets # # MariaDB default is now utf8 4-byte character set. # No Debian specific default is required. # # * InnoDB # innodb_file_per_table = 1 innodb_buffer_pool_size = 4G #若調整此值導致無法啟動,請確認 ib_logfile 已重新建立 innodb_log_file_size = 256M innodb_log_buffer_size = 16M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 [mysqldump] quick #大型資料庫匯入,需求可提高 max_allowed_packet = 1G [mysql] no-auto-rehash [myisamchk] key_buffer_size = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! # Most important is to give InnoDB 80 % of the system RAM for buffer use: # https://mariadb.com/kb/en/innodb-system-variables/#innodb_buffer_pool_size #innodb_buffer_pool_size = 8G # this is only for embedded server [embedded] # This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadbd] # This group is only read by MariaDB-11.8 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-11.8] ESC儲存並離開 :wq ------------------------------------- 重啟 & 重開機 ------------------------------------- 重啟 systemctl restart mariadb 開機啟動mariadb systemctl enable mariadb 啟動mariadb systemctl start mariadb 瀏覽狀態 systemctl status mariadb 重開機 reboot 重開機,確認MariaDB可以自動啟動,顯示 Active: active (running) systemctl status mariadb
  12. 安裝資料庫MariaDB 11.8與配置,資料庫最佳化 2 - 3G RAM -------------------------------- 安裝MariaDB與配置 -------------------------------- 下載GPG Key curl -sSL https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor > /usr/share/keyrings/mariadb.gpg 加入MariaDB 11.8的源 echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/mariadb.gpg] https://mirror-cdn.xtom.com/mariadb/repo/11.8/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/mariadb.list 更新系統 apt update 安裝 MariaDB 11.8.x 最新穩定版 apt install mariadb-server mariadb-client Configuring mariadb-server Feedback plugin collects basic anonymous statistical information that can be used by the developers to improve MariaDB. This is an easy way to help with MariaDB development. Collected statistics can be viewed at http://mariadb.org/feedback-plugin Enable the Feedback plugin and submit anonymous usage information? <Yes> /<No> 選擇 <No> 瀏覽版本,已安裝 11.8.5-MariaDB mariadb -V ------------------- 安全設置 ------------------- mariadb-secure-installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! 注意:建議所有 MariaDB 運行此腳本的所有部分生產使用中的伺服器! 請仔細閱讀每個步驟! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. 為了登入 MariaDB 並確保其安全,我們需要 root 使用者目前的密碼。如果你剛剛安裝了MariaDB,並且尚未設定root密碼,則只需在此處按Enter 鍵即可。 Enter current password for root (enter for none): 輸入 root 的目前密碼 (不輸入): 按 Enter OK, successfully used password, moving on... 好的,密碼已成功使用,繼續... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. 設定root密碼或使用 unix_socket 可確保任何人在未經適當授權的情況下都無法登入MariaDB root使用者。 You already have your root account protected, so you can safely answer 'n'. 你的root帳戶已受到保護,因此你可以安全地回答 'n'。 Switch to unix_socket authentication [Y/n] 切換到 unix_socket 身份驗證 [Y/n] 按 n 若為單機伺服器,建議按 Y,使用 unix_socket 驗證(較安全) Change the root password? [Y/n] 更改root密碼? [Y/n] 按 y New password: 輸入你自定義root的密碼 Re-enter new password: 再次輸入你自定義root的密碼 By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. 預設情況下,MariaDB安裝有一個匿名用戶,允許任何人登入MariaDB,而無需為其建立用戶帳戶。這僅用於測試,並使安裝過程更加順利。你應該在進入生產環境之前刪除它們。 Remove anonymous users? [Y/n] 刪除匿名用戶? [Y/n] 按 y Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. 通常,只允許root從 'localhost' 連線。這可確保其他人無法從網路猜測root密碼。 Disallow root login remotely? [Y/n] 禁止遠端root登入? [Y/n] 要按 y By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. 預設情況下,MariaDB附帶一個名為 'test' 的資料庫,任何人都可以存取。這也僅用於測試,應在進入生產環境之前將其刪除。 Remove test database and access to it? [Y/n] 刪除測試資料庫並存取它? 按 y Reloading the privilege tables will ensure that all changes made so far will take effect immediately. 重新載入權限表將確保迄今為止所做的所有變更都會立即生效。 Reload privilege tables now? [Y/n] 現在重新載入權限表? [Y/n] 按 y All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! 重啟資料庫 systemctl restart mariadb -------------- UTF-8 -------------- vi /etc/mysql/mariadb.conf.d/50-client.cnf 在 [client] 底下,加入這一行 default-character-set = utf8mb4 # # This group is read by the client library # Use it for options that affect all clients, but not the server # [client] # Example of client certificate usage #ssl-cert = /etc/mysql/client-cert.pem #ssl-key = /etc/mysql/client-key.pem # # Allow only TLS encrypted connections #ssl-verify-server-cert = on default-character-set = utf8mb4 # This group is *never* read by mysql client library, though this # /etc/mysql/mariadb.cnf.d/client.cnf file is not read by Oracle MySQL # client anyway. # If you use the same .cnf file for MySQL and MariaDB, # use it for MariaDB-only client options [client-mariadb] ESC儲存並離開 :wq --------------------------------------------------------------------------------- 資料庫最佳化 / 數據庫優化 2 - 3 GB --------------------------------------------------------------------------------- 修改 vi /etc/mysql/mariadb.conf.d/50-server.cnf # These groups are read by MariaDB server. # Use it for options that only the server (but not clients) should see # this is read by the standalone daemon and embedded servers [server] # this is only for the mariadbd daemon [mariadbd] # # * Basic Settings # port = 3306 user = mariadb pid-file = /run/mysqld/mysqld.pid basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp # Broken reverse DNS slows down connections considerably and name resolve is # safe to skip if there are no "host by domain name" access grants #skip-name-resolve # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. #預設僅監聽 localhost,如需遠端連線請自行調整 bind-address = 127.0.0.1 # # * Fine Tuning # #MyISAM index buffer,多數 InnoDB 環境影響有限 key_buffer_size = 32M #大型資料庫匯入,需求可提高 max_allowed_packet = 1G table_open_cache = 192 sort_buffer_size = 768K net_buffer_length = 8K read_buffer_size = 768K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M thread_cache_size = 96 tmp_table_size = 128M max_heap_table_size = 128M explicit_defaults_for_timestamp = true #skip-networking max_connections = 100 max_connect_errors = 100 open_files_limit = 65535 #若不使用主從複製或 PITR,可考慮關閉 binlog log-bin=mysql-bin binlog_format=mixed server-id = 1 expire_logs_days = 10 default_storage_engine = InnoDB # # * Logging and Replication # expire_logs_days = 10 # # * Character sets # # MariaDB default is now utf8 4-byte character set. # No Debian specific default is required. # # * InnoDB # innodb_file_per_table = 1 innodb_buffer_pool_size = 2G #若調整此值導致無法啟動,請確認 ib_logfile 已重新建立 innodb_log_file_size = 256M innodb_log_buffer_size = 16M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 50 [mysqldump] quick #大型資料庫匯入,需求可提高 max_allowed_packet = 1G [mysql] no-auto-rehash [myisamchk] key_buffer_size = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! # Most important is to give InnoDB 80 % of the system RAM for buffer use: # https://mariadb.com/kb/en/innodb-system-variables/#innodb_buffer_pool_size #innodb_buffer_pool_size = 8G # this is only for embedded server [embedded] # This group is only read by MariaDB servers, not by MySQL. # If you use the same .cnf file for MySQL and MariaDB, # you can put MariaDB-only options here [mariadbd] # This group is only read by MariaDB-11.8 servers. # If you use the same .cnf file for MariaDB of different versions, # use this group for options that older servers don't understand [mariadb-11.8] ESC儲存並離開 :wq ------------------------------------- 重啟 & 重開機 ------------------------------------- 重啟 systemctl restart mariadb 開機啟動mariadb systemctl enable mariadb 啟動mariadb systemctl start mariadb 瀏覽狀態 systemctl status mariadb 重開機 reboot 重開機,確認MariaDB可以自動啟動,顯示 Active: active (running) systemctl status mariadb
  13. ----------------------------- 修改為安裝sury.org的PHP源 ----------------------------- apt install wget wget -O /usr/share/keyrings/php.gpg https://packages.sury.org/php/apt.gpg echo "deb [signed-by=/usr/share/keyrings/php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list 更新源 apt update apt install curl vim gnupg dpkg apt-transport-https lsb-release ca-certificates -y apt install php-pear -y apt install php8.4-{fpm,cli,mysql,curl,gd,mbstring,xml,zip,imap,soap,gmp,bcmath,redis} -y 瀏覽pear版本 pear version 可看到 PEAR Version: 1.10.16 可看到 PHP Version: 8.4.16 可看到 Zend Engine Version: 4.4.16 可看到 Running on: Linux 000 6.12.63+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.63-1 (2025-12-30) x86_64 如果要安裝其他元件,可以搜尋看看有無對應的套件 apt-cache search php8.4* | grep php 修改 php.ini 防跨目錄/路徑攻擊 sed -i 's@^;*cgi.fix_pathinfo=.*@cgi.fix_pathinfo=0@' /etc/php/8.4/fpm/php.ini 檢查 grep cgi.fix_pathinfo /etc/php/8.4/fpm/php.ini 你應該看到 cgi.fix_pathinfo=0 設置系統預設的PHP版本 update-alternatives --list php update-alternatives --set php /usr/bin/php8.4 update-alternatives --config php 重啟PHP systemctl restart php8.4-fpm --------------------------------------- 確認有安裝exif、gmp、imagick、redis --------------------------------------- apt install php8.4-exif -y apt install imagemagick -y apt install php8.4-imagick -y 重啟PHP systemctl restart php8.4-fpm 已安裝的PHP擴展,確定已安裝了 exif、gmp、imagick、redis /bin/php8.4 -m ------------------ 修改php.ini ------------------ 本教學只修改 PHP-FPM 的 php.ini,CLI 使用的是 /etc/php/8.4/cli/php.ini vi /etc/php/8.4/fpm/php.ini 使用Xshell 8軟體上面的選項,編輯 -> 尋找 -> 尋找目標,將能快速找到以下這些要修改的地方 停用危險函數 搜尋 disable_functions = 修改为,請注意:部分套件(如 Composer、queue、worker)可能需要 exec / proc_open,請依實際需求調整 disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,readlink,symlink,popepassthru,stream_socket_server,pcntl_exec 搜尋以下這些,並修改它們的值 max_execution_time = 300 max_input_time = 180 memory_limit = 512M 顯示PHP程式錯誤,正式運作的論壇通常是 Off 關閉狀態 display_errors = Off post_max_size = 100M upload_max_filesize = 100M max_file_uploads = 100 default_socket_timeout = 180 ESC儲存並離開 :wq 重啟PHP systemctl restart php8.4-fpm 瀏覽PHP的版本,確定你是安裝PHP 8.4 php -v 開機啟動PHP8.4 systemctl enable php8.4-fpm 啟動PHP8.4 systemctl start php8.4-fpm 瀏覽狀態 systemctl status php8.4-fpm 重開機 reboot 重開機後,確認PHP有自動啟動 systemctl status php8.4-fpm
  14. ----------------------- 使用SFTP代替FTP ----------------------- Windows常見的FTP客戶端Filezilla、Flashfxp、Winscp、cuteftp等都是支援sftp,只需要在登入時選擇sftp協定,輸入SSH的帳號密碼 我慣用 FileZilla Client http://filezilla-project.org/
  15. -------------- 調整swap -------------- 安裝LNMP前,先調整swap為 x GB 瀏覽RAM記憶體 free -h Swap: 0B 如果看到total為0,表示沒設置swap 已設定swap的情況,例如 Swap: 6.2Gi 表示swap設置為6GB 建立一個資料夾用於存放swap mkdir /var/swapfile 調整swap為 4GB (視情況而定) dd if=/dev/zero of=/var/swapfile/file.swap bs=1024k count=4096 建立一個swap檔案 mkswap /var/swapfile/file.swap 修改swap資料夾權限 chmod 0600 /var/swapfile chmod 0600 /var/swapfile/file.swap 到fstab檔案中新增開機自動掛載設定 vi /etc/fstab 就能開機啟用這個swap,在底部加入 /var/swapfile/file.swap swap swap defaults 0 0 ESC儲存並離開 :wq 啟用 swapon /var/swapfile/file.swap 重開機 reboot 再次確認swap是否已調整為 4GB free -h
  16. 官網 https://www.xshell.com/zh/Xshell/ https://cdn.netsarang.net/v8/Xshell-latest-p 選擇 Home/School 家庭/學校,可以更改為免費版
  17. 購買 VPS/雲主機 後,更改為安裝 Linux Debian 13 域名解析 SSH xshell 免費又好用 Debian 13 安裝與配置 調整swap 使用SFTP代替FTP 安裝PHP 8.4與配置 安裝資料庫MariaDB 11.8與配置,資料庫最佳化 2 - 3G RAM 安裝資料庫MariaDB 11.8與配置,資料庫最佳化 4 - 8G RAM 安裝第三方Nginx 1.29、更改主機名 安裝phpMyAdmin、修改為 888 port、使用IP當phpMyAdmin的網址來管理資料庫 phpMyAdmin建立新的資料庫用戶名、資料庫用戶密碼、資料庫名 安裝acme.sh + Google Public CA 自動續簽SSL憑證 修改 域名.com.conf、IPS論壇的偽靜態 rewrite 設置Cron 安裝 Elasticsearch 8.17 搜尋中文 (Invision Community 5.0.5 開始改用新版本) 安裝 OpenSearch 2.5.0 搜尋中文 (論壇不支援此版本) (Elasticsearch / OpenSearch 任意選擇一個) 上傳IPS論壇程式、解壓縮、網站目錄 www-data www-data 安裝新的Invision Community 5.0論壇 Cron每分鐘執行論壇任務、每天自動備份DB資料庫、每天自動備份Web網站檔案 Invision Community論壇啟用 Elasticsearch / OpenSearch 強化中文搜尋 Invision Community論壇啟用偽靜態與自訂友善網址 Invision Community論壇啟用 Redis 加速 Invision Community 5.0 論壇升級 Invision Community 5.0.0 ~ 5.0.x 之間的論壇版本升級 Invision Community 5.0 論壇升級後,記得更新中文語言包 每日備份、只保留3天內的備份檔、手動做異地備份、自動異地備份 恢復論壇的DB資料庫、WWW網站檔案 (適用於論壇更換另一台 VPS/雲主機 的時候,也適用於將論壇還原回幾天前的備份檔)
  18. Jack发布主题在 Debian 13
    有些情況下,做論壇只用IPv4,而不用IPv6,所以關閉IPv6,另一方面的原因是沒寫IPv6的防火牆規則 真正關閉IPv6,有可能要寫入到rc.local 確認網路卡名稱 ip link 如果顯示 ens5 或類似的名稱 就將這一行 sysctl -w net.ipv6.conf.ens5.disable_ipv6=1 寫入到 /etc/sysctl.d/99-disable-ipv6.conf 建立一個檔案並修改 vi /etc/sysctl.d/99-disable-ipv6.conf 複製貼上這幾行,視情況將 ens5 修改為你的網路卡名稱 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 sysctl -w net.ipv6.conf.ens5.disable_ipv6=1 ESC儲存並離開 :wq 重開機 reboot 檢查網路卡是否還有 IPv6,不應該看到 inet6 ifconfig -a | grep inet6 如果還能看到 inet6,就將底下這一行,寫入到rc.local sysctl -w net.ipv6.conf.ens5.disable_ipv6=1 將上面這一行,寫入到rc.local vi /etc/rc.local ESC儲存並離開 :wq 重開機 reboot 檢查網路卡是否還有 IPv6,不應該看到 inet6 ifconfig -a | grep inet6 這時應該看不到 inet6 既然要寫入到rc.local,才能關掉IPv6,那麼 99-disable-ipv6.conf 裡面的 這一行 sysctl -w net.ipv6.conf.ens5.disable_ipv6=1 刪除掉 vi /etc/sysctl.d/99-disable-ipv6.conf ESC儲存並離開 :wq 重開機 reboot 最後確認真的不會看到 inet6,真的關掉IPv6 ifconfig -a | grep inet6
  19. Jack发布主题在 Debian 13
    ------------------------- Debian開啟BBR加速 ------------------------- 内核檢查 uname -r 返回的内核 6.12.63+deb13-cloud-amd64 開啟BBR,在 /etc/sysctl.d/ 建立一個設定檔,專門給BBR用 vi /etc/sysctl.d/99-bbr.conf 複製貼上這兩行 net.core.default_qdisc = fq net.ipv4.tcp_congestion_control = bbr ESC 儲存並離開 :wq 重開機 reboot ---------------------- 測試是否開啟BBR ---------------------- 敲入 sysctl net.ipv4.tcp_congestion_control 應該看到 net.ipv4.tcp_congestion_control = bbr 確認核心支援BBR,敲入 sysctl net.ipv4.tcp_available_congestion_control 應包含 bbr 確認qdisc,敲入 sysctl net.core.default_qdisc 結果應是 fq 說明BBR已啟動
  20. ------------------------------------------- Debian預設防火牆更改為iptables防火牆 ------------------------------------------- 由於我慣用iptables防火牆,因此移除nftables防火牆 apt remove nftables 也移除ufw防火牆 apt remove ufw 安裝iptables防火牆 apt install iptables 看看iptables防火牆是否運作 iptables -L -v ------------------------------ 設定防火牆規則 ------------------------------ cd /usr/local/bin vi firewall.sh 將iptables防火牆的規則,複製貼上到firewall.sh檔案裡 ESC儲存並離開 :wq 變更權限 chmod +x /usr/local/bin/firewall.sh 測試防火牆 ./firewall.sh ./firewall.sh start ------------------------- 設置 rc.local 開機啟動 ------------------------- 網路找到 rc.local 開機啟動 https://u.sb/debian-rc-local/ cat /lib/systemd/system/rc-local.service systemctl status rc-local 將底下代碼寫入到rc.local vi /etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0 EOF 儲存並離開 :wq 執行 變更權限 chmod +x /etc/rc.local 啟動 rc-local 服務 systemctl enable --now rc-local 無視警告... 因為這個服務沒有任何依賴的系統服務,只是開機啟動 /etc/rc.local 腳本 將需要開機啟動的命令加到 /etc/rc.local 檔案中,放在 exit 0 前面即可,然後重開機 再次修改rc.local vi /etc/rc.local 把這一行,放在 exit 0 前面即可 /usr/local/bin/firewall.sh start 儲存並離開 :wq 重開機 reboot 確認iptables防火牆的規則,有無成功執行,就是要看到你指定的IP有無出現 iptables -L 再次查看rc.local狀態 systemctl status rc-local.service 已經是 active (exited)
  21. 安裝語言包的過程,應該會看到這個訊息 locales is already the newest version xxxxxxxxxxxxx The following package was automatically installed and is no longer required: python3-ntp Use 'apt autoremove' to remove it. Debian 13 沒出現這訊息
  22. -------------------------------------------------------------- 不是要升級Debian大版本,而是更新到同版本的最新版 -------------------------------------------------------------- 查看目前系統版本 uname -a ; lsb_release -a 得到 Linux 000 6.12.63+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.63-1 (2025-12-30) x86_64 GNU/Linux 得到 No LSB modules are available. 得到 Distributor ID:Debian 得到 Description:Debian GNU/Linux 13 (trixie) 得到 Release:13 得到 Codename:trixie 開始更新 apt update apt list --upgradable apt upgrade apt list --upgradable apt autoclean apt autoremove 重開機 reboot 查看目前系統版本 uname -a ; lsb_release -a 得到 Linux 000 6.12.63+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.63-1 (2025-12-30) x86_64 GNU/Linux 得到 No LSB modules are available. 得到 Distributor ID:Debian 得到 Description:Debian GNU/Linux 13 (trixie) 得到 Release:13 得到 Codename:trixie
  23. DD Debian 13 完成後,SSH無法連線,可能網路卡沒有配置? 這需要主機商有提供noVNC控制台,可藉由noVNC控制台並用root帳號登入 如果是網路卡設置跑掉,要自己設置 靜態IP/固定IP --------------------------------------------------------------------------- 由於DD前沒記下IP,只好reinstall OS後,找出預設的IP,再重新DD一次 --------------------------------------------------------------------------- 用 networkctl 查詢網路卡名稱 networkctl list 可以得知網路卡名稱 ens5 IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 ens5 ether routable configured 2 links listed. 查詢網路卡IP設置,這三個指令都有效用 ip addr show ens5 networkctl status ens5 ip route 如果是內網IP、外網IP這兩個IP都有給的情況,在下面先設置 10.x.x.x 內網IP 建立 networkd 設定檔 vi /etc/systemd/network/10-ens5.network 將以下的內容複製並貼上 [Match] Name=ens5 [Network] Address=10.x.x.x Gateway=10.x.255.253 DNS=1.1.1.1 DNS=8.8.8.8 :wq 儲存並離開 套用設定,開機啟動 systemctl enable systemd-networkd systemctl restart systemd-networkd 重新載入 networkctl reload 重開機 reboot 這時候再來SSH登入,應該可以了
  24. Jack发布主题在 Debian 13
    購買雲主機之前,要知道主機商有無給你 noVNC 控制台,才能了解DD Linux過程是什麼情況 DD Linux完成後,遇到SSH無法連線登入,這時才能使用 noVNC 控制台,檢查是否為網路卡設置的問題 以及設置防火牆後,如果更換IP而將自己IP擋住,這時才能使用 noVNC 控制台去修改防火牆規則 SSH登入之後,更新一下 apt update -y apt install wget -y --------------------- 開始DD Debian --------------------- 下載DD腳本 wget --no-check-certificate InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' 設置權限 chmod a+x /root/InstallNET.sh 直接加參數 (指定debian 13、鏡像 ftp.hk.debian.org、root新密碼) bash InstallNET.sh -debian 13 -mirror "http://ftp.hk.debian.org/debian/" -pwd 輸入你自定的root密碼 在SSH這部份,完成後,需要自己下指令 reboot 來重開機 [Finish] Input 'reboot' to continue the subsequential installation. 需要自己下指令重開機 reboot 接下來,使用主機商提供的noVNC控制台,查看DD Linux的情況如何 完成後,再SSH登入 root密碼是上面你自定的root密碼
  25. Debian 使用者手冊 https://www.debian.org/doc/user-manuals ------------------------------------------------------------------ DD Debian 13 DD Debian 13 完成後,SSH無法連線,可能網路卡沒有配置? ------------------------------------------------------------------ 大廠有免費的WAF防火牆 vi編輯器失效的問題 Debian更換源 SSH登入後的提示訊息 變更root密碼指令 passwd Debian 更改時區 / 同步時間 更新到同版本的最新版 安裝Debian中文包 / SSH中文亂碼 開啟BBR加速 Debian預設防火牆更改為iptables防火牆 / 設置 rc.local 開機啟動 iptables防火牆 規則 firewall.sh 查詢正在執行的進程 關閉IPv6 主機商分配公網IP、內網IP/私有IP,不能關閉的情況
  26. .支援 Invision Community 5.0.14 .已翻譯 5.0.13 ~ 5.0.14 這之間的中文包 .原 Invision Community 4.7.18 的中文包,少量修正,改為符合 5.0.x 的中文包 .原 Invision Community 4.7.18 的中文包,我人工檢查並重新翻譯,預估還要花數個月至一年的時間才能完成 IPS-CHT-5.0.14-v1.zip
  27. chingd注册了
  28. reishi注册了
  29. .支持 Invision Community 5.0.14 .已翻译 5.0.13 ~ 5.0.14 这之间的中文包 .原 Invision Community 4.7.18 的中文包,少量修正,改为符合 5.0.x 的中文包 .原 Invision Community 4.7.18 的中文包,我人工检查并重新翻译,预估还要花数个月至一年的时间才能完成 IPS-CHS-5.0.14-v1.zip
  30. NHK BSP4K 3840x2160 NHK BS8K 4320p 在NHK BSP4K 或 BS8K,使用PotPlayer播放的話,原先用內建 Direct3D 11 視訊渲染器,影片色彩會出現綠色 在PotPlayer按右鍵 -> 視訊 -> 視訊輸出設定 -> 視訊渲染方式 -> 需要改為 自動偵測 (建議) 或 Madshi 視訊渲染器 (madVR) 只不過播放 8K 影片,還是依舊是 慢動作/影音不同步
  31. 说完Invision Community、PHP、MariaDB之间的版本问题 再来是中文语言包的版本问题 Invision Community 4.7.x 中文包直接套用在 Invision Community 5.0.0 上面,一发帖子就出错 An error occurred (500 Error) 这是中文包短语的参数不一样而出错 所以升级Invision Community版本,要记住,中文语言包也要更新到相同版本号,若中文包有地方出错,记得要回报给我

帐户

导航

搜索

配置浏览器推送通知

Chrome (安卓)
  1. 轻敲地址栏旁的锁形图标。
  2. 轻敲权限 → 通知。
  3. 调整你的偏好。
Chrome (台式电脑)
  1. 点击地址栏中的挂锁图标。
  2. 选择网站设置。
  3. 找到通知选项并调整你的偏好。