L2JMobius Installation (CentOS 8 Edition)
L2JMobius Server on CentOS 8+
In this guide we are using a VPS by Hetzner. We are also using ssh authentication and not user name + password as this too much risky. You should as well avoid as much as you can using username and password when dealing with servers!
The guide is about Prelude Of War but you can adapt to compile any other version that Mobius provides :)
A few notes:
- The guide is meant to be taken step by step and line by line.
- We are not devs or affiliated and we do not provide any support
- This guide is an evolution of the CentOS 7.7 guide
Firstly let’s update our instance.
$ dnf update -y
$ dnf install tar wget nano git unzip
In our case there was no update available but still, checking for updates is a must!
Install OpenJDK
L2JMobius is using OpenJDK 15 in contrast with L2JServer that is still using v11
$ curl -O https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz
$ tar xf openjdk-15.0.1_linux-x64_bin.tar.gz jdk-15.0.1
$ mv jdk-15.0.1 /opt/
$ cat <<EOF | sudo tee /etc/profile.d/jdk15.sh
export JAVA_HOME=/opt/jdk-15.0.1
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
Then
$ source /etc/profile.d/jdk15.sh
$ echo $JAVA_HOME
You should get this result if all good (do not copy/paste)
$ /opt/jdk-15.0.1
Install Git & tools
L2JMobius uses Git as version control system on BitBucket, use it to get the latest versions. But along with git we will install a few other tools that are missing but needed.yum install git wget nano unzip
Install ANT
L2JMobius uses ANT to build the components from the source code.
$ cd /tmp/
$ wget -c http://ftp.cc.uoc.gr/mirrors/apache//ant/binaries/apache-ant-1.10.9-bin.tar.gz
$ unzip apache-ant-1.10.9-bin.zip
$ mv apache-ant-1.10.9/ /usr/local/ant
$ nano /etc/profile
and add in the bottom the lines bellow:
ANT_HOME="/usr/local/ant"
PATH="$PATH:/usr/local/ant/bin"
export ANT_HOME
export PATH
$ source /etc/profile
When the server is online again connect and check ant’s version
$ ant -version
If you get any error, google it. We don’t provide support for ant ^^
Install the Database Server
$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
$ chmod +x mariadb_repo_setup
$ ./mariadb_repo_setup
And time to install the MariaDB
$ yum install perl-DBI libaio libsepol lsof boost-program-options
$ yum install --repo="mariadb-main" MariaDB-server
And then we need to run the DB
$ mysql_install_db
$ systemctl start mariadb.service
$ mysql_secure_installation
During the secure installation we will be asked a few questions, our answers were
Y, N, Y, Y, Y, Y
$ mariadb -u root -p
Just hit enter no password
CREATE OR REPLACE USER 'root'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '';
FLUSH PRIVILEGES;
exit
Obviously you can use other user name and add a password in the ” ” but you will have to edit the server files as well! DO NOT FORGET THAT!
Get the Source Code
L2JMobius official repositories are listed bellow
$ mkdir -p /opt/l2jmobius/git && cd /opt/l2jmobius/git
$ git clone https://bitbucket.org/MobiusDev/l2j_mobius.git
Build the Server from Source Code
Now we use Ant to build the server files. This can take a while depending on the processing speed of your server. In my VPS took some time :)
$ cd /opt/l2jmobius/git/l2j_mobius/L2J_Mobius_7.0_PreludeOfWar/
$ ant
Deploy the Server
The deployment process at the moment is simply unzipping the built files.
$ mkdir -p /opt/l2jmobius/server
$ unzip /opt/l2jmobius/git/l2j_mobius/build/L2J_Mobius_7.0_PreludeOfWar.zip -d /opt/l2jmobius/server
Get L2J CLI and Install the Database
L2J CLI is a tool developed by Zoey76 from l2jserver.com that allows us to implement automated deployments and initial configurations. And with a little modification can be used to install the database of L2JMobius
$ mkdir -p /opt/l2jmobius/cli && cd /opt/l2jmobius/cli
$ wget https://l2jserver.com/files/binary/cli/l2jcli-1.0.2.zip -P /tmp
$ unzip /tmp/l2jcli-*.zip -d /opt/l2jmobius/cli
$ chmod 755 l2jcli.sh
You will need to edit with nano the files
game-server.properties
login-server.properties
that are located in /opt/l2jmobius/cli/config to match your database’s info. In this guide’s case change the db name from l2jls and l2jgs to l2jmobius and user to root and no password
When you are done editing the 2 files to match your database continue
$ ./l2jcli.sh
db install -sql /opt/l2jmobius/server/db_installer/sql/login/ -u root -p -m FULL -t LOGIN -c -mods
db install -sql /opt/l2jmobius/server/db_installer/sql/game/ -u root -p -m FULL -t GAME -c -mods
quit
Initial Configuration
You need to give certain permissions for the server to run properly.
$ cd /opt/l2jmobius/server/login && mkdir -p log
$ chmod 755 LoginServer.shchmod 755 LoginServerTask.sh
$ chmod 755 RegisterGameServer.sh
$ cd /opt/l2jmobius/server/game && mkdir -p log
$ chmod 755 GameServer.sh
$ chmod 755 GameServerTask.sh
Create Administrator Account
Use the L2J CLI to create an administrator account, 8 is the maximum account level (master) Note I haven’t confirmed if this is the case in L2JMobius, those info are from L2JServer. Obviously you can change the ADMIN with anything you like and you will be asked for password
$ cd /opt/l2jmobius/cli./l2jcli.shaccount create -u ADMIN -p -a 8
$ quit
If everything went well we can proceed into starting our gaming server!
Start the Server
To start the server you need to run two scripts.
$ cd /opt/l2jmobius/server/login./LoginServer.sh
$ cd /opt/l2jmobius/server/game./GameServer.sh
That’s all folks! The server should be up and running in a couple of minutes!
You will need a modified client in order to play the game and also you will need to connect to your server via ftp or secure shell and edit the settings to increase the rates/drops or anything you like!
Some download links for the game and modded clientL2J-Mobius Prelude of WarClient Mirror 1: https://drive.google.com/uc?id=1rXtgV9l67b5lBeK_wmCKITE1DQ7EgEJ8&export=downloadClient Mirror 2: https://drive.google.com/uc?id=1IugZjcpS5n9_EJPLCecB3H_tLmVlqo2L&export=downloadSystem: https://mega.nz/#!98likSra!vP3uaDwJs8oiY5q60UzBSXAbgNELWX_dycWb98Mz96U
The guide has been created on:
25/11/2020
And has been revised on:
25/9/2021