Jump to content
  • 0

CentOS7


Legacy

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  12/24/11
  • Last Seen:  

Hello rAthena!

 

It's been awhile since my last post here in rathena. I guess its almost 7 years xd and many things change. Can someone teach me how to set up the server in centos 7? I already bought 5$ droplet on Digital Ocean however I don't know to set it up.

"Why didn't you try to search here since its too many guide?"

- I tried it but its so hard for me to take all of it. I'm using Windows Server before right now I want to study Linux as Server Host. I don't have plan to start a server as of now I'm still studying making scripts.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  61
  • Reputation:   4
  • Joined:  12/29/14
  • Last Seen:  

Quote

Install on Centos

 
Jeybla edited this page on Nov 27, 2017 · 8 revisions

This guide covers how to install rAthena on CentOS and other versions of Linux that use yum.

Requirements

  • CentOS or an RPM-based Linux that has the 'yum' command
  • root access or access to an account that has sudo privileges
  • an Internet connection to download install packages

Prerequisites

All of these commands will be typed at the command-line interface.

Install Prerequisites

  • Login to your server via SSH, or if you are already logged into a GUI open a terminal window.
  • Unfortunately CentOS' original GCC package is outdated. It's needed to use the gcc version from the devtoolset repository to get an more up-to-date compiler:

sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc devtoolset-7-gcc-c++

You're able to use the gcc-7 compiler now by enabling the devtoolset: scl enable devtoolset-7 bash If you don't want to use this command every time before compiling, you can add the following to your ~/.bashrc or ~/.bash_profile: source scl_source enable devtoolset-7

sudo yum install mariadb mariadb-devel mariadb-server pcre-devel zlib-devel git

  • (Optional) type the following command to install some additional packages:

yum -y install dos2unix gdb nano screen unzip wget zip

Create a non-root Linux user

By the principle of least privilege, it is recommended you do NOT run rAthena as root. Type the following command to create a non-root Linux account:

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

--create-home = create the user's home directory

--shell = sets their login shell to Bash

rathena4444 = the login name of the new Linux account

4444 = pick your own random numbers to make the username more unique

  • Set a password for the new user (run this command and follow the prompts):

passwd rathena4444

Configure MySQL (MariaDB)

Note: MariaDB is a community-developed fork of the MySQL database management system. Therefore in the following section MySQL is equivalent to MariaDB and vice versa.

Set a root password

The default MySQL Server install creates a MySQL user 'root'@'localhost' with NO password. It is recommended you create a password for the root user.

  • Run MySQL Service:

systemctl start mariadb

  • Run this command and follow the prompts:

mysql_secure_installation

  • Login to your MySQL Server as root:
  • When prompted, enter your root MySQL password.

mysql -u root -p

  • Now your prompt should look like this (the MySQL command prompt):

Create SQL database for rAthena

  • At the MySQL prompt, type this to create a database (replace rathena4444 with the Linux username you created earlier):

mysql> CREATE DATABASE rathena4444_rag;

  • Create a separate database for logs:

mysql> CREATE DATABASE rathena4444_log;

Setup a MySQL user for rAthena

  • At the MySQL prompt, type something like this to create a new MySQL user:

CREATE USER 'rathena4444'@'localhost' IDENTIFIED BY 'secretpassword';

rathena4444 = the name of the MySQL user (we named it the same as the Linux user to make it easier to identify)

localhost = the hostname or IP it will connect from

secretpassword = the password for this MySQL user

mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON rathena4444\_rag.* TO 'rathena4444'@'localhost';

mysql> GRANT SELECT,INSERT ON rathena4444\_log.* TO 'rathena4444'@'localhost'; (note the escaped underscore)

Install rAthena

Login as your non-root Linux user

The rest of the setup is done as rathena4444 (the Linux user you created in step 2.2)

  • Logout from root SSH (or minimize the window).
  • Login to your server via SSH as the rathena4444 Linux user.

Cloning The Repository

You can obtain the latest version of rAthena by typing the following command. This will place rAthena in a folder called rAthena, but you are free to change it to whatever you like:

git clone https://github.com/rathena/rathena.git ~/rAthena

Import MySQL Tables

  • Change directory to the '''sql-files''' folder.

cd ~/rAthena/sql-files/

  • Execute these commands (when prompted, enter your MySQL root password):

Main structure and logs (important!):


mysql -u root -p rathena4444_rag < main.sql
mysql -u root -p rathena4444_log < logs.sql

The following are only needed, if you want to use the item and mob sql database:


mysql -u root -p rathena4444_rag < item_db.sql
mysql -u root -p rathena4444_rag < item_db2.sql
mysql -u root -p rathena4444_rag < mob_db.sql
mysql -u root -p rathena4444_rag < mob_db2.sql

NOTE: if you want to use different SQL DBs for login/char/map servers this is the list of databases each server use:

  • login-server: global_reg_value, ipbanlist, login, loginlog
  • map-server: mapreg, item_db, item_db2, mob_db, mob_db2
  • char-server: everything else + global_reg_value once again Note that global_reg_value tables are needed by both login-server and char-server (though it may be different tables)

Compile Source Code


cd ~/rAthena
./configure
make clean server

*If you're using CentOS 32-bit please use:

./configure --disable-64bit

How to Recompile

In the future (after you update or edit any file in /src) to recompile:


cd ~/rAthena
./configure # only needed when you change Makefiles
make clean # if you want to clean your current compilation
make server # rebuilds the whole server

Start your rAthena Server

  • Change access mode of athena-start file so that you can execute it.
  • Use (dos2unix athena-start) if you are getting ^M errors, ie. newline errors

chmod a+x athena-start

  • To Start

./athena-start start

  • To Stop

./athena-start stop

  • To Restart

./athena-start restart

or you can just see this link https://github.com/rathena/rathena/wiki/Install-on-Centos

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1511
  • Reputation:   227
  • Joined:  08/03/12
  • Last Seen:  

8 minutes ago, Legacy said:

Hello rAthena!

 

It's been awhile since my last post here in rathena. I guess its almost 7 years xd and many things change. Can someone teach me how to set up the server in centos 7? I already bought 5$ droplet on Digital Ocean however I don't know to set it up.

"Why didn't you try to search here since its too many guide?"

- I tried it but its so hard for me to take all of it. I'm using Windows Server before right now I want to study Linux as Server Host. I don't have plan to start a server as of now I'm still studying making scripts.

Read at README here https://github.com/rathena/rathena

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...