## ㄧˊ照  ## 架設步驟 使用環境 ( in Docker ): - Ubuntu 14.04 - php 5.5.x (原專案建議 5.3.x, 但更老的 CentOS 5.11 的 php 不支援 `SQLite()`) - apache 2.4 (原專案應該是在 2.2 弄的,所以 config 可能有相容問題) - volume 對應: 外面的 `/home/bbs` 對應裡面的 `/srv/bbs` ### Apache2.4 config apache2.conf ```conf= <Directory /srv/> Options Indexes FollowSymLinks #AllowOverride None AllowOverride All Require all granted </Directory> ``` sites-available/000-default.conf ```conf= ... DocumentRoot /srv/bbs/web ... ``` ### PHP Config ```php= <?php define('SITE_NAME','夢之大地'); //這個為站台名稱 define('SITE_DOMAIN','172.17.0.1'); //這邊要讓 docker 可以透過 socket/netcat/telnet 連回去 bbs 主站 (ref: index.php) //站台域名 或 ip define('WEBSITE_DOMAIN','172.24.1.51:8080'); //好讀版的網址 define('DB_PATH','/srv/bbs/count.db'); //SQLite3 file的位置 include('uaocode.php'); //這行請不用動他 ini_set('display_errors', 1); //後面三行我亂加的,我也不知道能不能除錯 ini_set('display_startup_errors', 1); error_reporting(E_ALL); ?> ``` ## Issue 1. php 5.5 之後的 `htmlspecialchars()` 函式會把 Big5 中文字元過濾掉 (*總不能就這樣取消註解讓別人塞東西吧?*) 2. Apache rewrite rule 還要再試, 也可以改成 nginx, 或是改寫的時候交給 webapp 處理掉 ### 未來改寫方向? - 移植 pttbbs 的 grpc+protobuf? - 較安全? - 需要較長的實作時間? - 仿照原專案邏輯用 python/go 重寫? - python: Django/Flask? - go: gin? - template 或前後分離?
×
Sign in
Email
Password
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