Jump to content
  • 0

Setting up a CentOS VPS w/ rATHENA & VNC


Matrixfox

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  277
  • Reputation:   76
  • Joined:  11/23/11
  • Last Seen:  

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', 'me@localhost', 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

Recommended Posts


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   4
  • Joined:  06/07/13
  • Last Seen:  

i did sir Asura,

 

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

 

[root@admin ~]# /sbin/service vncserver status
Xvnc (pid 2823) is running...
[root@admin ~]#
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...