[Discussion] Linux hosting

Discussions and advertising of dedicated, private servers made by players, for players

Ataman
 
Posts: 6
Joined: 07 Oct 2014, 19:16

[Discussion] Linux hosting

Post by Ataman » 10 Oct 2014, 12:58

Hi everybody

Introduction

First off: Currently there are multiple ways to do this some better some worse. Point of this thread is to discuss different solutions on how to host on Linux
This is NOT a newbie-friendly tutorial. Some basic Linux knowledge and probably tinkering is needed.
Post in this thread if you have different solutions, suggestions or questions about hosting on Linux.

Most of you already know that there is no Linux LiF-Server available at the moment.
Luckily, there is WINE and a few other tools for that.

According to a few quotes from the LiF-Devs, native Linux servers are currently a low priority but that doesn't mean we can't try! :D

Let's start

After a busy evening testing around with WINE, Xvfb, x11vnc and finally Blackbox(not the provider) on Ubuntu I managed to start and play on my Linux machine.
Currently, this is not fully tested, but it was playable so that's a good start.

The software needed for this:
  1. steamcmd (other solutions available)
  2. MariaDB (mandatory)
  3. Xvfb (best (only?) solution)
  4. Blackbox (probably optional)
  5. x11vnc (probably optional as well)
  6. screen (neat to have)
  7. WINE (mandatory)

steamcmd
There are multiple solutions for this, personally I find steamcmd to be the best. Download, Unpack, Run.
https://developer.valvesoftware.com/wiki/SteamCMD
LiF:YO Dedicated Server AppID: 320850

MariaDB
This one is a no-brainer. LiF uses MariaDB so that's what you should install. On Ubuntu you can get it with apt-get directly.
In case of Ubuntu MariaDB 5.5 is available in its own package.

Xvfb
Virtual X11 Server.
While the LiF-Server doesn't seem to need it at first glance it looks like you can't connect your client to it without an X11 server. (Somebody got a hunch why?)
Available through the repositories.

Blackbox
A really small window manager.
Somehow, I couldn't start the server with Xvfb only and couldn't figure out why, Blackbox was the solution for this.
Available through the repositories.
I guess you don't need Blackbox but after wasting a few hours already and Blackbox just working I didn't bother about that.

x11vnc
Since you need a display for Blackbox I installed x11vnc.
This neat little application enables you to connect to your Xvfb display with UltraVNC (or any other VNC software for that matter).
Available through the repositories.

screen
Great little app. Saves you the '&' on a few occasions.
Even if you don't need it it's nice to have!
Pre-installed on most distributions, if not get it through the repositories.

WINE
And last but not least, WINE.
This great application enables you to run most windows-software on your Linux machine!
Available through the repositories. (If not, get the source and compile. This counts for other applications as well).

Installation (in my case)
Download the LiF:YO dedicated server through steamcmd.
Downloading through your local machine and then uploading with WinSCP to your remote machine should work as well but steamcmd would eliminate this step.

Install and configure MariaDB
Don't forget to apply the my.ini (inside the docs folder) to your MySQL configuration.
Since the LiF-Server doesn't create Tables/Functions by itself I did it manually.
I set bind-address to 0.0.0.0 and granted all privileges to my home IP address (which is static).
With remote access enabled I used HeidiSQL to create a UTF-8 database and upload the new.sql script (Again: use UTF-8)
In HeidiSQL load new.sql into the editor and run it with "send batch in one go" enabled, otherwise you'll get syntax-errors.
Sidenote:
If you want to import an existing world be sure your backup.sql (or whatever you call it) doesn't delete Functions.
I'm not certain why but HeidiSQL (and Navicat) are both unable to dump existing MySQL-Functions (they just dump them empty which means if you truncate your dump it will override the existing functions with emptiness of doom).

(If somebody knows how to fix the LiF-Server not creating Tables/Functions, spill it! :D)

Install all other tools and start them up.
In my case I opened a screen and ran these inside it:
Xvfb on display 99 with &
Blackbox with &
x11vnc directly. Detach the screen.

In my case:
Code: Select all
SCREEN -mSU lif
\_ /bin/bash
  \_ Xvfb :99 -screen 0 800x600x8 -ac
  \_ blackbox
  \_ x11vnc -display :99 "hiddenPW" -usepw -forever


Install UltraVNC on your home PC and connect it to your server.
The Blackbox 'desktop' should appear. Right click, open xterm, navigate to your LiF-Directory and start the .exe with
Code: Select all
wine ddctd_cm_yo_server.exe "-worldID 1"


Connect and play.

Another sidenote because some people still try to do that...
Root access is not needed expect for installing and configuring your tools! (MariaDB service).
DO NOT start your screen, Xvfb, blackbox or x11vnc as root EVER.

Opinion on hosting and hardware
It looks like all hosting providers use VPS.
In my honest opinion this is stupid and should not be encouraged. A VPS might work in case of a very few virtual machines but it looks like most hosting providers throw you together with one hundred others and perfomance WILL suffer.
I got a small dedicated server with an i5 @ 3.4 Ghz with 16 GB RAM and an SSD for 46€/Month. If the SSD is too slow for you, use a RAM-Disk.
I assume this is way more than enough for Life is Feudal even when using WINE.

Pros of using dedicated hardware:
- Overkill perfomance
- Cheap as fuck (When you compare it to a 64 Slotted VPS with free lags included).

Contra:
- You need to read, test, and do everything yourself.
Last edited by Ataman on 17 Oct 2014, 16:02, edited 1 time in total.


Nukular
 
Posts: 6
Joined: 14 Oct 2014, 12:22

Re: [Discussion] Linux hosting

Post by Nukular » 14 Oct 2014, 22:36

Nice HowTo ... just tryin to do it on my server ...

tryin to find those my.ini on my debian 7 ...

Can u explain where i find the tables which has to setup? I know how to use phpmyadmin but dunno what db / tables i need to create ...
btw. where are those Lif-files located? I installed it through steamcmd, took less than 1min?!, but it says the app is installed ..


Karotte87
 
Posts: 1
Joined: 14 Oct 2014, 19:19

Re: [Discussion] Linux hosting

Post by Karotte87 » 16 Oct 2014, 15:27

Hi thanks for posting this
just a few thoughts to your guide:

- MariaDB has been introduced to ubuntu repo with version 14.04. Before you can´t find it in the official repository and you have to download it manually
- Steamcmd is just downloading a file named "steamserver.so" which has no function for this server at all. My guess is that steam asks for OS type and only sends out compatible files (.so is usually an unix library) -> @ Nukular: this is why you need to put your Server files manually on your dedicated Server.

I´m actually updating my Server to 14.04 and trying your Guide. I´ll post my experiences and maybe some advice here afterwards

cheers
Julian


Nukular
 
Posts: 6
Joined: 14 Oct 2014, 12:22

Re: [Discussion] Linux hosting

Post by Nukular » 17 Oct 2014, 11:55

Karotte87 wrote:@ Nukular: this is why you need to put your Server files manually on your dedicated Server.

cheers
Julian


Ok ... the question is where do i get the files?

Maybe its needed to buy Life is Feudal first, an than to login over steamcmd so that steamcmd is able to download the files?


Ataman
 
Posts: 6
Joined: 07 Oct 2014, 19:16

Re: [Discussion] Linux hosting

Post by Ataman » 17 Oct 2014, 15:53

@Karotte87

Thanks for the heads-up about Ubuntu, I just tried the latest version and assumed it is generally available.

To get those Windows-files you need to tell steamcmd to actually do that.
One example to download those the serverfiles would be:
Code: Select all
./steamcmd.sh +@sSteamCmdForcePlatformType windows +login anonymous +force_install_dir ~/lif +app_update 320850 validate +quit


Another thing I noticed is that you if you use HeidiSQL to load new.sql (or patch.sql for later updates) onto your database you absolutely HAVE TO load the script into the editor and execute it by using "send batch in one go".
Otherwise you'll run into syntax errors as soon as the script creates functions.


Nukular
 
Posts: 6
Joined: 14 Oct 2014, 12:22

Re: [Discussion] Linux hosting

Post by Nukular » 17 Oct 2014, 20:04

Ok .... i got everthing so far running ... took me an while ... but when i try to start the server i get an errormessage from the Lif-Server i think:

"Unable to load game library "ddctd_cm_yo_server.dll" Please make sure it exists and the latest DirectX is installed. Win error: (317) Message 0x%1 not found in file %2."

And i still have an error importing the database using HeidiSQL:

This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)


Ataman
 
Posts: 6
Joined: 07 Oct 2014, 19:16

Re: [Discussion] Linux hosting

Post by Ataman » 20 Oct 2014, 11:05

@Nukular
It might help if you start telling us on which distro you're trying to run it and what version of WINE and MariaDB you have installed...


Nukular
 
Posts: 6
Joined: 14 Oct 2014, 12:22

Re: [Discussion] Linux hosting

Post by Nukular » 20 Oct 2014, 12:13

After serveral HowTo's of how to install wine (u should mention which version YOU are using, i am usin 1.7.7 now, 1.4.x wasnt workin) the lif-server seems to run ... couldnt check yet if its reachable but i'll check that later. (for the wine-installation i used this howto: http://games4linux.de/howto-easy-wine-1 ... ian-64bit/ but i changed the version from 1-7-6 to 1-7-7)

There is one more problem left when i want to import the .sql-files:

SQL Error (1418) in statement #12: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

I used HeidiSQL 8.3.0 and tried to import the files as u said "in one batch".

**EDIT**
The Sql-Error disappears when the Sql-Server is setup correct. (using the my.ini file)

But i get an error when someone wants to make an new character:


DB error #1305: FUNCTION lif_1.f_createInventory does not exist. Query: INSERT INTO `character`(AccountID, Name, LastName, GeoID, RaceID, Alignment, Strength, Agility, Constitution, Willpower, Intellect, Luck, HungerRate, RootContainerID, EquipmentContainerID, AlchemyHash, VisibilityHash, appearance)VALUES(2, 'schnibbl', 'dibibbl', 117915938, 1, 0, 12000000, 12000000, 12000000, 12000000, 12000000, 0, 10000, f_createInventory(), f_createEquipment(), 0x071232351E1F1309210C191424312C3626172F0F3D08031B37103940043B2A05023C0B004125300D2D2E202B0E3F16111A33233E3A29011D28380A1822063427151C0705010A00040B0902060803050A0408070B020300090601, 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0102);
WARN 2014-10-21 14:52:36.580 {00} <NOSCOPE> DB::noRS(1 ms) INSERT INTO `character`(AccountID, Name, LastName, GeoID, RaceID, Alignment, Strength, Agility, Constitution, Willpower, Intellect, Luck, HungerRate, RootContainerID, EquipmentContainerID, AlchemyHash, VisibilityHash, appearance)VALUES(2, 'schnibbl', 'dibibbl', 117915938, 1, 0, 12000000, 12000000, 12000000, 12000000, 12000000, 0, 10000, f_createInventory(), f_createEquipment(), 0x071232351E1F1309210C191424312C3626172F0F3D08031B37103940043B2A05023C0B004125300D2D2E202B0E3F16111A33233E3A29011D28380A1822063427151C0705010A00040B0902060803050A0408070B020300090601, 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0102);
ECHO 2014-10-21 14:52:36.581 {00} <NOSCOPE> NetInterface::sendCreateCharacterAns
Last edited by Nukular on 21 Oct 2014, 18:57, edited 3 times in total.


Nukular
 
Posts: 6
Joined: 14 Oct 2014, 12:22

Re: [Discussion] Linux hosting

Post by Nukular » 21 Oct 2014, 16:52

Ok .. another thing u should have mention:

why to start all those xvfb, blackbox and vnc stuff when its possible to start the server simply with:

Code: Select all
wine ddctd_cm_yo_server.exe -worldID 1


Ataman
 
Posts: 6
Joined: 07 Oct 2014, 19:16

Re: [Discussion] Linux hosting

Post by Ataman » 07 Nov 2014, 20:36

The charakter-error is exactly why you setup xvfb and blackbox...
Please read the opening post again before asking why, it's written right there.

Return to Private Servers