rAthena Installation ( CentOS )



Installation (CentOS)


Requirements


Prerequisites

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

INSTALL PREREQUISITES

  1. Login to your server via SSH, or if you are already logged into a GUI press Ctrl+Alt+T to open a terminal window.
  2. Type the following command (this will install GCC, Make, MySQL, MySQL header files, MySQL Server, PCRE header files, Subversion, and Zlib header files)
    yum -y install gcc make mysql mysql-devel mysql-server pcre-devel subversion zlib-devel
  3. (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.
  1. 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
  2. Set a password for the new user (run this command and follow the prompts):
    passwd rathena4444

CONFIGURE MYSQL

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.
  1. Run this command and follow the prompts:
    mysql_secure_installation
  2. Login to your MySQL Server as root:
    When prompted, enter your root MySQL password.
    mysql --user=root -p
  3. Now your prompt should look like this (the MySQL command prompt):
    mysql>
    In case your mysql server isn’t started, you may have to start it with:
    /etc/init.d/mysqld start

Create SQL database for rAthena

  1. At the MySQL prompt, type this to create a database (replace rathena4444 with the Linux username you created earlier):
    mysql> CREATE DATABASE rathena4444_rag;
  2. Create a separate database for logs:
    mysql> CREATE DATABASE rathena4444_log;

Setup a MySQL user for rAthena

  1. At the MySQL prompt, type something like this to create a new MySQL user:
    mysql> 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
  2. Grant privileges to the ‘rathena’ 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)
  1. Logout from root SSH (or minimize the window).
  2. Login to your server via SSH as the rathena4444 Linux user.

SVN CHECKOUT

Use the following command, replacing ~/trunk with a directory you want to checkout rAthena files to:
 svn checkout https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/ ~/trunk

IMPORT MYSQL TABLES

  1. Change directory to the sql-files folder.
    cd trunk/sql-files/
  2. Execute these commands:
    When prompted, enter your MySQL root password.
    mysql --user=root -p rathena4444_rag < main.sql
    mysql --user=root -p rathena4444_rag < item_db.sql
    mysql --user=root -p rathena4444_rag < item_db2.sql
    mysql --user=root -p rathena4444_rag < mob_db.sql
    mysql --user=root -p rathena4444_rag < mob_db2.sql
    mysql -u root -p rathena4444_log < logs.sql

CONFIGURE RATHENA

COMPILE SOURCE CODE

cd trunk
./configure
make sql
  • If you’re using CentOS 64-bit please use:
./configure --enable-64bit
How to Recompile
In the future (after you update or edit any file in /src) to recompile, add make clean before make sql:
cd trunk
./configure
make clean
make sql

Start your rAthena Server

//change access mode of athena-start file so that you can execute it.
//Use (dos2unix athena-start) if yo uare 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
Powered by Blogger.

Search This Blog