Jump to content
  • 0
Matrixfox

Setting up a CentOS VPS w/ rATHENA & VNC

Question

I often get messages asking how I setup a Linux VPS & VNC with rATHENA. Whell, This is how I did it on CentOS. You can do this method on any clean Linux VPS host with no cPanel or other programs that require disabling of the GUI environments. This guide is intent to help a individual get started on his/her's VPS, hope this helps. This is done with 100% ssh bash commands. VNC is just there to help you if needed to see something visualy.

This process might seem a little intimidating at first, don't let it be. In no time at all you can have your VPS rocking in Linux. No reason nowadays you can't google your questions and, answers. Take your time, double read everything. Let's get started /hmm

_____________________________________________________________________________

VPS Requirements

//You need at least 512mb of ram, however I suggest 1gig if you're doing all of this.

//Also running your VNC will seriously drain your resources. My server will cap at 99.7% CPU speed. So beware of the over speed issues.

_____________________________________________________________________________

Installing & Configuring VNC

//You can start by installing Gnome Environment and VNC.

yum -y groupinstall "GNOME Desktop Environment"

yum -y install vnc-server

//Use Nano to edit /etc/sysconfig/vncservers

nano /etc/sysconfig/vncservers

//Remove the # in front of these syntax. Change the user name and geometry.

VNCSERVERS="1:matrixfox8"

VNCSERVERARGS[1]="-geometry 1024x768 -localhost"

//Create a none root Linux account with out Super User commands. Also make a very strong password.

useradd matrixfox8

passwd matrixfox8

//After "passwd yourusername" it will prompt you for Unix password.

TIP: You can also stop here and go straight to installing the basis of rathena and mysql. Them come back here later.

// DO NOT RUN AS ROOT!!! NEVER, NEVER, FOR THE LOVE OF GOD, NEVER RUN AS ROOT!!!!!!!!!!!!!

//After starting and killing the processes, it will create a xstartup file for that account.

vncserver :2

//In the middle of this you will be prompt to setup a VNC password.

vncserver -kill :2

//Edit your xstartup with Nano

nano ~/.vnc/xstartup

//Remove the # in front of unset, exec. Then add and edit these two following lines.

#!/bin/sh

(while true ; do xterm ; done ) &

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER

exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] & exec /etc/vnc/xstartup

[ -r $HOME/.Xresources ] & xrdb $HOME/.Xresources

xsetroot -solid grey

vncconfig -iconic &

xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

gnome-session &

TIP: Make sure you press enter at the very end of nano, leaving a blank syntax line..

//Start VNC n' get ready to log in.

vncserver :2

//Now open your VNC client and log in as your ip, remember the :2 for the port number at the end of the IP.

192.168.1.100:2

//VNC Super User Commands

/sbin/service vncserver start
/sbin/service vncserver stop
/sbin/chkconfig vncserver on

_____________________________________________________________________________

Installing rATHENA on CentOS

//Make sure your back in your Super User account, aka Root.

yum -y install gcc make mysql mysql-devel mysql-server pcre-devel subversion zlib-devel

yum -y install dos2unix gdb nano screen unzip wget zip

//If you already made an account for VNC ignore this step! Skip to configuring MySQL.

useradd --create-home --shell /bin/bash matrixfox8

passwd matrixfox8

_____________________________________________________________________________

Configuring MySQL

TIP: Use a program to generate a random password "like LassPass". Keep it in between 12 characteristics for SQL names & passwords "unless you edit it".

//You might need to run a mysqld restart before setting up a secure installation.

service mysqld restart

//There will be several screens. Setup your root MySQL password and, take your sweet time, double, reading, EVERYTHING!

//For the most part just push "y".

mysql_secure_installation

//Log in as your Root Super User.

mysql --user=root -p

//Notice your command hand changes to

mysql>

//Rename and create your own databases. Make sure your MySQL code ends with ;

CREATE DATABASE rathena_rag;

CREATE DATABASE rathena_log;

//Now this is where it gets a tad confusing. Just replace your VPS IP and name from mine. Also come up with a different password...

//Keep in mind this is the same information you will be placing in "inter_athena.conf" & "subnet_athena.conf".

CREATE USER 'matrixfox8'@'192.168.1.100' IDENTIFIED BY 'secretpassword';

GRANT SELECT,INSERT,UPDATE,DELETE ON `rathena_rag`.* TO 'matrixfox8'@'192.168.1.100';

GRANT SELECT,INSERT ON `rathena_log`.* TO 'matrixfox8'@'192.168.1.100';

_____________________________________________________________________________

Installing rATHENA

//Minimize your MySQL root SSH. Then log in as your lower account SSH to install rATHENA.

svn checkout https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/ ~/trunk

//If you wish to delete a older svn in SSH. Type this command with the correct directory name.

rm -rf "dir name"

//Navigate to your SQL files and get ready for extracting.

cd trunk/sql-files/

//You will be prompt for your MySQL password each time.

mysql --user=root -p rathena_rag < main.sql

mysql --user=root -p rathena_rag < item_db.sql

mysql --user=root -p rathena_rag < item_db2.sql

mysql --user=root -p rathena_rag < mob_db.sql

mysql --user=root -p rathena_rag < mob_db2.sql

mysql -u root -p rathena_log < logs.sql

//Now it's time to compile into SQL.

cd ~

cd trunk

./configure

make sql

//Log in as your MySQL root user for the following commands.

//Editing s1/p1 in MySQL. This is where you edit the info for "char_athena.conf" & "map_athena.conf".

USE rathena_rag;

SELECT * FROM `login` where account_id='1';

UPDATE `login` SET userid='desiredusername', user_pass='desiredpassword' WHERE account_id='1';

//Adding a new account in MySQL

USE rathena_rag;

INSERT INTO login (account_id, userid, user_pass, sex, email, group_id) VALUES (2000000, 'myname', 'mypass', 'F', '[email protected]', 99);

_____________________________________________________________________________

Editing rATHENA Files

//Log back in as your User account, exit out of root.

//There are many ways of doing this processes, different strokes for different folks. We're just using nano to keep things simple for this guide.

nano trunk/conf/char_athena.conf

// Server Communication username and password.

userid: desiredusername

passwd: desiredpassword

// Login Server IP

// The character server connects to the login server using this IP address.

// NOTE: This is useful when you are running behind a firewall or are on

// a machine with multiple interfaces.

login_ip: 192.168.1.100

// Character Server IP

// The IP address which clients will use to connect.

// Set this to what your server's public IP address is.

char_ip: 192.168.1.100

nano trunk/conf/map_athena.conf

// Interserver communication passwords, set in account.txt (or equiv.)

userid: desiredusername

passwd: desiredpassword

// Character Server IP

// The map server connects to the character server using this IP address.

// NOTE: This is useful when you are running behind a firewall or are on

// a machine with multiple interfaces.

char_ip: 192.168.1.100

// Map Server IP

// The IP address which clients will use to connect.

// Set this to what your server's public IP address is.

map_ip: 192.168.1.100

nano trunk/conf/inter_athena.conf

// Global SQL settings

// overriden by local settings when the hostname is defined there

// (currently only the login-server reads/obeys these settings)

sql.db_hostname: 192.168.1.100

sql.db_port: 3306

sql.db_username: matrixfox8

sql.db_password: secretpassword

sql.db_database: rathena_rag

sql.codepage:

// MySQL Character SQL server

char_server_ip: 192.168.1.100

char_server_port: 3306

char_server_id: matrixfox8

char_server_pw: secretpassword

char_server_db: rathena_rag

// MySQL Map SQL Server

map_server_ip: 192.168.1.100

map_server_port: 3306

map_server_id: matrixfox8

map_server_pw: secretpassword

map_server_db: rathena_rag

// MySQL Log SQL Database

log_db_ip: 192.168.1.100

log_db_port: 3306

log_db_id: matrixfox8

log_db_pw: secretpassword

log_db_db: rathena_log

log_codepage:

log_login_db: loginlog

nano trunk/conf/subnet_athena.conf

subnet: 255.0.0.0:192.168.1.100:192.168.1.100

How to start your server in SSH.

cd ~

cd trunk

./athena-start start

./athena-start stop

Now everything should be configured and working, Congratulations! One more thing! There is a lot to know about security. You might want to learn more to make your sever at least 60% safe. Hyperlink

P.S. Please keep in mind, make your own thread for support, or drop me a PM on the rA board.

If I get enough +1's I'll make a video.

Edited by matrixfox
  • Upvote 8
Link to comment
Share on other sites

25 answers to this question

Recommended Posts

Well-detailed guide for newbies. Great tutorial @Matrixfox !

