Advertisement
Eddow

Astonia 3 Server Installation VPS

Nov 28th, 2017
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.60 KB | None | 0 0
  1. One stop guide to making a "public" Astonia Server
  2.  
  3. By Eddow
  4. https://www.ugaris.com for a running live example.
  5.  
  6.  
  7. Step 1. Obtaining a VPS
  8.  
  9. In order to run an astonia server, you need a linux operating system. You have three choices here, 1. you can host it on your own computer if you run linux, 2. you can virtualize a linux os using virtualbox/vmware/hypervm etc., or the preferred option 3. You can rent a VPS (Or dedicated server if you plan on 1000+ players) from a company. I recommend https://patollic.com/cart.php?gid=3 since Ugaris is hosted by this company (Owned by me, Eddow). After ordering a VPS (Which is what this guide will assume) you recieve an IP address and a username & password combination. These are required to connect to your VPS using SSH. This bring us to ->
  10.  
  11. Step 2. Connecting to your server using SSH
  12.  
  13. To connect to our newly bought server, we will use Putty (free software for windows to connect to a server using SSH, available here:https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html . Download and install the 32 bit (Windows Installer) file and install and open the "putty" program.
  14.  
  15. It should look like this:
  16. https://i.imgur.com/SYoCIFb.png
  17.  
  18. Put the IP address in the field pointed by arrow 1, and click on open pointed by arrow 2.
  19.  
  20. This will bring up a big black scary box called the terminal.It will ask for login, fill in your username (Most likely "root", and press enter, It now asks for a password, type in the password you received, It will not display anything on the screen, but it will register it, so don't worry, type the password and click enter. You should now see something like this:
  21. https://i.imgur.com/XjHgofy.png
  22.  
  23. From this box we will be executing a bunch of commands, and eventually "control" and do everything we need to run astonia. I will be listing a bunch of commands bellow, so make sure you type them all in exactly (Remember it is case sensitive). This brings us to ->
  24.  
  25. Step 3. Configuring the VPS to be "Astonia Ready"
  26.  
  27. To make the VPS astonia ready, we need to install some packages, edit some rules, make a user and all sorts of stuff. Luckily, I did most of the work for you, and all you have to do is copy/paste and press enter on the lines bellow. I will explain in detail what each line does however, to make you feel at ease, and so you can learn how and why =).
  28.  
  29. First command we will execute is
  30.  
  31. *yum -y update*
  32.  
  33. to make sure our VPS is up to date. Don't fear! this will spout out a lot of text and might take some time, Wait until it is completed (up to 30-60 min depending on VPS)Your screen should look approximately like this: https://i.imgur.com/jxxKQeT.png . Time to execute the next command:
  34.  
  35. *yum -y groupinstall 'Development Tools'*
  36.  
  37. . This will install the nessecary files to "Build" the astonia server. Again this may take a while, just wait until it finishes.
  38.  
  39. Next up we install some libraries required by Astonia to build using the command:
  40.  
  41. *yum -y install glibc.i686 glibc-devel.i686 libstdc++.i686 libstdc++-devel.i686 zlib.i686 zlib-devel.i686 mysql-devel.i686 mysql-libs.i686 mysql libpng mariadb-devel.i686 mariadb-devel psmisc*
  42.  
  43. Next we need Mysql(mariadb) for the "database" which stores all information about accounts and characters.
  44.  
  45. *yum -y install mariadb-server;*
  46.  
  47. (This might already be installed and give an error saying "No package mysql-server available" in that case, move to next command.)
  48.  
  49. And start the mysql server
  50.  
  51. *systemctl start mariadb.service*
  52.  
  53. And ironically, we can shut it down right after
  54.  
  55. *systemctl stop mariadb.service*
  56.  
  57. Now we will update the mysql root password to the one used by astonia, this is very bad practise and should be avoided, but to keep things simple, we'll do it here. Might cover a better alternative in the future in a different tutorial. Run this command:
  58. */usr/bin/mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('flni1sbu') Where User='root'; FLUSH PRIVILEGES;" ;*
  59.  
  60. And we can start the mysql server again (and leave it on this time) using:
  61.  
  62. *systemctl start mariadb.service*
  63.  
  64. Now we will make a "user account" for the astonia server on the vps.
  65.  
  66. *useradd astonia*
  67.  
  68. Now we have to move ourself to the astonia "home" folder using:
  69.  
  70. *cd /home/astonia/*
  71.  
  72. On to step 4 ->
  73. Note: We will be executing commands as the "astonia" user by using sudo -u astonia infront of the commands. This is extremely important to prevent permission issues.
  74.  
  75. Step 4. Downloading Astonia server files
  76.  
  77. We will now download the files directly from brockhaus.org (If this link ever gets removed, replace it with a new link of the astonia 3 server files)
  78.  
  79. *sudo -u astonia wget http://brockhaus.org/astonia3_server.tgz*
  80.  
  81. Extract the archive:
  82.  
  83. *sudo -u astonia tar -xzvf astonia3_server.tgz*
  84.  
  85. Move ourselves in the actual astonia server folder
  86.  
  87. *cd astonia3_server*
  88.  
  89. Time to import the default mysql databases and content.
  90.  
  91. First we make a quick fix to the sql files
  92. *replace "TYPE=MyISAM" "ENGINE=MYISAM" -- create_tables.sql*
  93.  
  94. Next we make the tables
  95. *mysql -uroot -pflni1sbu < create_tables.sql*
  96. And last import the default data (and ishtar character for later on)
  97. *mysql -uroot -pflni1sbu merc < storage.sql*
  98. and
  99. *mysql -uroot -pflni1sbu merc < merc.sql*
  100.  
  101. Now we need to fix some old code to make the server run on 64bit.
  102. Remove lines 23 to 25 from tool.h
  103. *sed -i '23,25d' tool.h*
  104. Remove lines 83 to 94 from tool.c
  105. *sed -i '83,97d' tool.c*
  106. Last commands to execute(Building the server) and reboot the system, to finalize
  107.  
  108. *sudo -u astonia make*
  109. This one will take a while, just let it go, it will throw a bunch of errors and what not, this is normal. So long as the final result is like this:
  110. https://i.imgur.com/3ZVLSF4.png
  111.  
  112. Make sure mysql starts when the server boots up
  113. *chkconfig mariadb on*
  114. And Reboot!
  115. *reboot*
  116.  
  117. If all went well and you got all the way here, YAY! You are almost done!
  118.  
  119. This will disconnect us from the terminal, we have to wait 5 min or so, and re-connect using step 1. It should look like:
  120. https://i.imgur.com/D2ndqpm.png
  121.  
  122. All that is left is to start the server, But first we have to edit one simple file in step 5.
  123.  
  124.  
  125. Step 5. Connecting to the server for easier editing using FileZilla
  126. If you plan on modifying any files, keep in mind you will always need to execute *make* after any modification to a .c or .h file. Because you will need to rebuild the game server.
  127.  
  128. To connect to your server using filezilla, you need to give the "astonia" user a password. You can do so by executing:
  129. *passwd astonia*
  130. Type in the password, and press enter. Again this will most likely be invisible. You will have to repeat it.
  131.  
  132. Now you can download filezilla (free ftp program that allows you to connect using sftp (https://filezilla-project.org/download.php)
  133. Install and open filezilla it should look like this:
  134. https://i.imgur.com/gY11Cjw.png
  135. Fill in:
  136. 1. your servers IP address
  137. 2. "astonia"
  138. 3. Password for astonia you just made
  139. 4. 22 (Very important you put 22 here, otherwise it won't connect)
  140.  
  141. Press connect, and on the right side you will see the server files. You can now use filezilla to edit the files. Right click a file and click edit. I highly suggest installing notepad++ (https://notepad-plus-plus.org/) and make it your default editor (google how to, im tired of typing xD)
  142.  
  143. Edit start file, and make sure that all areas are started. Just replace all of the text with this: https://pastebin.com/kyYFMmt7
  144.  
  145.  
  146. Now boot up the server using:
  147. First CD into the directory
  148. *cd /home/astonia/astonia3_server/*
  149. then START!
  150. *sudo -u astonia sh start*
  151.  
  152. Step 6. The client
  153.  
  154. If I get enough feedback on this one, I will make a tutorial for configuring the client.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement