Create a Lightsail to run the server - Alteredux/XR GitHub Wiki

  1. Create a Amazon Lightsail
    a. Connect to your AWS account
    b. Click on "Create Instance"
    c. Change the location for Montréal
    d. Select the Linux platform
    e. Choose "OS only"
    f. Choose the 5$ plan. That should be enough for your purpose
    g. In the section "SSH Key pair manager", click on "Create New". Choose a name for it and save it.
    h. Click on the "Create instance" button all the way down.
    i. Wait a few minutes

  2. Once the server is up, we need to open some ports to host the server and some games. To do so, click on the server, then choose the "networking" tab. Click on "add rule". You will need two news rules :
    a. Add a TCP protocol with the port 14999
    b. Add a UDP protocol with a range port 15000-25000

  3. In unity, launch a Linux Server build.
    Build and Run Executables for Server

  4. Connect to the Lightsail using this command, using the ssh file generate earlier and the lightsail user found in the Lightsail's details:
    ssh -i D:\ETS\E2021\PFE\Alteredux\key\defaultsshkeypair.pem [email protected]

  5. Download the build of the server into the lightsail using this command:
    scp -i D:\ETS\E2021\PFE\Alteredux\key\defaultsshkeypair.pem 'D:\ETS\E2021\PFE\Alteredux\Alteredux - builded\Virtual Reality Learning 03_15_2021 Build 2019.4.26 - LinuxServer.zip' [email protected]:.

  6. Unzip the folder.

  7. Clone the MatchUpServer project on github. You can find it here.

  8. You will need to build the MatchUpServer app and add into the server files. To do so, go in the MatchUpServer folder and use the "make" command.

  9. Once the build complete, copy the MatchUpServer file with the "cp" command and paste it into the Server folder.

  10. Now go in the Server Folder. You need to add right to execute the MatchUpServer and the game server. Use the chmod command like this :
    chmod +x ./MatchUpServer
    chmod +x ./Server.x86_64

  11. Start the server with : ./MatchUpServer

Additionnal details : TMUX

TMUX allow us to work in shell, meaning we can run the server in a separate process. In order to run the server with TMUX :

  1. Join a shell with tmux attach
  2. Run the server as usual

Here is other commands useful with TMUX: ctrl+b, d : This allow to detach from the shell.
kill session : This command terminate the shell while in it.
If you want to scroll up, use ctrl+b, [, "uparrow"

For more details : https://www.youtube.com/watch?v=RIvEJ2LP0W0