Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Create a Ragnarok Server - CentOS

Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
Okay in this guide I will teach you how to setup a Ragnarok Server using a CentOS.

You will need the following
WinSCP on your local PC
Putty on your local PC
Subversion
MySQL 5
phpMyAdmin

Installing necessary packages to create a server
Step 1
Assuming you already got a CentOS VPS or Dedicated Server with root access, download

Open putty and connect to your VPS/Dedicated Server using root account. Since it's a freshly ordered VPS/Dedi, you need to install the necessary tools to make a server.

Step 2
Installing subversion
Execute this command in putty
Code:
yum install subversion
then it will ask you something like "Is this Ok? (y/N)" type in y then hit enter and it will download and install subversion.

Step 3
Installing compilers for you to be able to compile the source of the server
Execute this command in putty
Code:
yum install gcc
yum install gcc-c++

Step 4
Installing php packages :)
Execute this command
Code:
sudo yum -y install php-cli php-gd php-mbstring php-mcrypt php-mhash php-mysql php-pdo php-xmlrpc

Step 5
Installing MySQL
Execute this command
Code:
yum install mysql-server mysql-devel

Step 6
Before anything else, you need to configure mysql's root password
To setup root password for the first time, execute this command:
Code:
mysqladmin -u root password NEWPASSWORD

Changing the root password, execute this command:
Code:
mysqladmin -u root -p'oldpassword' password newpass

Step 7
Installing phpMyAdmin
Assuming your VPS/Dedi already have apache (almost all hosting company installs apache by default), navigate to your html folder.

Assuming you are currently on root folder since you are logged in as root account
run this command to navigate to html folder
Code:
cd ../var/www/html
then download phpMyAdmin package from the official site by using wget command

I won't go into detailed installation on phpMyAdmin.. You can visit this .

Installation of all packages are done! Now we go into configuring the files.

Server Configuration

Step 1
Checking out server files on the official repository server! Using a pre-compiled server files just stops you from learning the process, I highly recommend checking out fresh files, since you don't know what's inside the files :)
Let's first add a new user since using root account in everything you do is risky!

Create an account and make the directory for the user.
execute this command:
Code:
useradd -d /home/username -s /bin/bash -c "Name FamilyName" username
replace username by your own username

example:
Code:
useradd -d /home/tribalist -s /bin/bash -c "Tribalist Surname" tribalist
the command above will create a directory inside the home folder and will also create the user tribalist
now let's give the ownership to /hom/tribalist directory to tribalist user
Code:
chown username /home/tribalist && passwd tribalist
the command above will add the ownership rights on the /home/tribalist directory and create a password for the user tribalist

after creating a new user, you might want to give proper permissions to the user, or add it on the root group, or prolly add the user to the sudoers group. You may search google on that :)

Step 2
Since we already have the new user to access SSH, logout on your root account and login using the new user you have just made a while ago. We will now check out the server files.
Assuming you are already logged in as the new user, for this example I will use tribalist as the new user.

Execute the following command:
Code:
cd ..
This will change one directory backward, then type
Code:
ls
this will show that you have a tribalist directory, now navigate back to the tribalist directory using:
Code:
cd tribalist

Let's proceed with the checkout, execute this command on putty:
Code:
svn co http://eathena-project.googlecode.com/svn/trunk/
I am assuming here that you already know how to use svn related commands, in the example above, you will checkout the HEAD Revision (Latest Revision) of the server files that is on the trunk branch, the command will create trunk directory inside the tribalist directory and will download the server files there.

You can also checkout by this way
Code:
svn co http://eathena-project.googlecode.com/svn/trunk/ serverfiles
this will checkout the files inside the "serverfiles" directory instead of the default trunk directory.

Wait for the checkout to finish.

Step 3
Now that we already got our server files, let's now move to configuring the IP and MySQL :)
Installation of WinSCP on your local windows PC!
-Download WinSCP from
-Install it and open WinSCP

Now that you have finally installed WinSCP, login to your server using WinSCP with your tribalist user!
-Navigate to the server files, and open conf folder.
-Inside that folder, open char_athena.conf and do the following

1. Create your Server Communication username and password.
Default:
Code:
userid: s1
passwd: p1
Change it to:
Code:
userid: serverusername
passwd: serverpassword
NOTE: change serverusername and serverpassword to your own!

Change this
Code:
//login_ip: 127.0.0.1
to this
Code:
login_ip: YOUR.WAN.IP.HERE

Change this
Code:
//char_ip: 127.0.0.1
to this
Code:
char_ip: YOUR.WAN.IP.HERE

Now save and close char_athena.conf and open login_athena.conf