+1 up

Hope mods pinned this kind of guide.

Edited by Jezu
Link to comment
Share on other sites

Hi Matrixfox,

Nice guide, very detailed; but I think you should offer other desktop environments such as XFCE, LXDE, KDE, or even the bare minimums like Fluxbox. I only suggest this cause those environments may allow a 512mb VPS to work side-by-side with a MySQL server and rAthena running, without having any insufficient memory issues.

  • Upvote 2
Link to comment
Share on other sites

Thanks, very nice suggetions! I have yet to have experience with XFCE, LXDE and Fluxbox.

I actually got inspired by one of your videos on YouTube, and I really liked idea of it. I got a ton of ideas from this.

Also, I really don't recommend running environments on a VPS at all really. The key factor of security and memory loss on a low budget server, like we're talking about.

Link to comment
Share on other sites

hey matrixfox.. great guide.. but i have a problem here.. using CentOS 5.8. i'm doing ur guide from putty console.. and i start from this line > Installing rATHENA on CentOS since already got VNC from my VPS control panel.. i got some problem here

[sql]: Access denied for user 'onizame2823'@'localhost' (using password: YES)
[Debug]: at loginlog_sql.c:110
[info]: Connect Character DB server.... (Character Server)
[sql]: Access denied for user 'onizame2823'@'localhost' (using password: YES)
[Debug]: at inter.c:780
[info]: Connecting to the Map DB Server....
[sql]: Access denied for user 'onizame2823'@'localhost' (using password: YES)

would u kindly help :( i've been reinstalling my VPS like 6 times alrdy /panic and can u add guide for install phpmyadmin too.. since i keep failing on that part too /panic

Link to comment
Share on other sites

You skipped mysql setup?

That error means the user don't have any privileges..

:) Configure your sql first...

the GRANT thing right? i alrdy do it /panic why still error /omg

Link to comment
Share on other sites

what's your inter_athena.conf?

Why not try changing the IP address there from localhost to the IP address of your machine.. :)

  • Upvote 1
Link to comment
Share on other sites

what's your inter_athena.conf?

Why not try changing the IP address there from localhost to the IP address of your machine.. :)

wooww its working thx wakoko321 ! :D should edit the IP on inter_athena.conf /no1

now my client autoclose when i open it /panic i already diff it.. and the clientinfo.xml already server IP.. /panic using..2011-03-15aRagexeRE already edit the packetver thingy too /hum

Link to comment
Share on other sites

I did exactly the same, but i got the error after use: ./athena-start start

[Error]: make_listen_bind: bind failed (socket #5, error 98: Address already in use)!
[info]: Attempt to connect to login-server...
[status]: Connecting to 142.4.212.62:6900
[Error]: Unknown packet 0x006a received from login-server, disconnecting.
[Warning]: Connection to Login Server lost.

[Warning]: connect_check: DDoS Attack detected from 142.4.212.62!
[info]: Attempt to connect to login-server...
[status]: Connecting to 142.4.212.62:6900
[Error]: Unknown packet 0x006a received from login-server, disconnecting.
[Warning]: Connection to Login Server lost.

[info]: Attempt to connect to login-server...
[status]: Connecting to 142.4.212.62:6900
[Error]: Unknown packet 0x006a received from login-server, disconnecting.
[Warning]: Connection to Login Server lost.

loop attempt to connect to login-server...

How could i fix it, please?

Thank you!

Edited by diegobh
Link to comment
Share on other sites

after trying to follow the vnc installation guide.. and set all.. it works but

when i tried to reboot my vps and connect again using vnc.. it doesnt work it gives me connection refused

Link to comment
Share on other sites

after trying to follow the vnc installation guide.. and set all.. it works but

when i tried to reboot my vps and connect again using vnc.. it doesnt work it gives me connection refused

Hi BugsLIFE,

Perhaps you did not set it up to run on startup; type the VNCserver command to start it back up within the SSH/Terminal.

vncserver :PORT
Link to comment
Share on other sites

i did sir Asura,

 

after rebooting the vps.. i see the vnc~user is running... i tried to run this

 

[[email protected] ~]# /sbin/service vncserver status
Xvnc (pid 2823) is running...
[[email protected] ~]#
Xvnc (pid 2823) is running...  means = VNCSERVER:2 right?

 

but when i tried to connect on it using vnc viewer... i get connection refused 100061

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.