Lineage 2 Archive
MONCHE forum archive: 236 articles across six categories.
CATEGORIES
Information15
Game Clients29
Files & Tools32
Server Builds108
Server Sources35
Geodata17
Information
Installing the Lineage II Server Components on Ubuntu 18.04 Server
Author: cherokee
Installing the Lineage II Server Components on Ubuntu 18.04 Server
We will manage this server from Windows using PuTTY and WinSCP.
There is no need to cover a minimal Ubuntu Server installation; plenty of articles already explain it.
This guide is best suited to L2JMobius server builds because they use Java 14. Configure the build beforehand just as you would for Windows: enter the database passwords in the login and game server configuration files and complete the other settings. Installation on other Linux distributions is largely the same, although some commands and details differ.
Let's begin.
Download the required software:
Download - putty
Download - winscp
Connect to your Ubuntu server through PuTTY and enter the server username and password chosen during installation.
First, check for updates and install any that are available.
$ sudo apt update && sudo apt upgrade
4. Next, install Java 14. For our database server we will use MariaDB instead of MySQL; the server works well with MariaDB too.
Add the Java repository:
$ sudo add-apt-repository ppa:linuxuprising/java
Then install Java:
$ sudo apt -y install oracle-java14-installer
During installation, you will be asked to accept certificates and terms of use. Simply press Enter and continue.
After installation, check that everything was installed correctly.
$ java -version
The output should look roughly like this:
java version "14" 2020-03-17
Java(TM) SE Runtime Environment (build 14+36-1461)
Java HotSpot(TM) 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)
Now configure Java 14 as the runtime environment.
$ sudo nano /etc/profile.d/jdk.sh
Add the following lines to the end of the file you opened:
export JAVA_HOME=/usr/lib/jvm/java-14-oracle
export PATH=$PATH:$JAVA_HOME/bin
Press Ctrl+X then Y. Done.
Reload the environment:
$ source /etc/profile.d/jdk.sh
The Java 14 runtime environment is installed and ready to use.
Installing mariadb-server and mariadb-client:
Installation will also use the official repository.
$ sudo apt-get install software-properties-common
Add the repository keys:
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
Add the repository itself:
$ sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mirror.mephi.ru/mariadb/repo/10.3/ubuntu bionic main'
Install the MariaDB server and client. During installation, you will be prompted to enter a password for root. Enter the password, confirm it, and continue.
$ sudo apt install mariadb-server mariadb-client
After installation, check whether the server is running. It usually starts automatically.
$ sudo systemctl status mariadb
Next, secure the database server.
$ sudo mysql_secure_installation
You will be asked several questions that require a Yes/No answer.
Change the root password? [Y/n] | Change the root user's password? |
Remove anonymous users? [Y/n] | Remove anonymous users? |
Disallow root login remotely? [Y/n] | Disallow remote access as root? |
Remove test database and access to it? [Y/n] | Remove the test database and access to it? |
Reload privilege tables now? [Y/n] | Reload the privilege tables now? |
Initial database security configuration is complete. We can proceed.
As you can see, these initial steps are simple and take about ten minutes.
Next, upload the prepared Lineage II server build using WinSCP.
WinSCP is as easy to use as PuTTY. Start the application, enter your server username and password, and log in. You can work with the files much like in an FTP client.
Navigate to the Ubuntu server's home directory. Its path is:
home/user/ Here, user is the username created when Ubuntu Server was installed.
For example, create a new directory for the Lineage II server inside your home directory, enter it, and call it server:
home/user/server
Right-click >Create directory > enter the directory name >Done.
Upload the prepared Lineage II server build to this directory.
Great, let's move on.
Installing the Lineage II server
Open PuTTY and go to the Server
$ cd home/user/server
List the contents of the directory:
$ ls
You should see all the files. Next, go to the Login
$ cd login
Create a directory named log and make files with the extension executable.
$ mkdir log
$ chmod +x *.sh
Done. Repeat these steps in the Game
Alternatively, you can create the log directory inside the login and gamefolders in advance rather than through the console, but you must still make the *sh files executable.
Next, enter the db_installer folder and run the database installation files.
$ сd home/user/server/db_installer
There will be two files with the extension *jar
Database_installer_LS
Database_installer_GS
Running either file will start a series of prompts. For most of them, you can simply press Enter, You will also be asked for the database root password, which you set during MariaDB installation. L2JMobius handles the rest: the installer creates an l2jmobius database on localhost and imports all the SQL files. Enter your own settings if needed.
$ java -jar Database_installer_LS
$ java -jar Database_installer_GS
Next, verify that the database and all its tables were created.
$ mysql -u root -p
Enter your password to access the mariadb
List the databases that were created:
$ mysql> show databases;
Excellent, you can see the database. Select it:
$ mysql> use l2jmobius
Database changed
$ mysql> show tables;
Check the list of tables to make sure the database was created and populated correctly. Then exit:
$ mysql> \q
All that remains is to register the game server and start it.
Go to the login server directory:
$ cd ~/server/login/ Run the registration command:
$ sudo ./RegisterGameServer.sh
Answer the prompts to complete registration.
To create an account immediately (enter its name, password, and access level: 0 for user, 100 for administrator), run the following command in the same directory:
$ sudo ./startSQLAccountManager.sh
Now start the services:
$ sudo ./LoginServer.sh
Go to the game folder and start the game server
$ cd ~/server/game/
$ sudo ./GameServer.sh
There is no further output on the terminal.
Check the logs instead. Since you are already in the game server directory, go directly to the log directory, list its files, and inspect a log.
$ cd log
$ ls
$ nano Name of the log file you want to view
How can you tell whether the servers started?
Run:
$ ps -ax
Or:
$ ps -afx
The output lists running processes and their IDs.
Look for two processes. The first should be Java running the login server; this means the login server is running. Look for the corresponding game server process as well.
Alternatively, use:
$ netstat -ntlp | grep :2106
$ netstat -ntlp | grep :7777
How do you stop the server without logging into the game?
List the running processes and terminate the appropriate ones:
$ kill -9 shell_process_id
$ kill -9 login_java_process_id
Do the same for the game server.
The command kill process_id terminates a process more gracefully than kill -9 process_id
That's all.