L2JMobius Prelude Of War CentOS 7.7+ Guide

L2JMobius Installation (CentOS 7 Edition)

L2JMobius Server on CentOS 7.7+

In this guide we are using a VPS by Hetzner. We are also using ssh authentication an not user name + password as this too much risky. You should as well avoid as much as you can using user name 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

Firstly let’s update our instance.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
yum update -y
yum update -y
yum update -y

In our case there was no update available but still, checking for updates is a must!

 

Install OpenJDK

L2JMobius is using OpenJDK 14 in contrast with L2JServer that is still using v11

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
curl -O https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/openjdk-14.0.1_linux-x64_bin.tar.gz
mv jdk-14.0.1 /opt/
cat <<EOF | sudo tee /etc/profile.d/jdk14.sh
export JAVA_HOME=/opt/jdk-14.0.1
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
curl -O https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/openjdk-14.0.1_linux-x64_bin.tar.gz mv jdk-14.0.1 /opt/ cat <<EOF | sudo tee /etc/profile.d/jdk14.sh export JAVA_HOME=/opt/jdk-14.0.1 export PATH=\$PATH:\$JAVA_HOME/bin EOF
curl -O https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/openjdk-14.0.1_linux-x64_bin.tar.gz
mv jdk-14.0.1 /opt/
cat <<EOF | sudo tee /etc/profile.d/jdk14.sh
export JAVA_HOME=/opt/jdk-14.0.1
export PATH=\$PATH:\$JAVA_HOME/bin
EOF

Then

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
source /etc/profile.d/jdk14.sh
echo $JAVA_HOME
source /etc/profile.d/jdk14.sh echo $JAVA_HOME
source /etc/profile.d/jdk14.sh
echo $JAVA_HOME

You should get this result if all good (do not copy/paste)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
/opt/jdk-14.0.1
/opt/jdk-14.0.1
/opt/jdk-14.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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
yum install git wget nano unzip
yum install git wget nano unzip
yum install git wget nano unzip

 

 

Install ANT

L2JMobius uses ANT to build the components from the source code.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
wget http://ftp.cc.uoc.gr/mirrors/apache//ant/binaries/apache-ant-1.10.7-bin.tar.gz -P /tmp
tar xf /tmp/ apache-ant-1.10.7 bin.tar.gz -C /opt/ant
ln -s /opt/ant/bin/ant /usr/bin/ant
nano /etc/profile.d/ant.sh
ANT_HOME=/opt/ant
PATH=$ANT_HOME/bin:$PATH
export PATH ANT_HOME
export CLASSPATH=.
chmod +x /etc/profile.d/ant.sh
source /etc/profile.d/ant.sh
wget http://ftp.cc.uoc.gr/mirrors/apache//ant/binaries/apache-ant-1.10.7-bin.tar.gz -P /tmp tar xf /tmp/ apache-ant-1.10.7 bin.tar.gz -C /opt/ant ln -s /opt/ant/bin/ant /usr/bin/ant nano /etc/profile.d/ant.sh ANT_HOME=/opt/ant PATH=$ANT_HOME/bin:$PATH export PATH ANT_HOME export CLASSPATH=. chmod +x /etc/profile.d/ant.sh source /etc/profile.d/ant.sh
wget http://ftp.cc.uoc.gr/mirrors/apache//ant/binaries/apache-ant-1.10.7-bin.tar.gz -P /tmp
tar xf /tmp/ apache-ant-1.10.7 bin.tar.gz -C /opt/ant
ln -s /opt/ant/bin/ant /usr/bin/ant

nano /etc/profile.d/ant.sh

ANT_HOME=/opt/ant
PATH=$ANT_HOME/bin:$PATH
export PATH ANT_HOME
export CLASSPATH=.

chmod +x /etc/profile.d/ant.sh
source /etc/profile.d/ant.sh

After that you should restart your instance

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
shutdown -r now
shutdown -r now
shutdown -r now

When the server is online again connect and check ant’s version

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ant -version
ant -version
ant -version

If you get any error, google it. We don’t provide support for ant ^^

 

Install the Database Server

First we add the repo for it

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
nano /etc/yum.repos.d/MariaDB.repo
nano /etc/yum.repos.d/MariaDB.repo
nano /etc/yum.repos.d/MariaDB.repo

And paste in the text bellow

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# MariaDB 10.4 CentOS repository list - created 2019-08-11 20:34 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 10.4 CentOS repository list - created 2019-08-11 20:34 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.4/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
# MariaDB 10.4 CentOS repository list - created 2019-08-11 20:34 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

And time to install the MariaDB

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
yum install MariaDB-server MariaDB-client
yum install MariaDB-server MariaDB-client
yum install MariaDB-server MariaDB-client

And then we need to run the DB

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
systemctl start mariadb systemctl enable mariadb mysql_secure_installation
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation

During the secure installation we will be asked a few questions, our answers were
Y, N, Y, Y, Y, Y

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
mariadb -u root -p
mariadb -u root -p
mariadb -u root -p

Just hit enter no password

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
CREATE OR REPLACE USER 'root'@'localhost' IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '';
FLUSH PRIVILEGES;
exit
CREATE OR REPLACE USER 'root'@'localhost' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY ''; FLUSH PRIVILEGES; exit
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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
mkdir -p /opt/l2jmobius/git && cd /opt/l2jmobius/git
git clone https://bitbucket.org/MobiusDev/l2j_mobius.git
mkdir -p /opt/l2jmobius/git && cd /opt/l2jmobius/git git clone https://bitbucket.org/MobiusDev/l2j_mobius.git
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 :)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd /opt/l2jmobius/git/l2j_mobius/L2J_Mobius_7.0_PreludeOfWar/
ant
cd /opt/l2jmobius/git/l2j_mobius/L2J_Mobius_7.0_PreludeOfWar/ ant
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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
mkdir -p /opt/l2jmobius/server
unzip /opt/l2jmobius/git/l2j_mobius/build/L2J_Mobius_7.0_PreludeOfWar.zip -d /opt/l2jmobius/server
mkdir -p /opt/l2jmobius/server unzip /opt/l2jmobius/git/l2j_mobius/build/L2J_Mobius_7.0_PreludeOfWar.zip -d /opt/l2jmobius/server
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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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
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
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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
./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
./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
./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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd /opt/l2jmobius/server/login && mkdir -p log
chmod 755 LoginServer.sh
chmod 755 LoginServerTask.sh
chmod 755 RegisterGameServer.sh
cd /opt/l2jmobius/server/game && mkdir -p log
chmod 755 GameServer.sh
chmod 755 GameServerTask.sh
cd /opt/l2jmobius/server/login && mkdir -p log chmod 755 LoginServer.sh chmod 755 LoginServerTask.sh chmod 755 RegisterGameServer.sh cd /opt/l2jmobius/server/game && mkdir -p log chmod 755 GameServer.sh chmod 755 GameServerTask.sh
cd /opt/l2jmobius/server/login && mkdir -p log
chmod 755 LoginServer.sh
chmod 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

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd /opt/l2jmobius/cli
./l2jcli.sh
account create -u ADMIN -p -a 8
quit
cd /opt/l2jmobius/cli ./l2jcli.sh account create -u ADMIN -p -a 8 quit
cd /opt/l2jmobius/cli
./l2jcli.sh
account 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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cd /opt/l2jmobius/server/login
./LoginServer.sh
cd /opt/l2jmobius/server/game
./GameServer.sh
cd /opt/l2jmobius/server/login ./LoginServer.sh cd /opt/l2jmobius/server/game ./GameServer.sh
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 client

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
L2J-Mobius Prelude of War
Client Mirror 1: https://drive.google.com/uc?id=1rXtgV9l67b5lBeK_wmCKITE1DQ7EgEJ8&export=download
Client Mirror 2: https://drive.google.com/uc?id=1IugZjcpS5n9_EJPLCecB3H_tLmVlqo2L&export=download
System: https://mega.nz/#!98likSra!vP3uaDwJs8oiY5q60UzBSXAbgNELWX_dycWb98Mz96U
L2J-Mobius Prelude of War Client Mirror 1: https://drive.google.com/uc?id=1rXtgV9l67b5lBeK_wmCKITE1DQ7EgEJ8&export=download Client Mirror 2: https://drive.google.com/uc?id=1IugZjcpS5n9_EJPLCecB3H_tLmVlqo2L&export=download System: https://mega.nz/#!98likSra!vP3uaDwJs8oiY5q60UzBSXAbgNELWX_dycWb98Mz96U
L2J-Mobius Prelude of War
Client Mirror 1: https://drive.google.com/uc?id=1rXtgV9l67b5lBeK_wmCKITE1DQ7EgEJ8&export=download
Client Mirror 2: https://drive.google.com/uc?id=1IugZjcpS5n9_EJPLCecB3H_tLmVlqo2L&export=download
System: https://mega.nz/#!98likSra!vP3uaDwJs8oiY5q60UzBSXAbgNELWX_dycWb98Mz96U

 

The guide has been updated on:
28/4/2020 – Updated OpenJDK from 12 to 14.01
28/4/2020 – Updated Client version to match the most recent build]]

Μονομάχος
Μονομάχοςhttps://e-arena.eu
Comfuzio is a gamer since very young age, ahead of his era and Hellenic society in general.He is also very funny and informative!

Latest articles

Προηγούμενο άρθρο
Επόμενο άρθρο

Related articles