- 0
hosting Hercules on Google Cloud with CentOS 8
Asked by
AnnieRuru
-
Recently Browsing 0 members
No registered users viewing this page.
Asked by
AnnieRuru
No registered users viewing this page.
By using this site, you agree to our Terms of Use.
Over the last few days I have been playing with Google Cloud services
because Google cloud currently offers $300 free credit upon signing up
yes, FREE $300 credit
and thus my journey trying to host hercules server on a VPS has begun
all you need is a valid Debit/Credit card number ...
of course you have to be an adult to try the hosting service ... right ?
oh and, don't worry, you can always cancel it anytime
after playing with it, I found the Windows option is too expensive, and thus trying to learn the Linux option
This guide is actually demonstrate by using a trash gmail account that can throw away later
I don't mind all the credentials are shown in the screenshot, when I click the Open topic button I have deleted this project on Google Cloud
Step 1. Download Putty and WinCP
https://www.putty.org/.
https://winscp.net/eng/download.php
Step 2. Run Google Cloud
2.1 login to your Google cloud project
https://github.com/AnnieRuru/customs/blob/master/server hosting/2.png
2.2 first you need to link your credit card to this google cloud
https://github.com/AnnieRuru/customs/blob/master/server hosting/3.png.
https://github.com/AnnieRuru/customs/blob/master/server hosting/4.png
select the billing option to the debit/credit number you input earlier
https://github.com/AnnieRuru/customs/blob/master/server hosting/5.png
this billing information is very important, you need to check this once in a while to stop unwanted services <-- please scroll to the right
2.3 pin these 3
- billing
- compute engine
- VPC network
https://github.com/AnnieRuru/customs/blob/master/server hosting/6.png
2.4 now time to create a VPS, select Compute Engine
https://github.com/AnnieRuru/customs/blob/master/server hosting/7.png
2.4.1
enter all the necessary information
1. the Virtual machine name
2. your nearest location
3. the spec of the machine
https://github.com/AnnieRuru/customs/blob/master/server hosting/8.png
PS: I tested the cheapest option, N1 series, f1 micro 614MB memory and E2 micro, 1GB memory
when compiling hercules later, putty just stop ... I think it run out of memory
... hercules should have mention a recommendation needs at least 2GB memory to run
2.4.2
4. Select Boot Disk as CentOS 8
https://github.com/AnnieRuru/customs/blob/master/server hosting/9.png
5. select allow HTTP and HTTPS
https://github.com/AnnieRuru/customs/blob/master/server hosting/10.png
2.4.3
6. Click Security tab
https://github.com/AnnieRuru/customs/blob/master/server hosting/11.png
needs to 'Enter public SSH key'
run Putty Key Generator and click Generate
https://github.com/AnnieRuru/customs/blob/master/server hosting/12.png
1. change the 'key comment' as it will become user name
2. save private key to desktop
3. copy the field
https://github.com/AnnieRuru/customs/blob/master/server hosting/13.png
paste into Google cloud
https://github.com/AnnieRuru/customs/blob/master/server hosting/14.png
2.4.4
select Networking tab
https://github.com/AnnieRuru/customs/blob/master/server hosting/15.png
create a static IP address
https://github.com/AnnieRuru/customs/blob/master/server hosting/16.png
choose standard tier
after everything done click [Confirm]
https://github.com/AnnieRuru/customs/blob/master/server hosting/17.png
and you get your virtual machine running
https://github.com/AnnieRuru/customs/blob/master/server hosting/18.png
2.5
once your server up and running
run Putty to connect to this server
https://github.com/AnnieRuru/customs/blob/master/server hosting/19.png
1. scroll down, expand 'SSH' to select 'Auth',
2. then load the file you saved earlier by PuttyGen
https://github.com/AnnieRuru/customs/blob/master/server hosting/20.png
3. enter the public IP address,
4. then click open
https://github.com/AnnieRuru/customs/blob/master/server hosting/21.png
it will prompt you with security alert, just click yes
2.6
login with your user name
https://github.com/AnnieRuru/customs/blob/master/server hosting/22.png
The very first command you should run is change the password
ok Windows Users, don't freak out like me
there are no ******** when you input the password, this is Linux not Windows
just input normally ... and press Enter key, it works that way
https://github.com/AnnieRuru/customs/blob/master/server hosting/23.png
then do the same with your username
3. update the OS and install all necessary product
3.1 run all these commands
Press 'Y' key
3.2
in the meantime, while this might take awhile, try login WinCP
https://github.com/AnnieRuru/customs/blob/master/server hosting/24.png
click new session, then click advance
https://github.com/AnnieRuru/customs/blob/master/server hosting/25.png
select 'Authentication' and load the Putty Gen file again
https://github.com/AnnieRuru/customs/blob/master/server hosting/26.png
just another warning
https://github.com/AnnieRuru/customs/blob/master/server hosting/27.png
3.3 Download Hercules
4. SQL
4.1 Start SQL service
4.2 login as root
Enter password, just press enter
default centOS 8 preinstalled MySQL, root has no password
4.3 create database
4.4 select hercules database as default
4.5 create another user, not recommend to connect as root
4.6 grant this user privilege
4.7 then quit
quit
it should show like this
4.8 goto sql-files directory
and run all these
it should show like this
4.9 go back login mysql and change inter-server connection password from s1/p1 into qwer/asdf
mysql -u root -p
and
5. Compile Hercules
go back to annie/hercules folder
5.1 type ./configure
OK STOP, many things can go wrong here, I stuck here for a few days and searching on both rathena and hercules forum for answers
the correct output from putty should be this
if it doesn't show config.status: at the end, open a new topic in Linux support
if it's the same as mine, then can proceed with
5.2 compile hercules
make sql
finally compile should show like this
6. configure Hercules
6.1 start hercules by
https://github.com/AnnieRuru/customs/blob/master/server hosting/28.png
of course the reason why connect to SQL failed is because haven't configure Hercules so ....
stop it from running for a moment
6.2 login to WinCP
https://github.com/AnnieRuru/customs/blob/master/server hosting/29.png
... I will assume you know how to change your public IP address on hercules
the file you should change are
- userid: "qwer"
- passwd: "asdf"
- map_ip: "35.213.138.42"
- char_ip: "35.213.138.42"
- userid: "qwer"
- passwd: "asdf"
- login_ip: "35.213.138.42"
- char_ip: "35.213.138.42"
-db_hostname: "localhost"
- db_port: 3306
- db_username: "annie"
- db_password: "1234"
- db_database: "hercules"
.....<let me test this thing again> ....
<--- I will assume everyone reading this guide already know how to host an offline server, if not click here -->
now run ./athena-start start again, and this time map-server couldn't connect to char-server
7. Configure firewall
7.1 run these 3 commands
7.2 reload the firewall settings
7.3 go back to Google Cloud,
https://github.com/AnnieRuru/customs/blob/master/server hosting/30.png
to create firewall
https://github.com/AnnieRuru/customs/blob/master/server hosting/31.png
configure the firewall
https://github.com/AnnieRuru/customs/blob/master/server hosting/32.png
2. & 3. configure firewall only to this project
https://github.com/AnnieRuru/customs/blob/master/server hosting/33.png
4. at 'tcp:' tab, only allow these 3 ports
https://github.com/AnnieRuru/customs/blob/master/server hosting/34.png
7.4
run ./athena-start start again.
then goto https://portchecker.co/ and check your port is open
https://github.com/AnnieRuru/customs/blob/master/server hosting/35.png
And Finally go to your client edit data/sclientinfo.xml to the WAN IP and
VIOLA !! DONE !!
I can connect my client to google cloud
PS: the port checker website only shows Port 6900 is OPEN. only if fulfill these 3 conditions
1. enable firewall setting on CentOS
2. enable firewall setting on Google Cloud
3. run the emulator by ./athena-start
Ok now you can start worry about security issue like adding additional user in CentOS
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-a-centos-7-servergoogle cloud doesn't seem to allow login that way -> https://stackoverflow.com/questions/52503453/how-to-login-gcp-console-without-ssh
and mysql root account password change ...
etc...etc...
need more research
Connect to MySQL in CentOS 8 using Window's MySQL Workbench
1. add another connection
https://github.com/AnnieRuru/customs/blob/master/server hosting/mysql1.png
2. under 'Connection Method', select 'Standard TCP/IP over SSH'
https://github.com/AnnieRuru/customs/blob/master/server hosting/mysql2.png
3. configure these fields
3.1 SSH hostname is the server IP address
3.2 SSH username is the name you created with PuttyGen
3.3 SSH keyfile needs a conversion with PuttyGen
3.4 and Click [Test Connection]
https://github.com/AnnieRuru/customs/blob/master/server hosting/mysql3.png
4. the SSH keyfile needs to be convert from PuttyGen
4.1 load existing private key, in this case was 'annie.ppk'
4.2 click conversion and save as 'annie' without file extension
https://github.com/AnnieRuru/customs/blob/master/server hosting/mysql4.png
5. if successful it will show like this
https://github.com/AnnieRuru/customs/blob/master/server hosting/mysql5.png
then you can login into MySQL in CentOS
did I forgot to mention needs to open the port 3306 in CentOS and Google Cloud ? refer back to step 7
Reference: https://stackoverflow.com/questions/21527743/mysql-workbench-version-6-0-8-ssh-authentication-issue
After thought :
Overall I'm very satisfy with Google Cloud service,
1. free $300 credit to spend
2. can always register trash gmail account to make the credit infinite
- of course the IP will always change if you do so
3. very low latency from Malaysia connect to Singapore - just 30~40ms ping
I haven't try OVH which everybody is recommending, but they doesn't offer immediate free credit for me to test so meh .....
and I notice Hercules's wiki CentOS guide is broken, maybe I'll fix it
https://github.com/HerculesWS/Hercules/wiki/Installation-(CentOS)
- offtopic -
over last few days playing with google cloud, when I visit Youtube, all my advertisement become Monday.com etc etc group project stuffs
google really knows how to collect my data
Edited by AnnieRuruShare this post
Link to post
Share on other sites