RateMyServer Ragnarok Community

RateMyServer.Net => Server Discussion => Topic started by: Bue on Jun 14, 2017, 07:09 PM

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

QuoteHey 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/. (https://www.digitalocean.com/pricing/.)
2. Buy a domain name for ~$10 a year; https://www.godaddy.com/domains/domain-name-search. (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/. (https://www.digicert.com/ssl/.)
5. Use putty to SSH into your VPS host; http://www.putty.org/. (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. (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 (https://www.centos.org/docs/5/).
8. Using your package manager to install MariaDB (MySQL (https://www.amazon.com/MySQL-Developers-Library-Paul-DuBois-ebook/dp/B00C2SFK2Q/ref=sr_1_11?ie=UTF8&qid=1497477159&sr=8-11&keywords=MySQL)) and Apache  (https://www.amazon.com/Apache-Definitive-Guide-Ben-Laurie/dp/0596002033/ref=sr_1_5?ie=UTF8&qid=1497477189&sr=8-5&keywords=apache+server)or Nginx.
9. Load your ragnarok database schema (.sql file) from rAthena or Hercules into MySQL.
10. Select a popular CSS framework (https://en.wikipedia.org/wiki/CSS_framework) and read up on CSS compression (http://csscompressor.com/).
11. Learn how to write javascript  (https://www.amazon.com/JavaScript-Definitive-Guide-Activate-Guides/dp/0596805527/ref=sr_1_1?ie=UTF8&qid=1497477253&sr=8-1&keywords=javascript+the+definitive+guide)and read up on Google Closure compression (https://closure-compiler.appspot.com/home).
12. Learn how to write PHP or Python (w/ Flask  (http://flask.pocoo.org/) or Django (https://www.djangoproject.com/))
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  (https://www.sqlalchemy.org/)for python.
15. Configure your Apache or Nginx to run your web application (see steps 10-14); setup wsgi (https://wsgi.readthedocs.io/en/latest/) module for apache if using python.
16. Buy and setup IPS Forum; https://invisioncommunity.com/. (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 (https://rathena.org/board/topic/57175-description-of-the-grf-file-format/) and example (https://github.com/MagicalTux/grf) .
2. Learn how to write your patcher with GRF support using C++ (https://www.amazon.com/C-Programming-Language-4th/dp/0321563840/ref=sr_1_1?ie=UTF8&qid=1497477881&sr=8-1&keywords=C%2B%2B) with wxWidget  (https://www.amazon.com/Cross-Platform-Programming-wxWidgets-PerensOpen-Source-ebook/dp/B001SMSBE6/ref=sr_1_sc_1?ie=UTF8&qid=1497477902&sr=8-1-spell&keywords=wxwdiget)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 (https://www.amazon.com/Programming-Lua-Roberto-Ierusalimschy/dp/859037985X/ref=sr_1_4?ie=UTF8&qid=1497478383&sr=8-4&keywords=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 (https://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=git+oreilly&rh=i%3Aaps%2Ck%3Agit+oreilly).
2. Learn how to use Visual Studio 2017 (https://www.visualstudio.com/vs/whatsnew/) (on windows) or how to use autotools  (http://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html)(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 (https://www.amazon.com/Computer-Networking-Top-Down-Approach-6th/dp/0132856204/ref=sr_1_4?ie=UTF8&qid=1497478847&sr=8-4&keywords=computer+networking) and tcp/ip (https://www.amazon.com/Sams-Teach-Yourself-TCP-Hours/dp/0672335719/ref=sr_1_17?ie=UTF8&qid=1497479179&sr=8-17&keywords=tcp+ip).)

Developing your map, char, and login server.
1. Learn how to write C. 1 (https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504/ref=sr_1_8?ie=UTF8&qid=1497479706&sr=8-8&keywords=C+programming), 2 (https://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_2?ie=UTF8&qid=1497479706&sr=8-2&keywords=C+programming).
2. Learn how to write data structures and algorithms (https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844/ref=sr_1_3?ie=UTF8&qid=1497479771&sr=8-3&keywords=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  (http://valgrind.org/)on linux or Dr. Memory (http://www.drmemory.org/) 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) (https://www.amazon.com/UNIX-Network-Programming-Networking-Sockets/dp/013490012X/ref=sr_1_16?ie=UTF8&qid=1497480064&sr=8-16&keywords=network+programming).
8. Learn the difference between static and dynamic library linking.
9. Learn each rAthena and Hercules dependency libraries.
10. Learn how to use wireshark  (https://www.wireshark.org/)and the Ragnarok protocol.
11. Study rAthena and Hercules source code until enlightenment.
12. [Optional] Learn about DLL injection (https://en.wikipedia.org/wiki/DLL_injection) for your hexed client, also windows internal (https://www.amazon.com/Windows-Internals-Part-architecture-management/dp/0735684189/ref=sr_1_1?ie=UTF8&qid=1497480496&sr=8-1&keywords=windows+internal).
13. [Optional] Add encryption between client and server; openssl 1 (https://www.amazon.com/Network-Security-OpenSSL-John-Viega/dp/059600270X/ref=sr_1_1?ie=UTF8&qid=1497480413&sr=8-1&keywords=openssl) & 2 (https://www.amazon.com/Bulletproof-SSL-TLS-Understanding-Applications/dp/1907117040/ref=sr_1_2?ie=UTF8&qid=1497480413&sr=8-2&keywords=openssl).

Developing content.
1. Read the scripting manual (https://github.com/rathena/rathena/blob/master/doc/script_commands.txt) to learn how to write NPCs.
2. Learn how to use Browedit  (http://browedit.excalibur-nw.com/)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 (http://imgur.com/yrQQwGt) and my current workstation and server (http://imgur.com/1hL0SXK).

[Added]
1. Learn about virtualization such as VMWare or HyperV.
2. Learn how to write a windows kernel driver to detect cheats and huehuehuehue.
Title: Re: TL;DR Server DevOps
Post by: yC 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.
Title: Re: TL;DR Server DevOps
Post by: Bue 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.

Title: Re: TL;DR Server DevOps
Post by: Duckshooter on Jun 15, 2017, 04:51 AM
Nerdie glasses make us look smart, ok? Mom AND grandma said so!
Title: Re: TL;DR Server DevOps
Post by: Yuzo 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!
Title: Re: TL;DR Server DevOps
Post by: mtil on Jun 15, 2017, 03:42 PM
Good list for the most part. Some things I'd adjust/add: