### Install Multicraft Source: https://www.multicraft.org/site/docs/rocky9sv Downloads and runs the Multicraft setup script. ```bash wget http://www.multicraft.org/download/linux64 -O multicraft.tar.gz tar xvzf multicraft.tar.gz cd multicraft ./setup.sh ``` -------------------------------- ### Server Configuration Example Source: https://www.multicraft.org/site/docs/api Example structure of a server configuration array. ```php 'ServerConfig' => array ( 'server_id' => '1', 'ip_auth_role' => 'guest', 'give_role' => 'mod', 'tp_role' => 'mod', 'summon_role' => 'mod', 'chat_role' => 'user', 'user_jar' => '0', 'user_ftp' => '0', 'visible' => '1', 'user_schedule' => '1', ), ) ``` -------------------------------- ### Define server start command Source: https://www.multicraft.org/site/docs/troubleshooting Examples of the command setting in .jar.conf for standard and high-memory modpack configurations. ```ini [start] command = "{JAVA}" -Xmx{MAX_MEMORY}M -Xms{START_MEMORY}M -Djline.terminal=jline.UnsupportedTerminal -jar "{JAR}" nogui ``` ```ini [start] command = "{JAVA}" -Xmx{MAX_MEMORY}M -Xms{START_MEMORY}M -XX:PermSize=256M -XX:MaxPermSize=512M -Djline.terminal=jline.UnsupportedTerminal -jar "{JAR}" nogui ``` -------------------------------- ### Start Multicraft Daemon Source: https://www.multicraft.org/site/docs/install Command to start the Multicraft daemon as root. ```bash /home/minecraft/multicraft/bin/multicraft start ``` -------------------------------- ### Install Forge Server Files Source: https://www.multicraft.org/site/docs/howto Run these commands to install the Forge server, copy the necessary arguments file, and update library paths. ```bash # Run Forge installer java -jar forge-VERSION-installer.jar --installServer=/home/minecraft/multicraft/jar/forge/ # Copy unix_args.txt to jar/forge folder find /home/minecraft/multicraft/jar/forge/libraries/ -name 'unix_args.txt' -exec cp "{}" /home/minecraft/multicraft/jar/forge/ \; # Adapt paths in unix_args.txt to load libraries from the daemon "jar" directory sed -i 's,libraries,/home/minecraft/multicraft/jar/forge/libraries,g' /home/minecraft/multicraft/jar/forge/unix_args.txt ``` -------------------------------- ### Extract and Setup Multicraft on Linux Source: https://www.multicraft.org/site/docs/install Commands to extract the archive, navigate to the directory, and execute the setup script. ```bash tar xvzf multicraft.tar.gz ``` ```bash cd multicraft ``` ```bash ./setup.sh ``` -------------------------------- ### Install System Dependencies and Configure FirewallD Timer Source: https://www.multicraft.org/site/docs/rocky9sv Installs essential packages and configures the firewalld timer unit file. ```bash dnf -y install wget zip unzip git nano firewalld policycoreutils-python-utils policycoreutils-devel setroubleshoot-server rpmdevtools rpm-build tree docker rsync export VISUAL=nano export EDITOR="$VISUAL" nano /usr/lib/systemd/system/firewalld.timer (Copy the content inside the file) [Unit] Description=firewalld - dynamic firewall daemon Before=network-pre.target Wants=network-pre.target After=dbus.service After=polkit.service Conflicts=iptables.service ip6tables.service ebtables.service ipset.service nftables.service Documentation=man:firewalld(1) [Service] EnvironmentFile=-/etc/sysconfig/firewalld ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS ExecReload=/bin/kill -HUP $MAINPID # supress to log debug and error output also to /var/log/messages StandardOutput=null StandardError=null Type=dbus BusName=org.fedoraproject.FirewallD1 KillMode=mixed [Install] WantedBy=multi-user.target [Timer] OnBootSec=1min ``` -------------------------------- ### Install and Configure MariaDB Source: https://www.multicraft.org/site/docs/rocky9sv Installs MariaDB server and configures the server port. ```bash wget https://r.mariadb.com/downloads/mariadb_repo_setup chmod +x mariadb_repo_setup sudo ./mariadb_repo_setup sudo dnf install perl-DBI libaio libsepol lsof boost-program-options -y sudo dnf install mariadb-server -y sudo mysql_install_db sudo systemctl enable --now mariadb.service sudo mariadb-secure-installation (When it asks for the unix_socket authentication [Y/n] just say "n") nano /etc/my.cnf.d/server.cnf port = mariadb_port ``` -------------------------------- ### startAllServers() Source: https://www.multicraft.org/site/docs/api Starts all servers managed by the system. ```APIDOC ## startAllServers() ### Description Starts all servers managed by the system. ``` -------------------------------- ### Install phpMyAdmin Source: https://www.multicraft.org/site/docs/rocky9sv Downloads, extracts, and sets up the initial directory structure for phpMyAdmin. ```bash wget -c https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz -O phpMyAdmin-latest-all-languages.tar.gz tar -zxvf phpMyAdmin-latest-all-languages.tar.gz rm -rf phpMyAdmin-latest-all-languages.tar.gz mkdir -p /usr/share/phpMyAdmin mv phpMyAdmin-*/* /usr/share/phpMyAdmin cp -pr /usr/share/phpMyAdmin/config.sample.inc.php /usr/share/phpMyAdmin/config.inc.php setsebool -P httpd_can_network_connect 1 setsebool -P httpd_can_network_connect_db 1 nano /usr/share/phpMyAdmin/config.inc.php ``` -------------------------------- ### Install Cloudflared Source: https://www.multicraft.org/site/docs/rocky9sv Adds the Cloudflare repository and installs the cloudflared package. ```bash sudo dnf config-manager --add-repo https://pkg.cloudflare.com/cloudflared-ascii.repo sudo dnf -y install cloudflared ``` -------------------------------- ### startServer(id) Source: https://www.multicraft.org/site/docs/api Starts the specified server. ```APIDOC ## startServer(id) ### Description Starts the specified server. ### Parameters - **id** (int) - Required - The server ID. ``` -------------------------------- ### Install PHP and Dependencies Source: https://www.multicraft.org/site/docs/rocky9sv Enables CRB, adds EPEL and Remi repositories, and installs PHP 8.2 along with required extensions. ```bash dnf config-manager --set-enabled crb dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y dnf module reset php -y dnf -y module install php:remi-8.2 dnf -y install httpd php-common php-fpm php-gd php-mbstring php-ldap php-odbc php-pear php-xml php-xmlrpc php-bcmath php-mysql php-pdo php-mysqlnd tar curl java-1.8.0-openjdk-devel java-11-openjdk-devel java-17-openjdk-devel rsync rsync-daemon libnsl ``` -------------------------------- ### Dedicated IP List Example Source: https://www.multicraft.org/site/docs/whmcs An example list of dedicated IPs assigned to daemons 1 and 3. ```text 1,192.168.1.1 1,192.168.1.2:25565 3,192.168.1.5:25565 3,192.168.1.6:25565 ``` -------------------------------- ### Run MySQL Secure Installation Source: https://www.multicraft.org/site/docs/howto Execute the security script to harden the MySQL installation. ```bash mysql_secure_installation ``` -------------------------------- ### Enable Multicraft Service Source: https://www.multicraft.org/site/docs/install Enables the Multicraft service to start automatically on system boot. ```bash systemctl enable multicraft ``` -------------------------------- ### Configure Multiple Start Regex Alternatives Source: https://www.multicraft.org/site/docs/conf Use numbered start settings to define multiple regex patterns for a single parsing block. ```ini [parse_disconnect] start=^(?P.+)\slost connection:\s*(?P.*)$ start1=^CONSOLE:\s*Kicking\s(?P.+)$ start2=Kicked\s(?P.+) from the game\s*$ ``` -------------------------------- ### Install Linux Quota Package Source: https://www.multicraft.org/site/docs/howto Install the quota management package using system package managers. ```bash apt-get install quota ``` ```bash yum install quota ``` -------------------------------- ### Install SSH Public Key (Local) Source: https://www.multicraft.org/site/docs/rocky9sv Commands for creating the authorized_keys file when the key is generated locally. ```bash mkdir -p /root/.ssh/ nano /root/.ssh/authorized_keys ``` -------------------------------- ### Cleanup and Enable Apache Source: https://www.multicraft.org/site/docs/rocky9sv Removes the MariaDB setup script and enables the Apache web server. ```bash rm -rf mariadb_repo_setup systemctl enable --now httpd ``` -------------------------------- ### Configure forced template installation Source: https://www.multicraft.org/site/docs/howto Set the forceTemplate option in a .jar.conf file to automatically install a template when a JAR is selected. ```ini [settings] forceTemplate = template1 ``` ```ini forceTemplate = template1|always ``` ```ini forceTemplate = template1 ``` -------------------------------- ### Default Java command configuration Source: https://www.multicraft.org/site/docs/howto The standard configuration for starting a server using the {JAVA} variable. ```ini [start] command = "{JAVA}" -Xmx{MAX_MEMORY}M -Xms{START_MEMORY}M -jar "{JAR}" nogui ``` -------------------------------- ### Update System and Configure Firewall Source: https://www.multicraft.org/site/docs/rocky9sv Initial system preparation including removing cockpit, installing dependencies, and configuring FirewallD rules. ```bash dnf -y erase cockpit* dnf -y update dnf -y install nano wget dnf -y install firewalld policycoreutils-devel setroubleshoot-server systemctl enable --now firewalld firewall-cmd --remove-service=cockpit --permanent firewall-cmd --remove-service=dhcpv6-client --permanent firewall-cmd --reload ``` -------------------------------- ### Install SQLite PDO support on Debian Source: https://www.multicraft.org/site/docs/troubleshooting Use this command to install the necessary PHP5 SQLite PDO extension if the database connection fails due to missing support. ```bash aptitude install php5-sqlite ``` -------------------------------- ### Restore Multicraft install.php Source: https://www.multicraft.org/site/docs/rocky9sv Use this command to copy the installation file to the web directory if it is missing or has incorrect permissions. ```bash cp -p /root/multicraft/panel/install.php /var/www/html/multicraft/install.php ``` -------------------------------- ### Start Multicraft daemon in foreground Source: https://www.multicraft.org/site/docs/troubleshooting Run the daemon with the -nv switch to diagnose startup issues by viewing output directly in the terminal. ```bash /home/minecraft/multicraft/bin/multicraft -nv start ``` -------------------------------- ### Execute Chat Command Source: https://www.multicraft.org/site/docs/howto Example of triggering a chat command in-game. ```text asay Hello everyone! ``` -------------------------------- ### Remove Installation Files Source: https://www.multicraft.org/site/docs/install Commands to remove the Multicraft directory after installation is complete. ```bash cd .. rm -r multicraft # make sure you're removing the correct multicraft directory, usually the one in /root ``` -------------------------------- ### Define Configuration Variables Source: https://www.multicraft.org/site/docs/rocky9sv List of placeholder variables used throughout the installation process that must be replaced with system-specific values. ```text SSH port variable: ssh_port MariaDB port variable: mariadb_port Name of the Cloudflared tunnel variable: tunnel_name ID of the CLoudflared tunnel variable: tunnel_id Link to your project: subdomain.domain.tdl Name of the Cloudflared subdomain (the subdomain that you will use to connect with ssh): tunnel_subdomain Name of the domain for your server: domain.tdl (useful for copying the ssh key if generated on the server and for the Apache webserver) FTP minimum passive port: ftp_min_passive_port FTP maximum passive port: ftp_max_passive_port Name for the SFTP user: sftupser (change it as you like) ``` -------------------------------- ### Install SSH Public Key (Server-side) Source: https://www.multicraft.org/site/docs/rocky9sv Commands for copying and configuring the SSH public key when generated on the server. ```bash ssh-copy-id root@domain.tld nano /root/.ssh/authorized_keys ``` -------------------------------- ### Remove Installation File Source: https://www.multicraft.org/site/docs/rocky9sv Delete the install.php file after initial configuration for security. ```bash rm -rf /var/www/html/multicraft/install.php ``` -------------------------------- ### Final System Update Source: https://www.multicraft.org/site/docs/rocky9sv Final cleanup and update steps before proceeding with Multicraft installation. ```bash dnf -y erase cockpit* dnf -y update ``` -------------------------------- ### Allowed Daemons Configuration Source: https://www.multicraft.org/site/docs/fossbilling Example value for restricting server provisioning to a specific set of daemon IDs. ```text 1,3,5 ``` -------------------------------- ### Find Users by Email Source: https://www.multicraft.org/site/docs/api Examples for performing exact and partial email searches. ```php $response = $api->findUsers('email', '='.$email); if ($response['success']) { $user = $response['data']['Users']; foreach ($user as $id=>$name) echo 'Name: '.$name.', ID: '.$id.'
'; } ``` ```php $response = $api->findUsers('email', $partialEmail); if ($response['success']) { $user = $response['data']['Users']; foreach ($user as $id=>$name) echo 'Name: '.$name.', ID: '.$id.'
'; } ``` -------------------------------- ### Get Server Resources Source: https://www.multicraft.org/site/docs/api Returns current CPU and memory usage for a server. ```php array ( 'cpu' => 0, 'memory' => 0, ) ``` -------------------------------- ### Finalize Multicraft Configuration Source: https://www.multicraft.org/site/docs/rocky9sv Cleans up installation files and configures the systemd service and PID file path. ```bash rm -rf /root/multicraft.tar.gz phpMyAdmin-* wget http://www.multicraft.org/files/multicraft.service -O /etc/systemd/system/multicraft.service chmod 644 /etc/systemd/system/multicraft.service systemctl daemon-reload nano /home/minecraft/multicraft/multicraft.conf --> pidFile = /var/run/multicraft/multicraft.pid nano /etc/systemd/system/multicraft.service --> PIDFile=/var/run/multicraft/multicraft.pid --> ExecStartPre=/bin/bash -c 'mkdir -p -m 0755 --context=system_u:object_r:var_run_t:s0 /var/run/multicraft && chown -R minecraft: /var/run/multicraft' ``` -------------------------------- ### Get Statistics Source: https://www.multicraft.org/site/docs/api Returns global statistics for daemons and servers. ```php array ( 'daemons' => 1 'daemon_memory' => 2048 'servers' => 1 'players' => 8 'assigned_memory' => 256 ) ``` -------------------------------- ### Enable Cloudflared Service Source: https://www.multicraft.org/site/docs/rocky9sv Installs the Cloudflared service and updates firewall rules to remove standard SSH access. ```bash cloudflared service install systemctl start cloudflared firewall-cmd --remove-service=ssh --permanent firewall-cmd --reload ``` -------------------------------- ### API Function Return Values Source: https://www.multicraft.org/site/docs/api Examples of return values for various API functions. ```php array ( 'Users' => array ( 1 => 'admin', ), ) ``` ```php array ( 'Users' => array ( 2 => 'tester', 3 => 'testUser2', ), ) ``` ```php array ( 'User' => array ( 'id' => '1', 'name' => 'admin', 'email' => 'admin@localhost', 'global_role' => 'none', ), ) ``` ```php array ( 'User' => array ( 'id' => '1', 'name' => 'admin', 'email' => 'admin@localhost', 'global_role' => 'none', ), ) ``` ```php array ( ) ``` ```php array ( 'id' => 2, ) ``` ```php array ( ) ``` ```php array ( 'role' => 'owner', ) ``` ```php array ( ) ``` ```php array ( 'mode' => 'rw', ) ``` ```php array ( ) ``` ```php array ( 'id' => 3, ) ``` ```php array ( ) ``` ```php array ( 'api_key' => 123abc ) ``` ```php array ( 'api_key' => 123abc ) ``` ```php array ( ) ``` ```php array ( ) ``` ```php array ( 'Players' => array ( 2 => 'Test_Player2', ), ) ``` ```php array ( 'Players' => array ( 1 => 'Test_Player', ), ) ``` ```php array ( ) ``` ```php array ( 'id' => 2, ) ``` ```php array ( ) ``` ```php array ( ) ``` ```php array ( 'Commands' => array ( 18 => 'Test_Command', ), ) ``` ```php array ( 'Commands' => array ( 18 => 'Test_Command', ), ) ``` ```php array ( ) ``` ```php array ( 'id' => 18, ) ``` ```php array ( ) ``` ```php array ( 'Servers' => array ( 3 => 'Minecraft Server', ), ) ``` ```php array ( 'Servers' => array ( 3 => 'Minecraft Server', ), ) ``` ```php array ( 'Servers' => array ( 3 => 'Minecraft Server', ), ) ``` ```php array ( 'Servers' => array ( 3 => 'Minecraft Server', ), ) ``` ```php array ( 'Server' => array ( 'id' => '1', 'name' => 'Test Server', 'ip' => '', 'port' => '25565', 'dir' => 'server1', 'world' => '', 'players' => '8', 'memory' => '0', 'start_memory' => '0', 'jarfile' => '', 'autostart' => '0', 'default_level' => '10', 'daemon_id' => '1', 'announce_save' => '1', 'kick_delay' => '3000', 'suspended' => '0', ), ) ``` ```php array ( ) ``` ```php array ( 'id' => 1, ) ``` ```php array ( 'id' => 1, ) ``` ```php array ( 'id' => 1, ) ``` ```php array ( ) ``` ```php array ( ) ``` ```php array ( ) ``` ```php array ( 'status' => 'online', 'onlinePlayers' => 0, 'players' => array ( ), 'maxPlayers' => '8', ) ``` ```php array ( 'user_id' => 2, ) ``` ```php array ( ) ``` ```php array ( ``` -------------------------------- ### Install Region Fixer Tool Source: https://www.multicraft.org/site/docs/howto Commands to download and prepare the Region Fixer tool within the Multicraft jar directory. ```bash cd /home/minecraft/multicraft/jar wget https://github.com/Fenixin/Minecraft-Region-Fixer/archive/master.zip unzip master.zip mv Minecraft-Region-Fixer-master region-fixer ``` -------------------------------- ### getServerStatus(id, player_list) Source: https://www.multicraft.org/site/docs/api Gets the current status and player information for a server. ```APIDOC ## getServerStatus(id, player_list) ### Description Returns the online status, player count, and optionally the list of connected players. ### Parameters - **id** (int) - Required - The ID of the server. - **player_list** (int) - Optional - Set to 1 to include the list of players. ``` -------------------------------- ### Configure Player List Parsing with maxDataLines Source: https://www.multicraft.org/site/docs/conf Uses a trigger to initiate parsing, sets a dynamic limit for data lines based on the start regex match, and appends results to a list string. ```ini [parse_players] trigger=list start=^There are (?P\d+)/\d+ players data=^(?P.+)$ list=true important=true listLineRe=(?P.*) maxDataLines=0 ``` -------------------------------- ### Initialize and Use Multicraft API Source: https://www.multicraft.org/site/docs/api Demonstrates how to include the API class, instantiate it with credentials, and retrieve server status. ```php require('MulticraftAPI.php'); $api = new MulticraftAPI('http://example.com/multicraft/api.php', 'demo', '#6nh%tX=ot$sBX'); print_r($api->getServerStatus(1, true)); ``` -------------------------------- ### Daemon Callback JSON Payload Source: https://www.multicraft.org/site/docs/howto Example of the JSON structure passed to callback scripts. ```json {"setup":"","ip":"1.2.3.4","start_memory":1024,"port":25565,"players":8,"working_directory":"","template":"","memory":1024,"world":"world","id":1,"jarfile":"minecraft_server.jar"} ``` -------------------------------- ### listSettings() Source: https://www.multicraft.org/site/docs/api Lists all system settings. ```APIDOC ## listSettings() ### Description Lists all system settings. ``` -------------------------------- ### Define optional server startup parameters Source: https://www.multicraft.org/site/docs/conf Use [params] sections to define command line arguments that users can toggle in the Multicraft panel. These replace {PARAMS} variables in the startup command. ```ini [start] command=java {PARAMS} -jar server.jar {PARAMS1} [params] param1 = -a info1 = Parameter A param2 = --b=Test info2 = Parameter B [params1] param1 = -c ``` ```text java -jar server.jar ``` ```text java "-a" "--b=Test" -jar server.jar "-c" ``` ```ini [params1] [params2] [params3] [params4] ``` -------------------------------- ### Enable Multicraft service on Linux Source: https://www.multicraft.org/site/docs/install Command to copy the service file into the systemd directory for autostart configuration. ```bash cp multicraft.service /etc/systemd/system/ ``` -------------------------------- ### startServerBackup(id) Source: https://www.multicraft.org/site/docs/api Initiates a backup process for the specified server. ```APIDOC ## startServerBackup(id) ### Description Initiates a backup process for the specified server. ### Parameters - **id** (int) - Required - The server ID. ``` -------------------------------- ### Configure SELinux and System Services Source: https://www.multicraft.org/site/docs/rocky9sv Set SELinux file contexts, apply security labels, and enable the Multicraft service. ```bash semanage fcontext -a -t bin_t /home/minecraft/multicraft/bin/multicraft semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/multicraft/protected/config' semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/multicraft/protected/config/config.php' semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/multicraft/protected/runtime(/.*)?' semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/multicraft/assets(/.*)?' semanage fcontext -a -t httpd_sys_rw_content_t /var/www/html/multicraft/protected/config/server_defaults.php restorecon -v /var/www/html/multicraft/protected/config/server_defaults.php restorecon -Rv /home/minecraft/multicraft/ restorecon -Rv /var/www/html/multicraft systemctl enable --now multicraft touch /var/log/httpd/multicraft-error.log touch /var/log/httpd/multicraft-access.log sudo dnf install certbot python3-certbot-apache -y nano /home/minecraft/multicraft/multicraft.conf ``` -------------------------------- ### getConnectionMemory(id, include_suspended) Source: https://www.multicraft.org/site/docs/api Gets memory usage for a daemon connection. ```APIDOC ## getConnectionMemory(id, include_suspended) ### Description Gets memory usage for a daemon connection. ### Parameters - **id** (int) - Required - The connection ID. - **include_suspended** (int) - Optional - Whether to include suspended servers. ``` -------------------------------- ### getServerResources(id) Source: https://www.multicraft.org/site/docs/api Gets current CPU and memory usage for a server. ```APIDOC ## getServerResources(id) ### Description Gets current CPU and memory usage for a server. ### Parameters - **id** (int) - Required - The server ID. ``` -------------------------------- ### Get Connection Memory Source: https://www.multicraft.org/site/docs/api Returns memory statistics for a daemon connection. ```php array ( 'total' => 2048, 'used' => 1024, ) ``` -------------------------------- ### Create SFTP User Source: https://www.multicraft.org/site/docs/rocky9sv Configure the system to support the SFTP user and set up their environment. ```bash nano /etc/shells useradd -s /usr/sbin/nologin sftpuser chown -R root:sftpuser /home/sftpuser chmod 755 -R /home/sftpuser mkdir /home/sftpuser/uploads chown sftpuser:sftpuser /home/sftpuser/uploads passwd sftpuser ``` -------------------------------- ### Get Move Status Source: https://www.multicraft.org/site/docs/api Returns the status of a server migration between daemons. ```php array ( 'src_daemon_id' => 1, 'dst_daemon_id' => 2, 'status' => 'done', 'message' => '', ) ``` -------------------------------- ### Get Server Log Source: https://www.multicraft.org/site/docs/api Retrieves the log lines for a specific server. ```php array ( 0 => array ( 'line' => '/Loading Minecraft instance properties/', ), ) ``` -------------------------------- ### getSetting(key) Source: https://www.multicraft.org/site/docs/api Retrieves a specific system setting. ```APIDOC ## getSetting(key) ### Description Retrieves a specific system setting. ### Parameters - **key** (string) - Required - The setting key. ``` -------------------------------- ### createServer(string $name) Source: https://www.multicraft.org/site/docs/api Creates a new Minecraft server. ```APIDOC ## createServer ### Description Creates a new server with the specified name. ### Parameters - **name** (string) - Required - The name for the new server. ``` -------------------------------- ### Configure Firewall Rules Source: https://www.multicraft.org/site/docs/rocky9sv Sets up firewall zones and ports for services like HTTP, HTTPS, FTP, and game server ports. ```bash chmod 644 /usr/lib/systemd/system/firewalld.timer sudo systemctl start firewalld sudo systemctl disable firewalld sudo systemctl enable firewalld.timer sudo firewall-cmd --set-default-zone=public sudo firewall-cmd --zone=public --set-target=DROP --permanent sudo firewall-cmd --zone=public --add-service=http --permanent sudo firewall-cmd --zone=public --add-service=https --permanent sudo firewall-cmd --zone=public --add-service=ftp --permanent sudo firewall-cmd --zone=public --add-service=rsyncd --permanent sudo firewall-cmd --zone=public --remove-service=cockpit --permanent sudo firewall-cmd --zone=public --add-port=25465/tcp --permanent sudo firewall-cmd --zone=public --add-port=25465/udp --permanent sudo firewall-cmd --zone=public --add-port=25565-25575/tcp --permanent sudo firewall-cmd --zone=public --add-port=25565-25575/udp --permanent sudo firewall-cmd --zone=public --add-port=19132-19142/tcp --permanent sudo firewall-cmd --zone=public --add-port=19132-19142/udp --permanent sudo firewall-cmd --zone=public --add-port=ftp_min_passive_port-ftp_max_passive_port/tcp --permanent sudo firewall-cmd --zone=public --add-port=ssh_port/tcp --permanent sudo firewall-cmd --zone=public --add-port=mariadb_port/tcp --permanent firewall-cmd --reload ``` -------------------------------- ### Configure SELinux for Multicraft Socket Connections Source: https://www.multicraft.org/site/docs/troubleshooting Run these commands to allow the web server to establish network connections when SELinux is enabled. ```bash setsebool -P httpd_can_network_connect 1 setsebool -P httpd_can_network_connect_db 1 ``` -------------------------------- ### Download Multicraft for Linux Source: https://www.multicraft.org/site/docs/install Use wget to download the Multicraft archive for 64-bit Linux systems. ```bash # wget http://www.multicraft.org/download/linux64?version=2.5.0 -O multicraft.tar.gz ``` -------------------------------- ### Server Status Response Structure Source: https://www.multicraft.org/site/docs/api Example of the array structure returned by the getServerStatus function. ```php array( 'success' => true, 'errors' => array(), 'data' => array( 'status' => 'online', 'onlinePlayers' => '1', 'players' => array( 0 => array( 'ip' => '192.168.1.149', 'id' => '12', 'name' => 'Player' ) ) 'maxPlayers' => '16' ) ) ``` -------------------------------- ### Get Server Backup Status Source: https://www.multicraft.org/site/docs/api Returns the current status and details of a server backup. ```php array ( 'status' => 'running', 'time' => '0', 'message' => '[World: world] ', 'file' => '/[...]/world.zip', 'ftp' => '192.168.1.75:21', ) ``` -------------------------------- ### Configure FTP and System Settings Source: https://www.multicraft.org/site/docs/upgrade Settings for FTP bandwidth throttling and Linux quota management. ```ini ftpLogFile = multicraft.log ## Throttle the FTP bandwidth (experimental) ## Incoming data throttle (Kb/s) ## default: 0 (unlimited) #ftpThrottleIn = 0 ## Outgoing data throttle (Kb/s) ## default: 0 (unlimited) #ftpThrottleOut = 0 [system] ## Enable or disable Linux quota support ## default: false #enableQuota = false ## The command to set the Linux user quota ## The following variables can be used: ## - Variables from "addUser" comment ## - {QUOTA} The disk space quota in MB ## - {QUOTA_BLOCKS} The disk space quota in blocks #setUserQuota = /usr/sbin/setquota -u "{USER}" 0 "{QUOTA_BLOCKS}" 0 0 -a ## The script used to fetch quota usage information for the current user ## (in blocks) ## default: scripts/getquota.sh #quotaCheckScript = scripts/getquota.sh ## The minimum time in seconds between two quota usage checks ## default: 20 #quotaCheckDelay = 20 ## The kernel block size to use for quota calculation ## default: 1024 #quotaBlockSize = 1024 ## The command to pack a zip file. The following variables can be used: ## - {FILE} The name of the zip archive to create ## - {MULTICRAFT_DIR} The daemon base directory packCmd = /usr/bin/unzip -quo "{FILE}" ## The same setting for Windows systems packCmdWin = "{MULTICRAFT_DIR}\bin\unzip.exe" -quo "{FILE}" ``` -------------------------------- ### Configure Automatic EULA Acceptance Source: https://www.multicraft.org/site/docs/howto Configure the Multicraft daemon to execute a script upon server startup to automatically accept the EULA. ```ini userAgentPrepare=scripts/accept_eula.sh ``` ```bash #!/bin/sh echo 'eula=true' > "$SERVER_DIR/eula.txt" ``` -------------------------------- ### Initialize Linux Quota System Source: https://www.multicraft.org/site/docs/howto Remount the filesystem and initialize quota files. ```bash mount -o remount /home quotacheck -avum quotaon -avu ``` -------------------------------- ### Create Servers Source: https://www.multicraft.org/site/docs/api Methods for creating new servers, either generally or on a specific daemon. ```php $api->createServer('New Minecraft Server'); ``` ```php $api->createServerOn($daemonId); ``` -------------------------------- ### Configure Backup and Docker Settings Source: https://www.multicraft.org/site/docs/upgrade Settings for managing full backup file filters, automatic deletion, Docker port protocols, CPU allocation, and container signaling. ```ini #fullBackupFileFilter = \.zip$ #fullBackupAutoDelete = true [docker] #exposeProtocol = tcp #cpusFormat = --cpus=%s #signalCommand = kill mc{SERVER_ID} --signal="{SIGNAL}" ``` -------------------------------- ### Configure JAR suggestion in .jar.conf Source: https://www.multicraft.org/site/docs/howto Use the suggestTemplate setting within a .jar.conf file to prompt users to apply a specific template when selecting a JAR. ```ini [settings] suggestTemplate = template1 ``` -------------------------------- ### Configure FTP/FTPS Settings Source: https://www.multicraft.org/site/docs/rocky9sv Enable FTPS and configure passive ports in the Multicraft configuration. ```ini nano /home/minecraft/multicraft/multicraft.conf ftpPasvPorts = ftp_min_passive_port-ftp_max_passive_port ftps = true ftpsCertfile = /etc/letsencrypt/live/domain.tld/fullchain.pem ftpsKeyfile = /etc/letsencrypt/live/domain.tld/privkey.pem ftpsForce = true ftpsCompatMode = false ``` -------------------------------- ### Download Multicraft Service File Source: https://www.multicraft.org/site/docs/install Downloads the systemd service file for Multicraft to the system directory. ```bash wget http://www.multicraft.org/files/multicraft.service -O /etc/systemd/system/multicraft.service ``` -------------------------------- ### Configure Server Restart Trigger Source: https://www.multicraft.org/site/docs/conf Triggers a server restart when a specific string is detected at the start of a console line. ```ini [parse_restart] start = ^Some restart condition ``` -------------------------------- ### Default Parsing Configuration Source: https://www.multicraft.org/site/docs/conf Standard configuration blocks for handling server startup, player lists, chat, commands, and connection events. ```ini [parse_startup] start=^\s*Done important=true [parse_players] listSplit=\s*,\s* listLine=(?P.*) start=^(?:Connected\s*players|Online \([\d]+[^)]*\)):\s*(?P.*)$ start1=^There are (?P\d+)/\d+ players data=^(?P.+)$ trigger=list important=true isList=true maxLines=2 maxDataLines=0 [parse_chat] start=^(?P\[[^\]]+\])?\s*<(?P[^>]*)>\s*(?P.*)$ [parse_command] shortStart=(?:tried|issued server) command start=^(?P.+)\s(?:tried|issued\sserver)\scommand:\s*(?P.*)$ important=true [parse_connect] shortStart=logged in with entity id \d+ at start=^(?P.+?)\s*\[/(?P[^\]:]*)(:?(?P[0-9]+)?)\]\s*logged in start1=^(?P.+)(?P\s+)logged in [parse_disconnect] shortStart=(lost connection|Kick(ing|ed)) start=^(?P.+)\slost connection:\s*(?P.*)$ start1=^CONSOLE:\s*Kicking\s(?P.+)$ start2=Kicked\s(?P.+) from the game\s*$ [parse_saveComplete] start=^CONSOLE:\s+Save complete. [parse_unknown] start=^Unknown console command #hide from server console [parse_hide] start=^(There are |\d+ players are|Connected players) #split each line into time, type and actual log entry [parse_log] start=^(?P