Find..
Code:
new_account: yes
Change to
Code:
new_account: no
save and close login_athena.conf and open map_athena.conf

Find..
Code:
userid: s1
passwd: p1
Change to the same serverusername and serverpassword you made on char_athena.conf

Find..
Code:
//char_ip: 127.0.0.1
Change to..
Code:
char_ip: YOUR.WAN.IP.HERE

Find..
Code:
//map_ip: 127.0.0.1
Change to..
Code:
map_ip: YOUR.WAN.IP.HERE
Save and close map_athena.conf!

Step 4
Now that we have configured the server IP and username and passwords, we should now configure the SQL Databases for our server :)
Assuming you are done installing phpMyAdmin, login to your phpMyAdmin using root mysql user!

Assuming again you know how to create and add user on phpmyadmin (If you don't know how to, search google!), create your ragnarok main and log database.
NOTE: Do not use "ragnarok" as your database name! It's very common and is risky!

You should create two databases, one for main and one for logs.

Now create a new mysql user and then add proper database permissions for that user to the main and log database.
NOTE: For testing purposes, grant all permissions first if this is your first time creating a ragnarok server.

NOTE: You should have a copy of main.sql and log.sql on your local PC. These files can be found in the sql-files folder on your server files, just copy it on your local PC using WinSCP :)
Now select your main database, from the menu in phpMyAdmin, click SQL, and then import, browse your main.sql and then import it, it will create the tables on your main database.

Now select your log database and then import log.sql and it should create tables for your log database.

-Changing default s1/p1 server username and password-
Select your main database and execute this query
Code:
SELECT * FROM `login`;
Since this is a new server, you should only have 1 result and that is the default server username and password which is s1/p1, now edit that and change it to the serverusername and serverpassword you have created on char_athena.conf earlier! Then save!

Now Go back to your WinSCP and open conf/inter_athena.conf

Find..
Code:
// 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: 127.0.0.1
sql.db_port: 3306
sql.db_username: ragnarok
sql.db_password: ragnarok
sql.db_database: ragnarok
sql.codepage:

// MySQL Character SQL server
char_server_ip: 127.0.0.1
char_server_port: 3306
char_server_id: ragnarok
char_server_pw: ragnarok
char_server_db: ragnarok

// MySQL Map SQL Server
map_server_ip: 127.0.0.1
map_server_port: 3306
map_server_id: ragnarok
map_server_pw: ragnarok
map_server_db: ragnarok

// MySQL Log SQL Database
log_db_ip: 127.0.0.1
log_db_port: 3306
log_db_id: ragnarok
log_db_pw: ragnarok
log_db_db: log
log_codepage:
Edit the necessary settings, IP should be your WAN IP, leave the port at 3306, id and password should be the one you created on phpmyadmin :) server_db should be the main database name, and for log_db_db is the log database name!

Step 5
Now that everything is set, we should now configure our server so that we can start it :) yey!
Let's go back to putty, login using your tribalist username!

Navigate to your server files directory (for this example we let's assume that the server files directory is called trunk
Code:
cd trunk
Now Let's compile it!
Execute this command:
Code:
./configure
and then..
Code:
make clean && make sql

NOTE: If you are getting "Permission Denied" on executing ./configure command, do this
Code:
cd ..
and then
Code:
chmod +x trunk
then..
Code:
cd trunk
and then try compiling! It should compile!

Now that we have compiled the server it's time to start it!
Execute this command:
Code:
./athena-start start

and it should work! You can now connect on your server! Congratulations!

NOTE: When exiting on putty, do not press CTRL+C as it will terminate the map-server and will stop you from connecting to your server, instead, press CTRL+A+D :)

I will create another tutorial on how to make your own CLEAN Executable Client to connect on your server :)


If you have any questions, please do not hesitate to post!


-Tribalist
 
Last edited:
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
Try it? I wrote this while configuring my test server.
 
Last edited:
Joined
Feb 16, 2010
Messages
1
Reaction score
0
Hello Tribalist, thank you for sharing the information in such self explanatory manner. Well i am stuck at a point.. I cant understand how shall i download Rag Client files on Server and how shall i update them and after that i might also have 2-3 more questions.
Thank you.. waiting for response
 
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
Sorry for a late reply, kinda busy with stuffs going on.

You don't need to download Rag Client files on the host. You only need client files on your own pc so you can play.
 
Initiate Mage
Joined
Mar 25, 2010
Messages
1
Reaction score
0
there is a error qhen i try to make

make sql
MySQL not found or disabled by the configure script
make: *** [needs_mysql] Error 1


i typed ./configure and i maked all that configurations above.

is some one can help me my msn is suporte@targetzdigital.com

tanks
 
