- Installation (CentOS)
- Contents
- Requirements
- Prerequisites
- Install Prerequisites
- Create a non-root Linux user
- Configure MySQL
- Set a root password
- Create SQL database for Hercules
- Setup a MySQL user for Hercules
- Install Hercules
- Login as your non-root Linux user
- Git Clone
- Import MySQL Tables
- Configure Hercules
- Compile Source Code
- Start your Hercules Server
- See Also
Installation (CentOS)
This guide covers how to install Hercules on CentOS and other versions of Linux that use yum.
Contents
- 1 Requirements
- 2 Prerequisites
- 2.1 Install Prerequisites
- 2.2 Create a non-root Linux user
- 2.3 Configure MySQL
- 2.3.1 Set a root password
- 2.3.2 Create SQL database for Hercules
- 2.3.3 Setup a MySQL user for Hercules
- 3.1 Login as your non-root Linux user
- 3.2 Git Clone
- 3.3 Import MySQL Tables
- 3.4 Configure Hercules
- 3.5 Compile Source Code
- 3.5.1 How to Recompile
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 press Ctrl+Alt+T to open a terminal window.
- Type the following command (this will install GCC, Make, MySQL, MySQL header files, MySQL Server, PCRE header files, Git, and Zlib header files)
yum install gcc make mysql mysql-devel mysql-server pcre-devel git zlib-devel
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 Hercules as root.
- Type the following command to create a non-root Linux account:
useradd --create-home --shell /bin/bash hercules1234
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.
- Run this command and follow the prompts: Firest Start MySQL:
mysql_secure_installation
Create SQL database for Hercules
- At the MySQL prompt, type this to create a database (replace hercules1234 with the Linux username you created earlier):
mysql> CREATE DATABASE hercules1234_rag;
mysql> CREATE DATABASE hercules1234_log;
Setup a MySQL user for Hercules
mysql> CREATE USER 'hercules1234'@'localhost' IDENTIFIED BY 'secretpassword';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON `hercules1234\_rag`.* TO 'hercules1234'@'localhost';
mysql> GRANT SELECT,INSERT ON `hercules1234\_log`.* TO 'hercules1234'@'localhost';
Install Hercules
Login as your non-root Linux user
The rest of the setup is done as hercules1234 (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 hercules1234 Linux user.
Git Clone
Type the following to create a Hercules working copy in your home (~) directory
Import MySQL Tables
mysql -u root -prootpassword hercuser_rodb < main.sql
mysql -u root -prootpassword hercuser_rodblog < logs.sql
mysql -u root -prootpassword hercuser_rodb < item_db.sql
mysql -u root -prootpassword hercuser_rodb < mob_db.sql
mysql -u root -prootpassword hercuser_rodb < mob_skill_db.sql
mysql -u root -prootpassword hercuser_rodb < item_db_re.sql
mysql -u root -prootpassword hercuser_rodb < mob_db_re.sql
mysql -u root -prootpassword hercuser_rodb < mob_skill_db_re.sql
mysql -u root -prootpassword hercuser_rodb < item_db2.sql
mysql -u root -prootpassword hercuser_rodb < mob_db2.sql
mysql -u root -prootpassword hercuser_rodb < mob_skill_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_acc_reg_num_db, global_acc_reg_str_db, ipbanlist, login, loginlog
- map-server: autotrade_data, autotrade_merchants, mapreg, npc_market_data
- char-server: everything else
Note that the sql_updates table is needed by all three servers.
Configure Hercules
Compile Source Code
cd Hercules ./configure make sql
How to Recompile
In the future (after you update or edit any file in /src) to recompile, add make clean before make sql:
cd Hercules ./configure make clean make sql
Start your Hercules 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
See Also