NCNU-OpenSource
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- tags: 1091, lsa --- - Book mode https://hackmd.io/@ncnu-opensource/book Week 09(2020/11/19) - LSA midterm exam === [TOC] ## 規則: ![](https://i.imgur.com/hJueRO7.png) - 如有問題請舉手發問。 - 請在 AWS 上實作。 - 請勿編輯本頁面。 - 請勿以私訊或聊天室等任何方式彼此溝通。 - 當然也請不要直接實體溝通啦... 那算作弊哦 - 可以上網自由地找資料、補充這學期相對應的共筆頁面。 - 請確定執行正確,再找助教 DEMO,僅 **部份**題目 需要 DEMO - 會標記在題目上 - 除了 Webserver 外,DEMO 時,助教發現答案錯誤便 **無法** 擁有再更改的權利(即為該題錯誤) **We Are Watching You.** ## 1. SSH 5% - 請建立 3 台 AWS EC2 的 Ubuntu VM - 並將下列 ssh 公鑰寫入各個 VM 的特定檔案中,讓助教能以 **無密碼** 的方式 ssh 進你的所有 server 中 - P.S.: 助教擁有私鑰 :::success ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCMCsWRObWBj5mv8FdWFNEb17TDTnlVH6yT1QAOemfsCsjIc1VTTGi1t7HkQJegSJdORNJe2ezSU1vPYhuOCWsnzC2x7tD2aAhrs3SlecR5pMYyhfCsOW+hP8ypb6aaHFSMK49fQf2QGhg80z3pwF1CDIO/3SfhjZR2eA69IsoopgmZ71Q8XmS790GPCNCsBdMkHRgTqJGp8DloxLkuMJQr8ouzm9JpKnnq2Uh0QCHRuRlonKkt/TQXntLR7htaniHjGe/wOcqfzxYfGTLDsPP7rbgZ3tMdttB0IFqGi1jNCdmnpQH15LSY+GnapaBgQekwtIrXsGucUYhM8e2L9dDz 1091lsamideumtest ::: ## 2. 檔案權限與設定 5% 請在家目錄底下建一個叫 `1091-lsa-您的學號` 的資料夾,並依照以下條件設定存取權限 - 擁有者可以「 **讀、寫、執行** 」 - 跟擁有者同一群組的可以「 **讀、執行** 」 - 其他人就只想給它「 **讀** 」而已 ## 3. [需要 DEMO] Webserver 與 Load balance 65% 請建立 3 台 EC2 VM ~~(皆需完成 **題1—SSH** 才可實作)~~ 分別實作 Nginx, Apache, Lighttpd server 請依照要求完成以 IP , domain name, 或 port 區分 virtual host 並呈現出不同顯示畫面,詳細架構連接如下圖: ![](https://i.imgur.com/zDKcJkf.png) ### A. <span class="vm">VM-1</span> Nginx server 1. (10%) 輸入 ==<public_**ip**>== 會得到以下頁面 (請依照下列格式作答並顯示在網頁上): - (10%) 成功輸出並且輸出內容正確 - (5%) 成功輸出但輸出內容錯誤 - (0%) 未成功輸出 ```htmlmixed= <head> <meta charset='UTF-8'> <h1>課程相關</h1> <h2>中文全名:(請填入此處)</h2> <h2>英文全名:(請填入此處)</h2> <h2>英文縮寫:(請填入此處)</h2> </head> ``` 2. (5%)輸入 ==<public_**ip**>:8080== 會 proxy 到 [Mr.郭網頁](https://vincentinttsh.github.io/) :::success 請使用 [NO-IP 免費提供 public domain name]( https://www.noip.com/) 取得兩個如 **題3** 與 **題4** 規定之 domain name EX: (以學號 106213014 為例,請依據自己的學號做替換) 106213014-apache.hopto.org 106213014-lighttpd.hopto.org ::: 3. (20%) 輸入 ==<學號>-apache.hopto.org== 會導向 Apache server 的頁面 **(詳細格式請看 VM-2)** - (10%) ==:80 (port)== : 助教資訊 - (10%) ==:80 (port)/~<username> (預設使用者)== : 學生個人資訊 4. (15%) 輸入 ==<學號>-lighttpd.hopto.org== 會導向 Lighttpd server 的頁面 **(詳細格式請看 VM-3)** - (10%) ==:80 (port)== : 老師相關訊息 - (5%) ==:8080 (port)== : 連到 1sa.bluet.org 5. (15%)輸入 ==<public_domain_**name**>== 會在以下 3 個網頁間做 load balance - (5%) 網頁顯示 — 助教的名字 (Apache) - (5%) 網頁顯示 — 老師的資訊 (Lighttpd) - (5%) 網頁顯示 — 老師的網頁 (Lighttpd proxy) ### B. <span class="vm">VM-2</span> Apache server 1. 在 port = 80 時,請作答並以下列格式顯示內容: ```htmlmixed= <head> <meta charset='UTF-8'> <h1>助教們的中文名字</h1> <h2>(請在此處填寫所有助教名字,包含愛心助教共 5 位)</h2> </head> ``` 2. 網址後增加 `/~<username> (預設使用者)` 可 show 出以下學生資訊: ```htmlmixed= <head> <meta charset='UTF-8'> <h1>本次作答學生資訊</h1> <h2>姓名:(請填寫名字)</h2> <h2>學號:(請填寫學號)</h2> </head> ``` ### C. <span class="vm">VM-3</span> Lighttpd server 1. 在 port = 80(Default) 時,請作答並以下列格式顯示內容: ```htmlmixed= <head> <meta charset='UTF-8'> <h1>LSA 的老師</h1> <h2>中文名字:(請作答)</h2> <h2>英文全名:(請作答)</h2> <h2>常用 ID:(請作答)</h2> <h2>Telegram ID:(請作答)</h2> <h2>Facebook 個人檔案的名稱:(請作答)</h2> </head> ``` 2. 在 port = 8080 時,請 proxy 到 lsa.bluet.org ## 4. [需要 DEMO] 查詢主機狀態資訊 20% 1. (5%) 建立了許多服務後,想看一下 port 的佔用狀況,並希望能符合以下條件的方式呈現。 ```= address, port 要以數值方式呈現 只列出正在使用中的 port 要 show 出屬於每個 socket 的 PID 和 Program name 只要 TCP 協定 ``` 2. (5%) 請將**前面的指令** 的輸出,加以過濾,只顯示特定兩個欄位 **`Local Address`、`PID/Program name`** 的**結果**(不要求顯示欄位名稱) - 為了好看,這兩欄輸出時,中間請加一個空白 3. (5%) 續題二結果,而因 lab 做的東西 port 剛好都是 **`80`** 開頭,所以請再幫我過濾出包含 **80** 這個數值的列 4. (5%) 續題三結果,有個指令能將輸入的字串**顯示**於螢幕並同時**儲存**進指定的檔案中,請將前面指令的輸出結果同時顯示並保存進 **`/etc/output.txt`** 中 ## 5. [需要 DEMO] 安裝服務 15% 1. (5%) 請安裝 `proftpd` 服務並確認狀態為開啟 2. (10%) 請開啟匿名(anonymous)登入,能夠看到檔案 welcome.msg ## 6. Hostname / DNS 10% 1. (5%) 把 AWS 上的三台 server 的 **hostname** 改成 lsa-學號-{proxy or apache}, ex: (1) lsa-學號-nginx (2) lsa-學號-apache (3) lsa-學號-lighttpd :::info - 測試重開機後還是維持更改後的 hostname - 請確認 ping 跟 sudo 時都是正常的 - 在指令提示列的中 的顯示也是正確的(如下圖反白處) ![](https://i.imgur.com/F0SxsoI.png) ::: 2. (5%) ping www 時會自動尋找到 www.ncnu.edu.tw - 意即不論 ping 什麼東西,找不到時都會去尋找 ncnu.edu.tw <style> .vm { background-color: #CD5C5C; color: white; font-size: 20px; font-weight: bolder; border-radius: 50% 20% / 10% 40%; } </style>

    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