L2JMobius
Free Users => Work in Progress => Topic started by: Mobius on August 29, 2020, 10:39:30 PM
-
I do not use Linux, I need help from someone that does.
The idea is to start Database_Installer_GS.jar via an .sh file.
So with the Database_Installer_GS.exe it will be included a Database_Installer_GS.sh
Based on the source Database_Installer_GS.jar MUST run with parameters.
/**
* Contains main class for Database Installer If system doesn't support the graphical UI, start the installer in console mode.
* @author mrTJO
*/
public class LauncherGS extends AbstractDBLauncher
{
public static void main(String[] args) throws Exception
{
final String defDatabase = "l2jmobiusc6";
final String dir = "sql/game/";
if ((args != null) && (args.length > 0))
{
new DBInstallerConsole(defDatabase, dir, getArg("-h", args), getArg("-p", args), getArg("-u", args), getArg("-pw", args), getArg("-d", args), getArg("-m", args));
return;
}
try
{
// Set OS Look And Feel
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e)
{
// Ignore.
}
try
{
new DBConfigGUI(defDatabase, dir);
}
catch (HeadlessException e)
{
new DBInstallerConsole(defDatabase, dir);
}
}
}
and
public DBInstallerConsole(String defDatabase, String dir, String host, String port, String user, String pass, String database, String mode)
So the parameters are: host, port, user, pass, database, mode
Mode based on
if ((mode != null) && ("c".equalsIgnoreCase(mode) || "u".equalsIgnoreCase(mode)))
is either c or u
-
Running Mobius on Linux/CentOS 7/8.
This is what I'm personally using every time I reinstall and configure CentOS 8.
sudo yum update
OpenJDK 14:
sudo yum -y install curl
curl -O https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz
tar xvf openjdk-14_linux-x64_bin.tar.gz
sudo mv jdk-14 /opt/
sudo tee /etc/profile.d/jdk14.sh <<EOF
export JAVA_HOME=/opt/jdk-14
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
source /etc/profile.d/jdk14.sh
Checking it:
echo $JAVA_HOME
java -version
MariaDB
sudo yum install mariadb-server
sudo systemctl enable mariadb
sudo systemctl start mariadb
Setting the default root password and a few other settings:
sudo mysql_secure_installation
Db, users, etc.
mysql -u root -p
CREATE DATABASE l2jmobiusclassicinterlude;
CREATE USER 'dbuser123'@'localhost' IDENTIFIED BY 'ThisIsAPasswordChangeMe';
GRANT ALL ON l2jmobiusclassicinterlude.* to 'dbuser123'@'localhost' IDENTIFIED BY 'ThisIsAPasswordChangeMe' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
Useful commands:
---
Privileges to LS/GS - only once is needed
cd server/login/
chmod +x LoginServer.sh LoginServerTask.sh
cd
cd server/game/
chmod +x GameServer.sh GameServerTask.sh
chmod +x start.sh start_loop.sh
---
Start LS/GS
cd server/login/
./LoginServer.sh
cd
cd server/game/
./GameServer.sh
tail -f log/stdout.log
"tail -f log/stdout.log" will show you the console, so you can also run it inside the LS folder to see it.
---
Kill LS/GS
ps aux | grep java
kill -9 47111 (process number)
FTP Server:
If you install CentOS 8 you usually get to choose to have it preinstalled.
sudo yum install ftp vsftpd
sudo nano /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to UNIXMEN FTP service.
use_localtime=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
file_open_mode=0777
sudo systemctl enable vsftpd
sudo systemctl start vsftpd
You save a .conf file with CTRL+X then (Y)Yes.
-
If you'll put a live server dont forget to edit:
1.: Limits. https://rtcamp.com/tutorials/linux/increase-open-files-limit/ (https://rtcamp.com/tutorials/linux/increase-open-files-limit/)
2.: Tune database server. (i think only increasing max_connections and raise a bit innodb_buffer_pool_size)
3.: Network Stack and kernel. https://github.com/klaver/sysctl (https://github.com/klaver/sysctl)
4.: Secure restrictions access, iptables. https://www.ipfire.org (https://www.ipfire.org)