So, you want to install L2JMobius on Debian 10, because you don't want to pay more for a Windows License, or do you prefer Open Source Software.
Whatever, there is your guide. First, you need a dedicaded server. for starters and going cheap, you can try out kimsufi.com, backed by OVH, the third/fourth biggest worldwide server provider, in France.
The biggest problem is JAVA 14, because for debian 10, the 'default JDK/JRE' is Java 11, so, we need to install the Java 14 JDK manually and set as the default runtime for Java. Once this problem is solved, the guide is very simple.
This guide helps you to install L2JMobius directly from source. if you have a precompiled version of L2JMobius already prepared, the guide is simpler.
0.- PREPARINGfirst, I assume you are using Windows, so, you need a few programs to interactuate with the server. You need PUTTY and WINSCP. These programs are very easy to found, download and install.
Install both programs, and try to connect to the server. Putty allows to connect to terminal text. WinSCP allows you to copy to and from the server with a graphical interface.
Usually, debian 10 uses a standard user, and you need to run 'elevated' commands with 'sudo' before. if you have a 'root' user/password, you can omit all 'sudo' in the commands.
1.- INSTALL MARIADBConnect through putty to your server. update your system and upgrade installed packages:
sudo apt -y update
sudo apt -y install software-properties-common gnupg2
sudo apt -y upgrade
sudo reboot
We need to import MariaDB gpg key which contains the keys used for signing MariaDB Debian packages. Then add the MariaDB repository to your system:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.4/debian buster main'
After addition of the repository, installation of MariaDB 10.4 server and client packages can be done by running the following commands in your terminal.
sudo apt update
sudo apt install mariadb-server mariadb-client
Now run the secure script to set root password, remove test database and disable remote root user login.
sudo mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
... Success!
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
OK. MariaDB installed. moving on... remember to get note of the NEW mariadb root password that you set if the previous step.
2.- INTERLUDE, INSTALL REQUIRED SOFTWAREInstall Midnight commander, to get a text/graphical interface for browsing quickly and edit files. also, we need 'ant' to compile L2JMobius and 'git' to download L2JMobius
sudo apt install mc ant git
3.- INSTALL ORACLE JDK14As we say before, the biggest problem is JAVA 14, But, thanks to the new repository from LinuxUprising, is very easy.
sudo apt update
sudo add-apt-repository ppa:linuxuprising/java
sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys EA8CACC073C3DB2A
sudo apt update
sudo apt -y install oracle-java14-installer
sudo apt -y install oracle-java14-set-default
java -version
If you have done every step, you will have Java version "14.0.2" or higher.
4.- DOWNLOAD AND COMPILE L2JMOBIUS FREEWe are downloading and compiling the source code. if you have the server pack already compiled, just upload to the server using WINSCP and skip this step.
git clone https://bitbucket.org/MobiusDev/l2j_mobius.git
cd l2j_mobius
now, enter in the server version that you want to compile, and compile it with 'ant. Here, I am going to compile CT_2.6_HighFive
cd L2J_Mobius_CT_2.6_HighFive
ant
cd ..
cd build
mc
and here, you will have the ZIP of the compiled server. now, just copy it to the desired location using 'mc'. navigate in the right panel (using 'tab' to change between panels) and press F5 to copy the selected file to the other panel. press F10 to exit 'mc'.
5.- UNZIP, CONFIGURE AND RUN THE SERVERGo to where you have the ZIP of the server, and unzip it
unzip file.zip
Because a bug in the ant compiling and building, the 'scripts' (.sh) aren't set the execute flag, so we need to set the execute flag in every .sh files. Also,because the same bug, we need to create manually the 'log' directories
cd login
chmod +x *.sh
mkdir log
cd ..
cd game
chmod +x *.sh
mkdir log
cd ..
Now, we'll install the database. you can accept the defaults, except the password, that you must provide the mariaDB password that we change in the step 2. Also, choose Clean install and destroy the previous DB.
cd db_installer
java -jar Database_Installer_LS.jar
java -jar Database_Installer_GS.jar
cd ..
Now, it's time to setup and run the loginserver. with 'mc', edit the
login/config/LoginServer.ini. press F4 inside 'mc' to edit the file. If 'mc' ask for the editor, choose 'mcedit', because is integrated inside 'mc' and is easier than nano or vim. Here, you only need to setup Database Password. Fill it up, save with F2, and press F10 to exit the editor.
Do the same with
game/config/Server.ini, and setup the mariaDB password. (F4 enter editor, F2 save, F10 exit editor)
Now it's the moment to copy the geodata. download it directly with 'wget' and 'unzip' it, or download in your PC, upload it using WinSCP and copy to the final directory (game/dat/geodata) using 'mc'. The Geodata download link is in the Readme.txt of the compiled server, along with the client download link.
finally, run the loginserver and the game server. You can run manually entering in the directories, or launch them through 'mc'. You must launch 'login/LoginServer.sh' and 'game/GameServer.sh'
6.- ENDGAME, STATUS AND STOPING THE SERVERTo view the status, you can enter the 'log' directories in the login and game, and press F3 (inside 'mc') to view the stdout.log of them, to view the output of both servers separately.
To view the comsumption of the servers, and to stop them, you can use the command 'top'. If it's the first time running it, you can setup to view it more beautiful: press 'z' (colour), '1' (separate CPU report), 'c' (view full command line), 'M' (upper 'm', order by memory comsumption), 's' (speed of refresh, set it up to 0.25 or 0.5), and, finally, press 'W' (upper 'w', to write the configuration).
If you press 'q', you exit the 'top' utility. If you press 'k' you can 'kill' (Close) a proccess, inputing the PID number and acepting the '15' reason'. The LoginServer reboots automaticaly, but with the GameServer, you need to relaunch it.
AND THAT'S ALLNow you have a running L2JMobius server.