question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Add Wiki Page] Dynmap + Nginx + No Internal Web Server

See original GitHub issue

Hello, I’d like to propose a Wiki page for setting up Dynmap with Nginx and not using the internal Dynmap webserver. The code blocks below are edited to my configuration, which works.

Prereqs:

  1. Have a working bukkit config ( I currently run Minecraft as user minecraft and have my server located in /home/minecraft/minecraft/ )
  2. Have nginx installed (on Debian, default nginx root directory is /var/www/html/ )
  3. Have php5-fpm installed

Instructions:

  1. Download Dynmap and run Bukkit/Spigot to have it generate the Skeleton files for your configuration
  2. Edit your Dynmap configuration.txt 2.1. https://github.com/webbukkit/dynmap/blob/9f835b497808e81afc456487a83039524d1620e4/src/main/resources/configuration.txt
  3. View codeblock 1 below from configuration.txt, edit your config to be similar to this (lines 40-96) 3.1. This disables the internal client update and enabled Dynmap writing to JSON
  4. View codeblock 2 below from configuration.txt, edit your config to be similar to this (lines 308-331) 4.1 This section disables the internal web server, changes the path to where tiles & web files are stored 4.2 I did an absolute path for the web and tiles area, it’s currently the default location, and is not needed to make this change, but I prefer having hardcoded paths
  5. For a configuration like this, changing lines 431-446 is not needed, but I will include codeblock 3 below to show that these do need to be commented out
  6. Edit your nginx configuration to something similar to this (my nginx config is located at /etc/nginx/sites-enabled/default ) 6.1. On my server I have dynmap at http://myserver/map/ 6.2. Add a symlink to your www directory (this points nginx to /home/minecraft/minecraft/plugins/dynmap/web/ when it receives a request for URI /map/ [ or on your system it’s read as the file path /var/www/html/map/ ] ) 6.2.1. ln -s /home/minecraft/minecraft/plugins/dynmap/web/ /var/www/html/map/ 6.3. In your Nginx site, add a location block for php (See codeblock 4)
  7. Edit your php5-fpm config to use a TCP/IP socket rather than a Unix Socket 7.1. /etc/php5/fpm/pool.d/www.conf 7.2. Change the listen line to whatever port you want, only make sure it matches with what the Nginx block says 7.3. listen = 127.0.0.1:8999
  8. Restart Nginx
  9. Restart php5-fpm
  10. Start Bukkit and let the magic happen

configuration.txt 1

(lines 40-96)

  # - class: org.dynmap.InternalClientUpdateComponent
  #   sendhealth: true
  #   sendposition: true
  #   allowwebchat: true
  #   webchat-interval: 5
  #   hidewebchatip: false
  #   trustclientname: false
  #   includehiddenplayers: false
  #   # (optional) if true, color codes in player display names are used
  #   use-name-colors: false
  #   # (optional) if true, player login IDs will be used for web chat when their IPs match
  #   use-player-login-ip: true
  #   # (optional) if use-player-login-ip is true, setting this to true will cause chat messages not matching a known player IP to be ignored
  #   require-player-login-ip: false
  #   # (optional) block player login IDs that are banned from chatting
  #   block-banned-player-chat: true
  #   # Require login for web-to-server chat (requires login-enabled: true)
  #   webchat-requires-login: false
  #   # If set to true, users must have dynmap.webchat permission in order to chat
  #   webchat-permissions: false
  #   # Limit length of single chat messages
  #   chatlengthlimit: 256
  # #  # Optional - make players hidden when they are inside/underground/in shadows (#=light level: 0=full shadow,15=sky)
  # #  hideifshadow: 4
  # #  # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky)
  # #  hideifundercover: 14
  # #  # (Optional) if true, players that are crouching/sneaking will be hidden 
  #   hideifsneaking: false
  #   # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
  #   protected-player-info: false
  #   # If true, hide players with invisibility potion effects active
  #   hide-if-invisiblity-potion: true
  #   # If true, player names are not shown on map, chat, list
  #   hidenames: false
  - class: org.dynmap.JsonFileClientUpdateComponent
    writeinterval: 1
    sendhealth: true
    sendposition: true
    allowwebchat: true
    webchat-interval: 5
    hidewebchatip: false
    includehiddenplayers: false
    use-name-colors: false
    use-player-login-ip: false
    require-player-login-ip: false
    block-banned-player-chat: true
    hideifshadow: 0
    hideifundercover: 0
    hideifsneaking: false
    # Require login for web-to-server chat (requires login-enabled: true)
    webchat-requires-login: false
    # If set to true, users must have dynmap.webchat permission in order to chat
    webchat-permissions: false
    # Limit length of single chat messages
    chatlengthlimit: 256
    hide-if-invisiblity-potion: true
    hidenames: false

configuration.txt 2

(lines 308-331)

# The path where the tile-files are placed.
tilespath: /home/minecraft/minecraft/plugins/dynmap/web/tiles

# The path where the web-files are located.
webpath: /home/minecraft/minecraft/plugins/dynmap/web


# The path were the /dynmapexp command exports OBJ ZIP files
exportpath: export

# The network-interface the webserver will bind to (0.0.0.0 for all interfaces, 127.0.0.1 for only local access).
# If not set, uses same setting as server in server.properties (or 0.0.0.0 if not specified)
#webserver-bindaddress: 0.0.0.0

# The TCP-port the webserver will listen on.
#webserver-port: 8123

# Maximum concurrent session on internal web server - limits resources used in Bukkit server
#max-sessions: 30

# Disables Webserver portion of Dynmap (Advanced users only)
disable-webserver: true

# Enable/disable having the web server allow symbolic links (true=compatible with existing code, false=more secure (default))
allow-symlinks: false

configuration.txt 3

lines 431-446

# URL for client configuration (only need to be tailored for proxies or other non-standard configurations)
url:
    # configuration URL
    #configuration: "up/configuration"
    # update URL
    #update: "up/world/{world}/{timestamp}"
    # sendmessage URL
    #sendmessage: "up/sendmessage"
    # login URL
    #login: "up/login"
    # register URL
    #register: "up/register"
    # tiles base URL
    #tiles: "tiles/"
    # markers base URL
    #markers: "tiles/"

nginx site configuration

        location ~ \.php$ {
        try_files $fastcgi_script_name =404;
        gzip off;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:8999;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi.conf;
        }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

8reactions
Kervinoucommented, Mar 22, 2017

Hi it’ll be very good to safe MC server, but where are dynmap plugins ? example : plotsquared or precious stones plugins for dynmap are invisible

is it the same for you ? thanks

5reactions
chuushicommented, Mar 26, 2017

@Kervinou, Please create a separate issue. This issue is not about misc. Dynmap plugins.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Two websites on same domain with nginx - r/Dynmap - Reddit
Is there any guide or help online to figure out how to run two websites with nginx on the same domain, having my...
Read more >
Overview - Dynmap® - Bukkit Plugins - Projects
A Google Maps-like map for your Minecraft server that can be viewed in a browser. Easy to set up when making use of...
Read more >
Help needed for setting up a dynmap link - SpigotMC
Hello! So recently i created dynmap and i wanted its link to be map.myserver.com but im confused on how to set that up...
Read more >
[Tutorial] Setting up a standalone web server with MySQL SQLite
The Dynmap website will be available even if the minecraft server is down/ ... If you want to use SQLite, you can just...
Read more >
How to build a web app with multiple subdomains using Nginx
js as a server, we would also have to open the internal ports 80 and 443 to the internet, too. There is no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found