陳鐸元
    • 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 New
    • 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 Note Insights Versions and GitHub Sync 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # FAQ System FAQ ## 注意事項 - 本網站為安全起見只能使用[有支援 TLS 1.3 的瀏覽器](https://en.wikipedia.org/wiki/Transport_Layer_Security#Web_browsers)開啟 - 第一次啟動因為要確保連線安全所以製作 dhparam 憑證需要30分鐘左右 - 電腦開機登入之後 要等一陣子系統才會上線 可能5分鐘之類的 - 系統啟用 因為資料庫初始化 要花 15~20分鐘(系統在關機的時候只是暫停 不是關掉 所以不用等這麼久) ## 安裝前置作業 1. 打開`應用程式與功能` ![](https://i.imgur.com/pgCHmYM.png) 2. 選擇`相關設定`底下的`程式和功能` ![](https://i.imgur.com/JrMh2u4.png) 3. 選擇`開啟或關閉Windows功能` ![](https://i.imgur.com/5wug5V8.png) 4. 勾選 `Hyper-V` 後按`確定`, 電腦會下載相關檔案並重新開機 ![](https://i.imgur.com/ceyI2Vp.png) ## 安裝與設定 Docker 1. [下載 Docker](https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe) 並安裝 2. 裝完之後工具列會有一隻鯨魚, 對他按右鍵選擇`Settings` ![](https://i.imgur.com/FAA9HDp.png) 3. General 底下勾選`Start Docker Desktop when you log in`和`Automatically check for updates` ![](https://i.imgur.com/njGMzbm.png) ## 系統設定檔 1. 下載[start_mariadb.yml](https://raw.githubusercontent.com/Superdanby/faq-django-database-gunicorn-nginx-docker/master/start_mariadb.yml) 按右鍵另存新檔 ![](https://i.imgur.com/aLgyu6z.png) 2. 存檔類型選擇所有檔案、檔名去掉尾端的`.txt`![](https://i.imgur.com/0Xihvpa.png) 3. 編輯 `start_mariadb.yml` 因為編碼關係, 回到[剛剛下載的網址](https://raw.githubusercontent.com/Superdanby/faq-django-database-gunicorn-nginx-docker/master/start_mariadb.yml) 選取所有內容再貼到`start_mariadb.yml`裡面, 並將 `mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci` 改成 `mysqld --innodb-flush-method=fsync --character-set-server=utf8 --collation-server=utf8_unicode_ci` 4. 下載[.env](https://raw.githubusercontent.com/Superdanby/faq-django-database-gunicorn-nginx-docker/master/.env.example) 存檔類型選擇所有檔案、檔名改成`.env`, 並跟`start_mariadb.yml`放在同一個資料夾 5. 編輯 `.env` 因為編碼關係, 回到[剛剛下載的網址](https://raw.githubusercontent.com/Superdanby/faq-django-database-gunicorn-nginx-docker/master/.env.example) 選取所有內容再貼到`.env`裡面, 必須修改的內容如下: | 變數 | 說明 | 舉例 | | ----------------------- | -------------------------- | -------------------------------------------------------------- | | `SECRET_KEY` | 用來確保系統安全的隨機亂數 | `SECRET_KEY=opaeriseoprity98o@#*()^98023pIOH7I` | | `DJANGO_ALLOWED_HOSTS` | 在後面加上server的IP | `DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] 172.29.147.15` | | `DJANGO_SUPER_USER` | 網站超級使用者帳號 | `DJANGO_SUPER_USER=yeet` | | `DJANGO_SUPER_PASSWORD` | 網站超級使用者密碼 | `DJANGO_SUPER_PASSWORD=yeet` | | `DJANGO_SUPER_EMAIL` | 網站超級使用者Email | `DJANGO_SUPER_EMAIL=yaaaaa@yaaa.yaa` | | `MYSQL_ROOT_PASSWORD` | 資料庫系統最高權限密碼 | `MYSQL_ROOT_PASSWORD=yaaaaaaaaaaaaa!` | ## 網路設定 1. 打開`防火牆與網路保護` ![](https://i.imgur.com/sS2CqN9.png) 2. 選擇`進階設定` 3. 點擊`輸入規則` ![](https://i.imgur.com/f31MPU5.png) 4. 在視窗右邊選擇`新增規則` ![](https://i.imgur.com/TC1TpRe.png) 5. 選擇`連接埠`按下一步 ![](https://i.imgur.com/eVKukks.png) 6. 選擇`TCP`, 在`特定本機連接埠`內輸入`80`按下一步 ![](https://i.imgur.com/xQrrwnE.png) 7. 選擇`允許連線`按下一步 ![](https://i.imgur.com/yvgCX9u.png) 8. 指勾選`網域`按下一步 ![](https://i.imgur.com/QeH2I9P.png) 9. 輸入名稱後按完成 ## 啟用/關閉/更新系統 1. 在檔案系統位址列按一下 複製位址 ![](https://i.imgur.com/rtXCeU0.png) 2. 打開 `PowerShell` ![](https://i.imgur.com/onAK6vE.png) 3. 打 `cd` 然後貼上剛剛複製的位址 按 Enter ![](https://i.imgur.com/BN4JSp3.png) 4. - 啟用: `docker-compose -f .\start_mariadb.yml up -d` - 關閉: `docker-compose -f .\start_mariadb.yml down` - 更新(必須先關閉, 更新後要啟用): `docker-compose -f .\start_mariadb.yml build --no-cache` **更新如果失敗[請看故障排除](#故障排除)** ## 如何每個星期備份一次 1. ![](https://i.imgur.com/ZU8wp2g.png) 2. ![](https://i.imgur.com/GOetHWg.png) 3. ![](https://i.imgur.com/jqVJbMQ.png) 4. ![](https://i.imgur.com/Pji0ZfB.png) 5. ![](https://i.imgur.com/3hqfma1.png) 6. ![](https://i.imgur.com/qxnpWK1.png) 7. ![](https://i.imgur.com/xYcL3Aa.png) 8. `robocopy G:\faq_server\ M:\faq_backup\ /MIR /FFT /R:3 /W:10 /Z /NP /NDL` ![](https://i.imgur.com/7C0KP8f.png) 9. ![](https://i.imgur.com/NfyEsnc.png) 10. ![](https://i.imgur.com/YYlJfEj.png) ## 匯入網站憑證 由於網站憑證是自己生產的而不是由外面公認單位產生因此連線的時候會出現網站憑證不安全的警告, 以下步驟即可將憑證匯入用戶端系統的信任列表 1. 連線後出現警告畫面 ![](https://i.imgur.com/AGH1b3c.png) 2. 在瀏覽器設定中選擇管理憑證 ![](https://i.imgur.com/Bcp0kwA.png) 3. 啟動憑證小精靈後選擇受信任的跟憑證授權單位再選擇匯入 ![](https://i.imgur.com/sA0ymtR.png) 4. 憑證放在 `M:\faq_backup\data\ssl` ![](https://i.imgur.com/W5nkvQs.png) 5. 確認憑證存放區是受信任的跟憑證授權單位 ![](https://i.imgur.com/TngGIFr.png) 6. 下一步完成之後會跳出警告視窗, 選擇是 ![](https://i.imgur.com/AYragHS.png) 7. 匯入成功之後新加入的憑證會出現在最上面 ![](https://i.imgur.com/WMnLnYD.png) 8. 強制重新整理剛剛的網站(`Ctrl + F5`) 左上角的警告就變成安全連線了! ![](https://i.imgur.com/vH20rC9.png) ## 使用者管理 1. 登入管理後台, 選擇 `Users > Add` ![](https://i.imgur.com/eww8ivx.png) 2. 輸入新的使用者資訊, 按`Save` ![](https://i.imgur.com/mo8qO2E.png) 3. 下拉到 `Permissions` 的區塊, 確認 `Active` 和 `Staff` 是勾選的 ![](https://i.imgur.com/KnRJEl2.png) 4. 在下拉到 `Filter` 的格子裡打上 `faq` 選擇 `Choose all` 最後按 `Save` ![](https://i.imgur.com/nRTpsh0.png) 5. 使用者登入之後就可以自由新增修改刪除 `FAQ` 的內容了 ![](https://i.imgur.com/yPd9a4I.png) ## 故障排除 1. 系統啟用的時候可能會問要不要讓`Docker`存取磁碟 - 選`Share it` ![](https://i.imgur.com/3S67ga7.png) 2. Server 的 [localhost](localhost) 可以連線其他電腦連不到(拒絕存取) - Server [網路設定](#網路設定)錯誤 3. Server 的 [localhost](localhost) 顯示正常, 其他電腦顯示 `502 Bad Gateway` ![](https://i.imgur.com/2eTwk8o.png) - `.env` 裡面的 `DJANGO_ALLOWED_HOSTS` 後面加上 server 的 IP ![](https://i.imgur.com/pYdhyUp.png) 4. 利用 `docker-compose -f .\start_mariadb.yml build --no-cache` 卻失敗了! - 通常是因為網路問題所以下載失敗, 將剛剛的指令改成以下步驟: 1. `docker-compose -f .\start_mariadb.yml build --no-cache web` 如果失敗就用 `docker-compose -f .\start_mariadb.yml build web` 試到成功為止 2. `docker-compose -f .\start_mariadb.yml build --no-cache nginx` 如果失敗就用 `docker-compose -f .\start_mariadb.yml build nginx` 試到成功為止 - **注意: `--no-cache` 參數一開始一定要下才會有更新的效果** ## 我有問題 有問題可以直接利用留言的功能ㄛ~ 滑鼠一到每個區塊的右上角會出現留言的圖示, 按下去就可以進行留言了唷~ ![](https://i.imgur.com/53Ytxqd.png)

    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