Newbie Spellweaver
Joined
Aug 14, 2009
Messages
67
Reaction score
2
Since it is Cent0s.. you can set your wanIP into a localhost which is 127.0.0.1 instead of wanIP...

Note: You forgot this command

chmod a+x login-server_sql && chmod a+x char-server_sql && chmod a+x map-server_sql

which is to get an permision to run the server.. ^_^


And if you do recompile on your server just do it the same way..

chmod a+x configure && chmod a+x athena-start
./configure
make sql
make plugins
chmod a+x login-server_sql && chmod a+x char-server_sql && chmod a+x map-server_sql


---------- Post added at 12:00 PM ---------- Previous post was at 11:59 AM ----------

there is a error qhen i try to make

make sql
MySQL not found or disabled by the configure script
make: *** [needs_mysql] Error 1


i typed ./configure and i maked all that configurations above.

is some one can help me my msn is suporte@targetzdigital.com

tanks


You can put this command

make clean
 
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
I only use chmod +x configure and chmod +x athena-start

Besides, they should'nt have CentOS as a primary OS for their server if they don't even know simple nix commands. :p

@jasar,
make sure you run your SQL Server first.
You can use:
Code:
service mysqld start
service mysqld stop
service mysqld restart

or

for Debian
Code:
/etc/init.d/mysql start
/etc/init.d/mysql stop
/etc/init.d/mysql restart
 
Last edited:
Newbie Spellweaver
Joined
Jun 20, 2009
Messages
44
Reaction score
0
Hello guys ! I have my problem here.
I get error message when i type this command : mysqladmin -u root password.
i changed the root to 'myhostname' in order to get it work but the error still appears. its kinda different.
01 - Create a Ragnarok Server - CentOS - RaGEZONE Forums

Someone please help me !
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
should be
Code:
mysql -uroot -pUrPassword101

You should use the password you set during the MYSQL setup for root account.
 
Newbie Spellweaver
Joined
Jun 20, 2009
Messages
44
Reaction score
0
should be
Code:
mysql -uroot -pUrPassword101

You should use the password you set during the MYSQL setup for root account.

I dont understand. I have to configure mysql root password when I reach step 5 right ?
So I run this command that you wrote there :mysqladmin -u root password "newpassword"
But then, I received a error that says :
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

Then I edit the syntax to mysqladmin -u dantan password dantan1995, and mysqladmin -u root@IP and localhost --password dantan1995 and run it.
mysqladmin: Can't turn off logging; error: 'Access denied; you need the SUPER privilege for this operation'

What is the problem ? I didnt do anything to mysql after I installed it. there should be no password and username at all.
 
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
When setting up the mysql server, you should also setup the root password. Else you won't be able to connect.

When you're done with STEP 5, start the mysql server by issuing
'service mysql start' command.

Then
issue
Code:
mysqladmin -u root password NEWPASSWORD
 
Newbie Spellweaver
Joined
Jun 20, 2009
Messages
44
Reaction score
0
When setting up the mysql server, you should also setup the root password. Else you won't be able to connect.

When you're done with STEP 5, start the mysql server by issuing
'service mysql start' command.

Then
issue
Code:
mysqladmin -u root password NEWPASSWORD

The error appears when I issue
Code:
mysqladmin -u root password 123456

do i have to change 'root' to any others word ? like the name 'root@dt' ? and also the word 'password' after the word 'root' should i change it ? or remain the same ?
 
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
Nope you don't have to change it, root should be able to connect since it is hosted locally 'localhost'. Check your my.cnf from /etc/my.cnf and check what's the value of bind-address
 
Newbie Spellweaver
Joined
Jun 20, 2009
Messages
44
Reaction score
0
Nope you don't have to change it, root should be able to connect since it is hosted locally 'localhost'. Check your my.cnf from /etc/my.cnf and check what's the value of bind-address

bind address ?
Code:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
~
~
~
~
~
~
~
~
"my.cnf" 15L, 441C

where is it ?

do you have msn ? or facebook ? it's faster using msn or facebook to communicate. I'm sick. I mean I got fever right now, can't really sit in front of the monitor whole day.
 
Newbie Spellweaver
Joined
Mar 1, 2011
Messages
94
Reaction score
25
I suggest re-setup your mysql server,
remove it through
Code:
rpm -e --justdb mysql-server mysql mysql-devel

then
Code:
yum install mysql-server mysql mysql-devel

then
Code:
service mysqld start

then
Code:
mysqladmin -u root password NEWPASSWORD

Also, I don't provide MSN/YM or any other IM support, you can contact me through PM here or just wait for me to reply on your thread :) I'm always online if I'm not busy with some random stuffs.
 
Back
Top