# 自動布建伺服器環境建置手冊 ## 伺服器安裝注意事項 在使用本功能前,請先確認伺服器硬體配置、作業系統還有注意事項的部分是否安裝好,目前建議使用linux系統。 硬體: * 操作系統:建議Ubunt 18.04版本 * 處理器: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz * 顯示卡:GeForce GTX 1060 3GB * RAM:建議2GB * 硬碟:建議16GB以上 軟體: * Apache2版本-Apache/2.4.29  * Mysql版本-5.7.38-0ubuntu0.18.04.1 - (Ubuntu) * PHP版本-7.2.24-0ubuntu0.18.04.11 * Python3版本-python3.8 * Gogs版本-0.12.3 ### 注意事項: 1. 安裝ssh server--可讓網頁遠端到伺服器 sudo apt install openssh-server 2. 調整sudo權限--可在建置時不需要輸入密碼 sudo visudo %sudo這一行最右邊的ALL改成NOPASSWD: ALL 3. 調整遠端登入--可使用root來遠端登入 sudo nano /etc/ssh/sshd_config PermitRootLogin prohibit-password 改成: PermitRootLogin yes 離開儲存,重新啟動 SSHD服務: sudo systemctl restart sshd 4. 設定root密碼--遠端登入需用到root密碼 sudo passwd root 5. 如有使用防火牆,請開通以下port 22、80、8080、1883、 3000、5010、5014 ## 網頁安裝流程注意事項: ### 登入頁面,輸入帳號密碼,如果沒帳號請選右邊”Registration”按鈕 ![登入頁面](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/0304286fcfc2a6288234f5a9c603b93ffb566dab/1.PNG) ### 申請帳號頁面 ![申請帳號頁面](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/0304286fcfc2a6288234f5a9c603b93ffb566dab/2.PNG) ### 登入後首頁>選擇伺服器建置 ![首頁](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/b65df70b56bb3a458ae9fd2420fcdf81d38cf723/7.PNG) ### 建置頁面,依序輸入要安裝的server IP、root、使用者名稱、使用者密碼,然後勾選育安裝之套件後按建置就等待網頁顯示安裝結果。 ![建置頁面](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/790b25bcf72f888318f5e4a71d143a72145b72b6/8.PNG) ## 檢查自動安裝是否成功安裝: ### 網址輸入:IP (檢查apache2功能) ![Apache網頁](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/aacba5e9476e8c14f5099294fc98e5e2c67604d7/9.PNG) ### 網址輸入:IP+/phpmyadmin (檢查資料庫功能) ![資料庫網頁](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/790b25bcf72f888318f5e4a71d143a72145b72b6/3.PNG) ### 網址輸入:IP+:3000 (檢查git功能) ![Gogs網頁](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/790b25bcf72f888318f5e4a71d143a72145b72b6/6.PNG) ### 網址輸入:IP+:5010 (檢查coffee project功能) ![咖啡網頁](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/790b25bcf72f888318f5e4a71d143a72145b72b6/4.PNG) ### 網址輸入:IP+:5014 (檢查自動布建網頁功能) ![自動布建網頁](http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files/raw/790b25bcf72f888318f5e4a71d143a72145b72b6/5.PNG) ## 問題&解決方法 Q:網頁按下建置按鈕後跳出ssh失敗? * A:檢查建置位置的伺服器,確認SSH是否可以使用,如果都無不正常地方建議重新開機。 Q:如果網頁連線不上? * A:先確認自動執行程式有沒有執行,如果有,請把防火牆的prot開通。