架站指引
林博仁(Buo-Ren Lin) edited this page Dec 18, 2016
·
3 revisions
- 安裝 Ubuntu 16.04 伺服器版,安裝 SSH 伺服器
- Netboot 安裝方式:(tasksel) Basic Ubuntu Server, SSH Server
- 安裝 Git 版本控制系統
- 安裝 etckeeper,管理設定檔版本
- 修正以 sudo 執行的命令預設會保留呼叫者的 HOME 環境變數的問題(Launchpad Bug #1373495)
- sudo - 允許 sudoedit 命令編輯 symbolic link · ntouind/sites.ind.ntou.edu.tw-etckeeper@659c56f
- 安裝 Fail2ban,保護 SSH 服務免於密碼窮舉攻擊
- 套用資安政策
- 安裝常用軟體 htop、manpages-zh、colortail
- 安裝與設定 Apache Web 伺服器
- Fail2ban - 啟用 Apache Web 伺服器監牢(?) · ntouind/sites.ind.ntou.edu.tw-etckeeper@b1aead4
- Apache - 將 Ubuntu 提供的預設首頁(/var/www/html/index.html)改名為 index.ubuntu_original.html
- Apache - 設定 ServerName
- 編輯 /etc/apache2/sites-enabled/000-default.conf
-
Apache - 禁止在沒有索引頁面時列出目錄下的檔案(有必要禁止嗎?) - Apache - 設定 localized-error-pages
- Apache - 安裝 ModSecurity
- 拓製(clone)本版本倉庫到本地端 /var/www
- 設定讓 web-admin 群組使用者都能讀寫該版本倉庫
- 版本倉庫目錄及其子目錄設定 SGID
- 設定
core.sharedrepository = 1
Git 設定
- 設定讓 web-admin 群組使用者都能讀寫該版本倉庫
- 停用預設網站,新增新 Apache 網站其文件根目錄指向本版控倉庫的「網站根目錄」目錄中
- 使用者管理 - 新增可自由編輯網站內容的 web-admin 使用者群組 · ntouind/sites.ind.ntou.edu.tw-etckeeper@2fcd246
- 設定 GitHub WebHook
1. 安裝 Z Shell 並[設定為使用者預設殼程式](https://github.com/ntouind/ind.ntou.edu.tw-etckeeper/commit/87fb68a1f9867ed5c395416906183d6a55d243cc)
1. 安裝 MySQL 資料庫服務跟 PHP 跟 PHPmyAdmin
* 修正 [Ubuntu 14.04 中 phpmyadmin 抱怨「缺少 mcrypt 擴充套件。請檢查 PHP 設定。」的問題](https://bugs.launchpad.net/ubuntu/+source/phpmyadmin/+bug/1443384)
1. 安裝 [Webmin 系統管理工具](http://www.webmin.com/)與[Usermin 一般使用者管理工具](http://www.webmin.com/usermin.html)
* [APT - 安裝 Webmin 官方軟體來源](https://github.com/ntouind/ind.ntou.edu.tw-etckeeper/commit/62337e875012cb88083fa71cf8d05270f7f565dd)
* [安裝 Webmin](https://github.com/ntouind/ind.ntou.edu.tw-etckeeper/commit/eb9bcc5c726372639c0bac8d5a36e39cd87c1d34)
* [Webmin - 預設不追蹤所有 /etc/webmin 底下的檔案,避免追蹤到無價值資料](https://github.com/ntouind/ind.ntou.edu.tw-etckeeper/commit/88116ccb9a9296043a51c53783f538ef58237e9d)
* [Webmin - 開機不啟動服務,減少被入侵風險](https://github.com/ntouind/ind.ntou.edu.tw-etckeeper/commit/2dd7ae38b70fc858a105687d9bbac9213720e1ac)
* [Webmin - 開機預設啟動服務,減少入侵風險(修正過去無效修正) · ntouind/ind.ntou.edu.tw-etckeeper@84b648b](https://github.com/ntouind/ind.ntou.edu.tw-etckeeper/commit/84b648b42c096586eb28832e63688913c4656308)
* [Usermin - 開機不啟動服務,減少被入侵風險](https://github.com/ntouind/ind.ntou.edu.tw-etckeeper/commit/2dd6a1a8a6c39599f9747f8bc8d52176c5074f10)