holishing
    • 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
    9 分鐘架一個 PttBBS === Author: r2 ``<holishing aT ccns.ncku.edu.tw>`` --- ## Why? * 可以從中釐清 Ptt 站長、各級站務、板主具體權限為何,是否可查看使用者個資、刪改文章,履行監督之責 * 協助重現 PttBBS 系統既有問題(Bugs),實踐開源參與、回饋的精神 * ~~可以架個個人 BBS 站自 high~~ ( [範例](https://www.clam.ml) ) --- ## 假設 * 你已經碰過一點 Linux 環境常用的終端機指令了 * 如果沒有也沒關係,只是不保證能 9 分鐘架完而已 (!? --- ## 步驟 0. 安裝作業系統 * 安裝方式1: 開虛擬機 (VMware, VirtualBox) 安裝 Debian/Ubuntu * 安裝方式2: 在 Windows 10 啟用 [WSL2](https://docs.microsoft.com/zh-tw/windows/wsl/install-win10), 在 Windows 市集安裝 Debian/Ubuntu --- ### 文件提及相關指令權限說明 (root) ```bash echo hello ``` 表示上述指令要用到 `root` 權限 (bbsadm) ```bash echo hello ``` 表示上述指令要用到 `bbsadm` 這個使用者的權限 --- ## 步驟 1. 建立 bbs/bbsadm 帳號 (root) ```bash groupadd --gid 99 bbs \ && useradd -m -d /home/bbs -g bbs -s /bin/bash --uid 9999 bbsadm ``` * 若需啟用 ssh 登入,請另外利用 `vipw` [編輯使用者帳戶資訊](https://github.com/ptt/pttbbs/wiki/INSTALL#%EF%BC%91-%E5%BB%BA%E7%AB%8B-bbs--bbsadm-%E5%B8%B3%E8%99%9F) --- ## 步驟 2. 安裝套件 (root) ```bash apt install -y git python bmake gcc clang ccache libevent-dev pkg-config sudo ``` --- ## 步驟 3. 取得 PttBBS 原始碼 (root) ``` sudo -iu bbsadm ``` 切換至 bbsadm 使用者 (bbsadm) ``` git clone http://github.com/ptt/pttbbs.git ``` 抓取原始碼 --- ## 步驟 4. 修改設定檔 依據您的需求, 修改 pttbbs.conf (Big5 編碼) ```bash vim -c 'set fenc=big5 enc=big5 tenc=utf8' -c 'e!' pttbbs.conf ``` 若在 WSL2 底下,你也可以使用 VScode 來輔助編輯 Big5 編碼檔案 --- 如果是在 64bit 的作業系統編譯安裝 PttBBS,請將以下定義取消註解 (`//`): ```c #define TIMET64 ``` 在大部分 Linux 核心作業系統,請將以下定義取消註解 (`//`): ```c #define SHMALIGNEDSIZE (1048576*4) ``` --- ## 步驟 5. 編譯 PttBBS 編譯前先記得 ``` - bbsadm - $ alias make=pmake ``` 或是將以下 `make` 指令都改成 `pmake` --- 在 `/home/bbs/pttbbs` 下執行 ``` - bbsadm - $ make all install clean ``` --- 開始編譯: ![](https://i.imgur.com/v6S0El9.png) --- 編譯完成: ![](https://i.imgur.com/9JLSJCM.png) --- ## 步驟 6. 架新站才要做的相關設定 **要協助將BBS站資料搬家時務必注意。** **如果您的 BBS中已經有資料了, 請務必不要執行此部分步驟** --- 若確定自己是要架新站,請執行: (bbsadm) ```bash cd ~/pttbbs/sample; make install cd /home/bbs; bin/initbbs -DoIt ``` --- 如果 `initbbs` 參數沒打對的話會出現一些訊息: ![](http://i.imgur.com/mlZum4f.png) --- ## 步驟 7. 啟動 BBS (bbsadm) ``` ~/bin/shmctl init ~/bin/mbbsd -d -e utf8 -p 8888 ``` * 注意這邊刻意將預設顯示編碼改成 UTF-8,給架站者方便 --- ## 步驟 8. 測試是否能連線 ``` telnet localhost 8888 ``` 有正常顯示登入畫面代表成功了! --- ## 步驟 9. 取得 BBS 站長權限 new 一個帳號叫SYSOP, 然後 logout 再 login, 這樣子就會擁有站長權限囉~ --- ## 更多資源請參考 https://github.com/ptt/pttbbs/wiki/INSTALL/ --- ## 是不是很簡單呢? --- ## 還是覺得很難? 歡迎 email 到我的信箱,我的信箱在哪裡? 不告訴你!

    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