Skip to content

External WebServer Use

Risto Lahtela edited this page Feb 15, 2021 · 23 revisions

Plan Header

External WebServer Use

Plan offers some limited support for use with an external WebServer running on the same machine as the minecraft server. (And possibly another machine if network mounted drives are available). Some features are not available on exported website, such as login or query-page.

This is done by exporting the HTML files periodically or manually. (With /plan export command, that allows export of player pages, json or server.json)

Enabling HTML Export

# -----------------------------------------------------
# These settings will make Plan write .js, .css, .json and .html files to some location on disk.
# Relative path will render to /plugins/Plan/path
# Make sure user running the server has write permissions to the path.
# -----------------------------------------------------
Export:
    HTML_Export_path: 'Analysis Results' <-- change to your webserver's public_html folder
    JSON_Export_path: 'Raw JSON'
    Parts:
        # Player pages/JSON are only written on join/leave.
        Player_pages: true <-- enable for html
        Players_page: true <-- enable for html
        Server_page: true <-- enable for html
        Player_JSON: true
        Server_JSON: true
    # All player pages/JSON can be exported by using /plan m export players
    Export_player_on_login_and_logout: true
    # If there are multiple servers the period is divided evenly to avoid export of all servers at once
    # Also affects Players page export
    Server_refresh_period: 20
        Unit: MINUTES
Setting Description
HTML_Export_path Folder inside /plugins/Plan/ or a full path to the folder that the HTML files should be exported to.
JSON_Export_path Folder inside /plugins/Plan/ or a full path to the folder that the JSON files should be exported to.
Parts Enables exporting the files to the respective export path. Note that exporting Server JSON and Server page export the same JSON twice in two different locations.
Export_player_on_login_and_logout Export Player html and/or json when the player joins or leaves (To update the player files)
Server_refresh_period Period for the export of server & network html and/or json, as well as players html

If your external web server is serving files from a folder on the machine, it is recommended to copy the full path to the HTML_Export_path setting (For example 'C:\webserver\public_html' or 'etc/webserver/public_html')

Ensure that the user running the minecraft server has write & read permission to the folder you're exporting the files to, otherwise exceptions will occur when creating the files.

On Bungee HTML is only exported on Bungee even if the export is enabled on the Bukkit servers.

Disabling internal WebServer of Plan

It is possible to disable the WebServer.

Webserver:
  ...
  Disable_Webserver: false
  External_Webserver_address: "https://www.example.address"
Setting Description
Disable_Webserver Disables the WebServer initialization (WebServer is not started on Enable)
External_Webserver_address Address that is used instead of the WebServer address when the WebServer is offline.

External_Webserver_address should be set to an address that allows appending of folder names such as /player/playername & /server etc.
If you export the html to a separate folder (eg. ../public_html/plan) The setting should reflect that ("https://www.example.address/plan")

Clone this wiki locally