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.
yum update -y
In our case there was no update available but still, checking for updates is a must!
L2JMobius is using OpenJDK 12 in contrast with L2JServer that is still using v11
curl -O https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz tar xvf openjdk-12.0.2_linux-x64_bin.tar.gz mv jdk-12.0.2 /opt/ cat <<EOF | sudo tee /etc/profile.d/jdk12.sh export JAVA_HOME=/opt/jdk-12.0.2 export PATH=\$PATH:\$JAVA_HOME/bin EOF
source /etc/profile.d/jdk12.sh echo $JAVA_HOME
You should get this result if all good (do not copy/paste)
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
L2JMobius uses ANT to build the components from the source code.
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
shutdown -r now
When the server is online again connect and check ant’s 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
And paste in the text bellow
# 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
yum install MariaDB-server MariaDB-client
And then we need to run the DB
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
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
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
You need to give certain permissions for the server to run properly.
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
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.
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
L2J-Mobius Prelude of War (protocol 228) 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 - Part 2 (protocol 235) [Login support only!] Client: https://drive.google.com/uc?id=1MFxyk0upVRqW1HSnkgqvD3As2JAWEMGk&export=download System: https://mega.nz/#!IsEhQI4K!DkdkNgUmu79by1Ogc0qcAE5P4kJAVqzKhlhDL3iZTwA