Setting up a Multiplayer Server/en: Difference between revisions

From Vintage Story Wiki
Updating to match new version of source page
(Updating to match new version of source page)
Tags: Mobile edit Mobile web edit
(Updating to match new version of source page)
Line 151: Line 151:
== Basic Configuration ==
== Basic Configuration ==


Once your server is up and running you might want to look over some of the following configuration options. You can configure the server while its running through commands or by editing the serverconfig.json, for which the server needs to be stopped.
Once your server is up and running you might want to look over some of the following configuration options. You can configure the server while its running through commands or by editing the [[Server Config|serverconfig.json]], for which the server needs to be stopped first.
On windows, by default this file is located at '''%appdata%/VintageStoryData/serverconfig.json'''.
On windows, by default this file is located at '''%appdata%/VintageStoryData/serverconfig.json'''.
On Linux it's located at '''./data/serverconfig.json''' of your server directory (e.g. ''/home/vintagestory/server/data/serverconfig.json'' if setup like described here)
On Linux it's located at '''./data/serverconfig.json''' of your server directory (e.g. ''/home/vintagestory/server/data/serverconfig.json'' if setup like described here)


{{Protip
{{Protip|The easiest way to get a world configured to your wishes is to first create it in Single Player, using the advanced world creating options - and then upload it to use as your server world.}}
|The easiest way to get a world configured to your wishes is to first create it in Single Player, using the advanced world creating options - and then upload it to use as your server world.
}}


''Explanation of values in serverconfig.json you can find here: [[Server Config]]''
''Explanation of values in serverconfig.json you can find here: [[Server Config]]''
Line 351: Line 349:


Have Fun!
Have Fun!
==Advanced setup==
===Using an SRV Record to point a domain to your server===
In some cases, you may not able to get a server with the default port (Multiple instances on the same server, paid hosts...), and you will have to add the port at the end of the server's address in order to connect to it.<br>
But you might want to avoid the need to specify the port (Easier to remember, look cleaner).
There is a way to point a domain to your server and avoid the need to add the port : SRV Records<br>
SRV Records allow you to point a domain/subdomain to your instance, while letting the game know the port to use.<br>
How to set up an SRV Records will depend on your domain provider, and you should check on their documentation before making any changes. However, the idea and values remain the same for every provider.<br>
Let's take a server with the following details :
* Address : <code>play.example.com</code>
* Port : <code>50030</code>
* Owned domain : <code>mydomain.com</code>
* Desired subdomain : <code>vintagestory.mydomain.com</code>
Your raw SRV Records should look something like this :
  _vintagestory._tcp.vintagestory.mydomain.com.  IN  SRV 10 10 50030 server.example.com.
The underscores and trailing dots are important! Here are some details :
* <code>_vintagestory</code> define the service, in our case, Vintage Story<br>
* <code>_tcp</code> define the protocol, Vintage Story use TCP<br>
* <code>vintagestory.mydomain.com.</code> is the subdomain we want to use. The trailing dot is important!<br>
* <code>IN SRV</code> Define the record type, don't change this<br>
* <code>10 10</code> are in order the priority and the weight of our record, in our case those are not important, as you are probably not going to load balance a Vintage Story server<br>
* <code>50030</code> is the port our instance is listening on<br>
* <code>server.example.com.</code> is the target, where the server is located. The trailing dot is mandatory as the target server is not on the same domain as us. If it was the case, you would only need to add the subdomain of the target without the trailing dot<br>
If you wanted to have your record pointing to your domain directly, you would have <code>mydomain.com.</code> instead of <code>vintagestory.mydomain.com.</code>
Here is how to do it for OVH and Hetzner (Don't forget to edit the values to suit your setup !) :
====OVH====
You will need to go to your DNS zone and add an entry, select the SRV Record type :
* Sub-domain : <code>_vintagestory._tcp.vintagestory</code> You don't need to add your domain, as their form do it for you.
* TTL : No need to change this
* Priority : <code>10</code>
* Weight : <code>10</code>
* Port : <code>50030</code>
* Target : <code>server.example.com.</code>
====Hetzner====
You will need to create a record from their DNS Console :
* Type : <code>SRV</code>
* Name : <code>_vintagestory._tcp.vintagestory.mydomain.com.</code>
Click on the Value field to enter the details :
* Priority : <code>10</code>
* Weight : <code>10</code>
* Port : <code>50030</code>
* Target : <code>server.example.com.</code>
Wait a few minutes for your record to propagate and then try to use it to connect to the server, using <code>vintagestory.mydomain.com</code> as the address.
You are now all set up to share your server with your custom domain.
{{Game navbox}}
44,019

edits