2 Lighttpd and SQLite on a Raspberry Pi 4 with DietPi
JappeHallunken edited this page 2022-02-16 03:23:04 +01:00

I assume that you have Lighttpd and PHP already installed and configured.

I use Paper MC, so the user which runs the MC server is also papermc.

I choosed SQLite, because it saves the tiles in one big file, which is better for backups as an folder with over 200.000 files :)

The config for MySQL/MariaDB is almost the same, only the url: part in configuration.txt is different. You can find info about that in the wiki too.


Do Step 1 and 2 mentioned here: https://github.com/webbukkit/dynmap/wiki/External-Webserver-Basics

Then we have to make some additional changes in configuration.txt:

Search for and change to:

storage:
  #type: filetree
  # SQLite db for map storage (uses dbfile as storage location)
    type: sqlite
    dbfile: dynmap.db
  # MySQL DB for map storage (at 'hostname':'port' with flags "flags" in database 'database' using user 'userid' password 'password' and table prefix 'prefix')
  # type: mysql
  # hostname: localhost
  # port: 3306
  # database: MyDynmapDatabase
  # userid: dynmapwebserver
  # password: oldschool 
  # prefix: "dyn_"
  # flags: "?allowReconnect=true" 

and

url:
    # configuration URL
      configuration: "standalone/dynmap_config.json?={timestamp}"
    # update URL
      update: "standalone/dynmap_{world}.json?={timestamp}"
    # sendmessage URL
      sendmessage: "standalone/sendmessage.php"
    # login URL
      login: "standalone/login.php"
    # register URL
      register: "standalone/register.php"
    # tiles base URL
      tiles: "standalone/SQLite_tiles.php?tile="
    # markers base URL
      markers: "standalone/SQLite_markers.php?marker=" 

Start your MC server and look for errors in Minecrafts latest.log. If there are no errors, you can copy the content of web/ into a folder of Lighttpd web server, e.g. /var/www/dynmap (if your web root is www/, but sometimes it is /var/www/html so check your config at /etc/lighttpd/lighttpd.conf

Make sure the files have the owner papermc:papermc and the folder standalone/ has right permissions:

sudo chown -R papermc:papermc /var/www/dynmap

sudo chmod -R 770 /var/www/dynmap/standalone

add the user papermc to the group www-data

sudo usermod -a -G www-data papermc

Now browse to YOURWEBSERVER/dynmap like https://YOURSERVERADRESS/dynmap/ and everythink should work.