This guide covers how to install [Hercules] on wikipedia:CentOS
and other wikipedia:List_of_Linux_distributions#RPM-based that use wikipedia:Yellowdog_Updater,_Modified.
All of these commands will be typed at the wikipedia:Command-
line_interface.
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
(Optional) type the following command to install some additional packages:
yum -y install dos2unix gdb nano screen unzip wget zip
By the wikipedia:Principle_of_least_privilege, it is recommended you do NOT run Hercules as root.
useradd --create-home --shell /bin/bash hercules1234
--create-home
= create the user's home directory
--shell
= sets their login shell to wikipedia:Bash_(Unix_shell)
**
hercules1234
** = the login name of the new Linux account
_
1234
_ = pick your own random numbers to make the username more unique
passwd hercules1234
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:
First Start MySQL:
/etc/init.d/mysqld start
Then configure MySQL by:
mysql_secure_installation
Login to your MySQL Server as root:
When prompted, enter your root MySQL password.
mysql --user=root -p
Now your prompt should look like this (the MySQL command prompt):
mysql>
hercules1234
with the Linux username you created earlier):
mysql> CREATE DATABASE hercules1234_rag;
mysql> CREATE DATABASE hercules1234_log;
mysql> CREATE USER 'hercules1234'@'localhost' IDENTIFIED BY 'secretpassword';
hercules1234
= 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 `hercules1234\_rag`.* TO 'hercules1234'@'localhost';
mysql> GRANT SELECT,INSERT ON `hercules1234\_log`.* TO 'hercules1234'@'localhost';
(note the escaped underscore)
The rest of the setup is done as hercules1234 (the Linux user you created in
step 2.2)
{{:Git Clone/Unix}}
Tables
Change directory to the sql-files folder.
cd sql-files/
Execute these commands:
When prompted, enter your MySQL root password.
mysql -u root -prootpassword hercuser_rodb
mysql -u root -prootpassword hercuser_rodblog
If your Control Panel software or website requires it, you may also import the item, monster and monster skill databases (not necessary for the correct operation of Hercules)
(pre-renewal)
mysql -u root -prootpassword hercuser_rodb
mysql -u root -prootpassword hercuser_rodb
mysql -u root -prootpassword hercuser_rodb
(renewal)
mysql -u root -prootpassword hercuser_rodb
mysql -u root -prootpassword hercuser_rodb
mysql -u root -prootpassword hercuser_rodb
(common to renewal and pre-renewal)
mysql -u root -prootpassword hercuser_rodb
mysql -u root -prootpassword hercuser_rodb
mysql -u root -prootpassword hercuser_rodb
NOTE: if you want to use different SQL DBs for login/char/map servers this is
the list of databases each server use:
Note that the sql_updates table is needed by all three servers.
cd Hercules
./configure
make sql
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
//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