RMS Home | Guide Writing | Test Server | New Servers | Latest Reviews

Author Topic: TL;DR Server DevOps  (Read 629 times)

0 Members and 1 Guest are viewing this topic.

Online Bue

TL;DR Server DevOps
« on: Jun 14, 2017, 07:09 PM »
I got this PM today. And thought my reply was worth sharing.

Quote
Hey man!

Ive got some newbie questions on opening my own server. Everyone has to start somewhere and id like that somewhere to be now!

Would you be interested in helping me with a list of things ill need in order to set up a server.

I am eager to learn and have other connections out there once i get the basics of the start up.

Thanks again!

Create your website and control panel.
1. Buy a cheap VPS host for $5 to host your website; https://www.digitalocean.com/pricing/.
2. Buy a domain name for ~$10 a year; https://www.godaddy.com/domains/domain-name-search.
3. Create an AAAA record for your domain (devilishro.net) to point to your website (104.131.56.68); wait one or two days for DNS servers catch up.
4. [Optional] Buy an SSL certificate for your website; https://www.digicert.com/ssl/.
5. Use putty to SSH into your VPS host; http://www.putty.org/.
6. Setup your key for the SSH server on your VPS host; https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets.
7. Learn how to perform system administration on your Linux distribution such as CentOS.
8. Using your package manager to install MariaDB (MySQL) and Apache or Nginx.
9. Load your ragnarok database schema (.sql file) from rAthena or Hercules into MySQL.
10. Select a popular CSS framework and read up on CSS compression.
11. Learn how to write javascript and read up on Google Closure compression.
12. Learn how to write PHP or Python (w/ Flask or Django)
13. Write your front end (CSS/HTML/Javascript) and your backend (python/php) to implement basic control panel; creating an account.
14. Learn how to connect to your ragnarok database on your MySQL server from python or php; using sqlalchemy for python.
15. Configure your Apache or Nginx to run your web application (see steps 10-14); setup wsgi module for apache if using python.
16. Buy and setup IPS Forum; https://invisioncommunity.com/.
17. [Optional] Configure SSL certificate for HTTPS for your website on Apache or Nginx.

Create your patcher.
1. Learn how to implement the GRF format; description and example .
2. Learn how to write your patcher with GRF support using C++ with wxWidget and the GRF format implementation above.

Create your custom ragnarok client and grf.
1. Download a hex editor on rAthena or Hercules.
2. Download a raw client on rAthena or Hercules.
3. Hex your raw client with hex editor.
4. Modify the resource section of your hex client to your own icon image.
5. Learn how to write Lua.
6. Gather your Lua files (.lub / .lua) and other data files into a GRF with your GRF implementation.

Setup your server. (Use your VPS or local host for testing, then buy a dedicated server to host your production server)
1. Learn how to use git.
2. Learn how to use Visual Studio 2017 (on windows) or how to use autotools (on Linux).
3. Clone rAthena or Hercules repository using git.
4. Compile rAthena or Hercules using VS2017 or autotools.
5. Setup and configure your MySQL account for rAthena and Hercules.
6. Start the server. (If it fails, then learn how to network and tcp/ip.)

Developing your map, char, and login server.
1. Learn how to write C. 1, 2.
2. Learn how to write data structures and algorithms in C.
3. Learn how to use a C compiler; gcc on linux and vs2017 on windows.
4. Learn about the binary executable file format ELF on linux or PE on windows.
5. Learn how to debug memory corruption and fix memory leaks with Valgrind on linux or Dr. Memory on windows.
6. Learn how to debug a core dump with gdb on linux, lldb on osx, or windbg on windows.
7. Learn how to write network applications (client and server).
8. Learn the difference between static and dynamic library linking.
9. Learn each rAthena and Hercules dependency libraries.
10. Learn how to use wireshark and the Ragnarok protocol.
11. Study rAthena and Hercules source code until enlightenment.
12. [Optional] Learn about DLL injection for your hexed client, also windows internal.
13. [Optional] Add encryption between client and server; openssl 1 & 2.

Developing content.
1. Read the scripting manual to learn how to write NPCs.
2. Learn how to use Browedit to create custom maps.
3. Learn how to use photoshop to modify color palettes and sprites.

I miss out on some stuff, but you can probably google it. Here is some of the books in my library and my current workstation and server. And one of these won't hurt.

[Added]
1. Learn about virtualization such as VMWare or HyperV.
2. Learn how to write a windows kernel driver to detect cheats and huehuehuehue.

Advertisement

Offline yC

Re: TL;DR Server DevOps
« Reply #1 on: Jun 15, 2017, 02:34 AM »
Oh please, can I hand you a pair of nerdie glasses?

Thanks for showing the way to a newbie ... would be just fine to link him/her to one of the developer's forum and wiki plus a few words of advice.

Online Bue

Re: TL;DR Server DevOps
« Reply #2 on: Jun 15, 2017, 04:47 AM »
i already have nerdie glasses. :(

tbh, you can short circuit a majority of that list, which itself is only the tip of the iceberg for one very specific instance. (the more you learn, the less you know, unless you are a god in mathematics, then of course you would be too smart to run a private ragnarok server though)

the real advice for making long term donation money is creating content (npcs, items, monsters, pets, equips, events, instances, etc), automating the backend infrastructure, and implementing community-facing policies. plus fiscal responsibility such as filing your taxes, paying bills, reinvesting the profit, and saving for emergencies.

 

Offline Duckshooter

Re: TL;DR Server DevOps
« Reply #3 on: Jun 15, 2017, 04:51 AM »
Nerdie glasses make us look smart, ok? Mom AND grandma said so!

Offline Yuzo

Re: TL;DR Server DevOps
« Reply #4 on: Jun 15, 2017, 05:15 AM »
I think the struggle to login to your made server for the first time is the most important step. I always wanted to work on ro server stuff, but I never knew how to get started. Struggling through the process of EVERYTHING setup related, scripting, source coding - it was all worth it in the end.


For those trying to setup a server for the first time, I advise you to try to setup a local one on your on comp/net. It is far more difficult than setting up through VPS. Why do it? It's like a training step. If you can do that, you should be able to do anything...eventually. Most of the things I have dealt with since learning how to run an emulator pale in comparison to setting up for that first time.
IT'S WORTH IT!

Offline mtil

Re: TL;DR Server DevOps
« Reply #5 on: Jun 15, 2017, 03:42 PM »
Good list for the most part. Some things I'd adjust/add:
  • There are more forum options than buy/setup IPS. While IPS works well, I'd say it's fairly bloated and has larger impact on server CPU/resources than other leaner options.
  • You should learn to use vagrant and do all the setup/learning first locally on a debian/centos vagrant box. You shouldn't need to move to the cloud until much later depending on how much development you plan on doing.
  • You don't necessarily need two separate servers for website/forum & game server. I'd start with a single server and scale up later. You also don't need a dedicated machine. I'd start with a VPS with good performance and uses virtualization such as KVM instead of OpenVZ for more predictable resource guarantees. You can move to dedicated later if it's necessary (based on how popular your server gets)
  • If you want to go the extra mile in DevOps, then automate your server configuration and deployment.
     It lets you easily "setup" your server on a local vagrant, a throwaway test server on digitalocean, or your actual server machine. I'd recommend Ansible personally.
  • Learn how to do backups on your RDBMS (mysql/mariadb)
  • After learning the basics of git, I recommend forking rAthena or Hercules on github or gitlabs, create a branch from master and use that for your server. Then you can make any fixes if necessary on that branch and merge from upstream master manually.
  • I'd also consult various resources on the internet rather than reading the books mentioned (unless you want to/have the time for it)