Yes, you can run this on Linux but first you need to compile it from source. To run the server on Linux requires at least basic knowledge in Linux(terminal) and SQL. I've successfully run this on Ubuntu Server 16.04 LTS using the Github repository and the maps data found in this repack.
I will assume that you are running Ubuntu Server 16.04 LTS Minimal as root (or at least have sudo) but will not cover the security implications of doing this as root user.
Before you start you will want to update your Ubuntu server with:
Code:
sudo apt-get update
sudo apt-get upgrade
Then you will need to get some tools to work with:
Code:
sudo apt-get install nano screen git wget p7zip-full unrar
At last you need to get the tools for compiling the server:
Code:
sudo apt-get install cmake gcc g++ libace-dev libssl-dev libtbb-dev libssl-dev libmysqlclient-dev mysql-server
To start getting the server files and compiling, create a directory to work with in the /home location:
Code:
cd /home
sudo mkdir mangos
cd mangos
Now you will have to download and extract the pack and then compile from the source inside or clone the server from the Github repository (for this purpose I will use github repo for compiling the server and use repack for the maps data and world database):
Code:
sudo git clone -b release https://github.com/lh-server/core
sudo wget http://link-to-brotalnias-repack-location/Lights+Hope+bropack+v9.rar
Change the address accordingly to point to the location of the repack. This may take some time to download and then extract it using:
Code:
sudo unrar x Lights+Hope+bropack+v9.rar
Create directory where you will compile the server
Code:
sudo mkdir build
cd build
Now its time to compile:
Code:
sudo cmake ../core -DCMAKE_INSTALL_PREFIX=/home/mangos/build
sudo make
sudo make install
(Alternatively to compile the repacks source:
Code:
7za x /home/mangos/MaNGOS/source/Repack\ 9\ Source.zip
sudo cmake ../MaNGOS/source/server -DCMAKE_INSTALL_PREFIX=/home/mangos/build
sudo make
sudo make install
)
Depending on your machine the make process will take a while to complete and we are done with compiling the server.
Next part is setting up server configuration files and the database.
Server configuration files should be located in /home/mangos/build/etc directory.
Code:
cd /home/mangos/build/etc
sudo cp realmd.conf.dist realmd.conf
sudo cp mangosd.conf.dist mangosd.conf
Changes must be made inside the two conf files to point the locations of the maps/logs and databases.
Create logs directory:
Code:
cd /home/mangos/
sudo mkdir logs
Open the realmd.conf file:
Code:
sudo nano /home/mangos/build/etc/realmd.conf
And change the two lines inside to:
Code:
LoginDatabaseInfo = "127.0.0.1;3306;mangos;mangos;realm"
LogsDir = "/home/mangos/logs"
Open the mangosd.conf file:
Code:
sudo nano /home/mangos/build/etc/mangos.conf
And change the lines inside to:
Code:
DataDir = "/home/mangos/MaNGOS/data"
LogsDir = "/home/mangos/logs"
LoginDatabase.Info = "127.0.0.1;3306;mangos;mangos;realm"
WorldDatabase.Info = "127.0.0.1;3306;mangos;mangos;mangos"
CharacterDatabase.Info = "127.0.0.1;3306;mangos;mangos;characters"
LogsDatabase.Info = "127.0.0.1;3306;mangos;mangos;logs"
Take note of the case sensitivity of directory locations.
Last part is setting up the databases:
Login to mysql
Create user mangos and grant privileges:
Code:
create user 'mangos'@'localhost' identified by 'mangos';
grant all privileges on *.* to 'mangos'@'localhost';
flush privileges;
Create the databases:
Code:
create database realm;
create database mangos;
create database characters;
create database logs;
Use the following command to prevent getting an error when importing large databases:
Code:
set global max_allowed_packet=64*1024*1024;
quit
Now its time to populate the databases.
Basic SQL files should be found in /home/mangos/core/sql so:
Code:
cd /home/mangos/core/sql
mysql -u root -p realm < logon.sql
mysql -u root -p mangos < world.sql
mysql -u root -p characters < characters.sql
mysql -u root -p logs < logs.sql
The full world database can be found compressed in the repack directory which should be in /home/mangos/MaNGOS/sql/
Code:
cd /home/mangos/MaNGOS/sql/
7za x FULL_WORLD_DB_11_03_2018.7z
mysql -u root -p mangos < FULL_WORLD_DB_11_03_2018.sql
Last part is to populate migrations SQL files into the database. Migration sql files are located in /home/mangos/core/sql/migrations and in /home/mangos/Mangos/sql/Migrations. Migration files have the following format 201XXXXXXXXXXX_world.sql or 201XXXXXXXXXXX_character.sql and which ones to use depends on the error that is produced when running the server. This is a tricky part where missing migrations need to be noted and later on populated into the database.
Time to run the server and check for missing migrations:
Code:
cd /home/mangos/build/bin
screen
./realmd
to open a new screen window use Ctrl-a c
If while running the server it produces an error that some migrations are missing, navigate to migrations directory and put them into that database using
Code:
mysql -u root -p mangos < 201XXXXXXXXXXX_world.sql
or
Code:
mysql -u root -p characters < 201XXXXXXXXXXX_characters.sql
To make the server public insert the following into the database (change the blue numbers to your public IP):
Code:
mysql -u root -p
use realm;
INSERT INTO `realmlist` (`id`, `name`, `address`, `localAddress`, `localSubnetMask`, `port`, `icon`, `realmflags`, `timezone`, `allowedSecurityLevel`, `population`, `gamebuild_min`, `gamebuild_max`, `flag`, `realmbuilds`) VALUES (1, 'MyRealm', '0.0.0.0\r\n', '127.0.0.1', '255.255.255.0', 8085, 1, 0, 1, 0, 0, 0, 0, 2, '5875 6005 6141 ');
quit
Make sure ports 3724, 8085, 3306 are open or disable the firewall using
sudo ufw disable (NOT RECOMMENDED!).
Note: the code marked in red is not absolute and must be changed accordingly