Lương Minh Tấn
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • Make a copy
    • 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 Make a copy 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    # HOST SERVER MINECRAFT JAVA ĐƠN GIẢN để tiện hơn, mình sẽ lưu ý với các bạn những thứ cần có trước khi vào hướng dẫn: 1. 1 máy tính chạy window (linux mình sẽ có 1 bài hướng dẫn khác), ram đâu đó tầm 1gb trở lên, cpu hơi khoẻ tí. Các bạn có thể thuê vps nếu như bạn không muốn host bằng máy đang dùng. 2. Password truy cập vào rourer mạng mà bạn đang dùng, vì khi host bạn chỉ chơi được trong mạng LAN, muốn công khai server lên internet thì bạn cần truy cập vào router mạng để trỏ về sever của các bạn, từ đó người khác ngoài mạng LAN sẽ truy cập được server thông qua ipv4, nếu bạn không thể truy cập được router thì bạn nên cân nhắc thuê 1 vps, hoặc dùng tunnel (mình sẽ hướng dẫn trong bài này luôn) 3. Phần mềm để chạy server, ở đây mình host server đơn giản nên sẽ dùng phần mềm của mojang luôn, các bạn truy cập vào đây để tải xuống https://piston-data.mojang.com/v1/objects/450698d1863ab5180c25d7c804ef0fe6369dd1ba/server.jar 4. Máy đã cài java và JDK Development Kit. đó là những thứ cơ bản nhé, giờ thì mời các bạn đọc tiếp ## SET IP TĨNH CHO MÁY Thường mặc định trên máy tính là ip động cho nên ta cần set cho nó 1 cái ip tĩnh. các bạn truy cập như sau **Control Panel** -> **Network and Internet** ->**Network and Sharing Center**->**Change adapter settings** ![ảnh](https://hackmd.io/_uploads/HkSocaLuC.png) nhấn chuột phải vào thiết bị mạng mà các bạn dùng và chọn **Properties** ![ảnh](https://hackmd.io/_uploads/HJqVia8_R.png) nhấn đúp vào **Internet Protocol Version 4** ![ảnh](https://hackmd.io/_uploads/BJf_saUd0.png) ở mục **ip address** các bạn để cho mình địa mà các bạn muốn ( lưu ý phải cùng form với mạng mà bạn kết nối), thường sẽ là **192.168.1.X** mục **subnet mask** nó sẽ tự điền cuối cùng là **default gateway**, các bạn điền địa chỉ của router ( tuỳ loại, thường sẽ là **192.168.1.1**) bạn có thể mở **cmd** lên và gõ **ipconfig** để kiểm tra ở 2 dòng cuối các bạn có thể để theo mình ## TẠO FILE CHO SERVER Ở đây mình sẽ tạo 1 file để lưu server ![ảnh](https://hackmd.io/_uploads/SJ8AOTLuC.png) tiếp đó ta chuyển file code đã tải ở trên vào đây ![ảnh](https://hackmd.io/_uploads/H1mtY6UuC.png) tiếp đó tạo 1 file text và paste dòng này vào `java -Xmx1024M -Xms1024M -jar server.jar` giải thích sơ qua thì -Xmx1024M chính là dung lượng ram tối đa cho server và -Xms1024M là lượng ram tối thiếu, các bạn có thể setup tuỳ theo cấu hình máy sau đó lưu lại và đổi đuôi của file thành **.bat** ![ảnh](https://hackmd.io/_uploads/Bkd9A6I_0.png) nhấn đúp vào file trên để thực thi ![ảnh](https://hackmd.io/_uploads/SJIRA6IdC.png) Sau khi chạy file trên xong nó sẽ sinh ra thêm 1 vài thư mục và file, các bạn mở file **eula.txt** lên và chỉnh giá trị thành **true** ![ảnh](https://hackmd.io/_uploads/SJfDyAI_0.png) ở bước này nếu các bạn bấm vào file **run.bat** một lần nữa thì server có thể chạy ngay ở trong mạng LAN trên IP máy của bạn ở port 25565 , nhưng tiếp theo tôi sẽ hướng dẫn các bạn cách config ## CONFIG SERVER Các bạn mở file **server.propeties** lên và chú ý những mục sau **difficulty=**<độ khó bạn muốn> **motd=**"tên server" **online-mode=**(false nếu bạn muốn người chơi crack chơi được, mặc định là true) **query.port=**(port của server, bạn có thể để theo ý mình nhưng tốt nhất ta nên để mặc định là **25565**) bây giờ server đã sẵn sàng hoạt động, các bạn nhấn đúp vào file **run.bat** sau khi thực thi file **run.bat** trông sẽ như thế này ![ảnh](https://hackmd.io/_uploads/SkauSIwOC.png) ở task cmd là server console nơi để nhập các lệnh vào server còn task java trên chính là màn hình quản lý lúc này server sẽ chạy trên mạng LAN và các máy cùng mạng sẽ truy cập được vào server thông qua ip tĩnh chúng đã set từ trước bằng cách nhập vào địa chỉ server trong game như sau: **IP:port** nếu muốn chơi cùng bạn bè ngoài mạng các bạn có thể dùng **radmin vpn** nhưng trong bài viết này mình sẽ hướng dẫn các bạn cách public server ra không cần radmin hay hamachi ## PUBLIC SERVER RA NGOÀI MẠNG Nếu các bạn không có vps thì cách tốt nhất vẫn là port forward qua router, nhưng nếu các bạn không thể truy cập vào router thì cũng vẫn sẽ có thêm 1 cách để các bạn tham khảo trước khi bắt đầu ta cần tắt tường lửa cho port server mà các bạn đã set từ bước config: 1. vào mục search và tìm đếm cửa sổ firewall![ảnh](https://hackmd.io/_uploads/HyqhmOwuA.png) 2. trong mục inbound rules chọn new rule và 1 cửa sổ sẽ hiện lên![ảnh](https://hackmd.io/_uploads/S14XVuwuR.png) 3. tích vào mục Port và nhấn next, ở cửa sổ tiếp chọn TCP và nhập port mà bạn đã config sau đó nhấn next![ảnh](https://hackmd.io/_uploads/HkNnEdvOC.png) 4. chọn allow the connection![ảnh](https://hackmd.io/_uploads/HJM1BOwOC.png) 5. tích chọn hết và nhấn next ![ảnh](https://hackmd.io/_uploads/rktWr_DO0.png) 6. đặt tên là gì cũng được tuỳ các bạn![ảnh](https://hackmd.io/_uploads/SkpEr_DuR.png) **thực hiện các bước trên tương tự với outbound rules** có 2 cách để public server ra ngoài mạng: port foward, tunnel. ### PORT FORWARD bạn cần đăng nhập vào router, mỗi router sẽ có 1 địa chỉ truy cập trong mạng nội bộ khác nhau, thường sẽ là **192.168.1.1**, tương tự đối với router của mình cũng sẽ là địa chỉ trên. vào trình duyệt web và nhập địa chỉ vào![ảnh](https://hackmd.io/_uploads/B1VNvuwu0.png) nhập user và pass vào, nếu các bạn là sinh viên ở trọ thì có thể xin chủ nhà (nếu được), còn nếu các bạn không có pass thì có thể qua cách 2 sau khi đăng nhập vào được các bạn tìm đến mục **NAT**![ảnh](https://hackmd.io/_uploads/SkI3wuD_A.png) chọn vào virtual server và setup như sau: - start port number và end port number các bạn để 25565 (port mặc định) - Protocol là TCP - Local IP Address là ip tĩnh đã set từ ở bước trên - Start Port Number(Local) và End Port Number(Local) các bạn đều điền port server mà các bạn đã set trong file config ![ảnh](https://hackmd.io/_uploads/SkRx__vOA.png) save lại và bây giờ server đã có thể truy cập từ máy người khác thông qua địa chỉ ipv4, để biết ipv4 các bạn có thể lên google và tìm what is my ip, mình xin phép che lại ip của mình nhé ![ảnh](https://hackmd.io/_uploads/rkPiK_w_A.png) ở máy của người khác, vào game và đến mục thêm máy chủ và nhập địa chỉ ipv4 vào, và chơi thôi

    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
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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