Difference between revisions of "Installation (Debian)"

From Hercules Wiki
Jump to: navigation, search
(Created page with "This guide covers how to install Hercules on Debian and other versions of Linux that use apt-ge...")
 
m (Import MySQL Tables)
 
(6 intermediate revisions by 4 users not shown)
Line 14: Line 14:
 
apt-get upgrade
 
apt-get upgrade
 
apt-get dist-update  // To update to the latest version of Debian
 
apt-get dist-update  // To update to the latest version of Debian
# Type the following command (this will install GCC, Make, MySQL Server, MySQL header files,  PCRE header files, Subversion, and Zlib header files)  
+
# Type the following command (this will install GCC, Make, MySQL Server, MySQL header files,  PCRE header files, git, and Zlib header files)  
#: <pre>apt-get install subversion make gcc mysql-server libmysqlclient-dev zlib1g-dev libpcre3-dev screen</pre>
+
#: <pre>apt-get install git make gcc mysql-server libmysqlclient-dev zlib1g-dev libpcre3-dev screen</pre>
  
 
=== Create a non-root Linux user ===
 
=== Create a non-root Linux user ===
Line 21: Line 21:
 
# Type the following command to create a non-root Linux account:
 
# Type the following command to create a non-root Linux account:
 
#: <pre>useradd hercuser</pre>
 
#: <pre>useradd hercuser</pre>
 +
# Be sure not to forget setting new password for new user
 +
#: <pre>passwd hercuser</pre>
  
 
== Install [[Hercules]] ==
 
== Install [[Hercules]] ==
Line 29: Line 31:
 
# Login to your server via SSH as the hercuser Linux user.
 
# Login to your server via SSH as the hercuser Linux user.
  
=== SVN Checkout ===
+
=== Git Clone ===
{{:SVN Checkout/Unix}}
+
<pre>git clone https://github.com/HerculesWS/Hercules.git ~/Hercules</pre>
  
 
=== [http://dev.mysql.com/doc/refman/5.5/en/batch-commands.html Import] MySQL Tables ===
 
=== [http://dev.mysql.com/doc/refman/5.5/en/batch-commands.html Import] MySQL Tables ===
Line 38: Line 40:
 
#: ''When prompted, enter your MySQL root password.''
 
#: ''When prompted, enter your MySQL root password.''
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < main.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < main.sql</pre>
 +
#: <pre>mysql -u root -prootpassword hercuser_rodblog < logs.sql</pre>
 +
# 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)
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < item_db.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < item_db.sql</pre>
#: <pre>mysql -u root -prootpassword hercuser_rodb < item_db2.sql</pre>
 
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_db.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_db.sql</pre>
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_db2.sql</pre>
 
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_skill_db.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_skill_db.sql</pre>
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_skill_db2.sql</pre>
+
#: (renewal)
#: <pre>mysql -u root -prootpassword hercuser_rodblog < logs.sql</pre>
+
# If you are using Renewal you also have to import the following
+
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < item_db_re.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < item_db_re.sql</pre>
#: <pre>mysql -u root -prootpassword hercuser_rodb < item_db2_re.sql</pre>
 
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_db_re.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_db_re.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_skill_db_re.sql</pre>
 
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_skill_db_re.sql</pre>
 +
#: (common to renewal and pre-renewal)
 +
#: <pre>mysql -u root -prootpassword hercuser_rodb < item_db2.sql</pre>
 +
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_db2.sql</pre>
 +
#: <pre>mysql -u root -prootpassword hercuser_rodb < mob_skill_db2.sql</pre>
  
 
NOTE: if you want to use different SQL DBs for login/char/map servers this is the list of databases each server use:
 
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
+
#login-server: global_acc_reg_num_db, global_acc_reg_str_db, ipbanlist, login, loginlog
#map-server: mapreg, item_db, item_db2, mob_db, mob_db2,mob_skill_db
+
#map-server: autotrade_data, autotrade_merchants, mapreg, npc_market_data
#char-server: everything else + global_reg_value once again
+
#char-server: everything else
Note that global_reg_value tables are needed by both login-server and char-server (though it may be different tables)
+
Note that the sql_updates table is needed by all three servers.
  
 
=== [[:Category:Configuration|Configure Hercules]]===
 
=== [[:Category:Configuration|Configure Hercules]]===
  
 
=== Compile Source Code ===
 
=== Compile Source Code ===
  cd trunk
+
  cd Hercules
 
  ./configure
 
  ./configure
 
  make sql
 
  make sql
  
 
*If you have added plugins for use with Hercules please use the below syntax instead of the above:
 
*If you have added plugins for use with Hercules please use the below syntax instead of the above:
  cd trunk
+
  cd Hercules
 
  ./configure
 
  ./configure
make sql plugins
 
 
 
*If you're using Debian 32-bit please use:
 
cd trunk
 
./configure --disable-64bit
 
 
  make sql plugins
 
  make sql plugins
  
Line 78: Line 76:
 
===== How to Recompile =====
 
===== How to Recompile =====
 
In the future (after you update or edit any file in /src) to recompile, add ''make clean'' before make sql:  
 
In the future (after you update or edit any file in /src) to recompile, add ''make clean'' before make sql:  
  cd trunk
+
  cd Hercules
 
  ./configure
 
  ./configure
 
  '''make clean'''
 
  '''make clean'''
Line 85: Line 83:
 
== Start your Hercules Server ==
 
== Start your Hercules Server ==
 
  //change access mode of athena-start file so that you can execute it.
 
  //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  
+
  //Use (dos2unix athena-start) if you are getting ^M errors ie. newline errors  
 
  chmod a+x athena-start
 
  chmod a+x athena-start
  
Line 97: Line 95:
 
== See Also ==
 
== See Also ==
  
[[Category:Installation Guides|CentOS]]
+
[[Category:Installation Guides|Debian Linux]]

Latest revision as of 12:59, 8 July 2015

This guide covers how to install Hercules on Debian and other versions of Linux that use apt-get.

Contents

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.

apt-get update apt-get upgrade apt-get dist-update // To update to the latest version of Debian

  1. Type the following command (this will install GCC, Make, MySQL Server, MySQL header files, PCRE header files, git, and Zlib header files)
    apt-get install git make gcc mysql-server libmysqlclient-dev zlib1g-dev libpcre3-dev screen

Create a non-root Linux user

By the principle of least privilege, it is recommended you do NOT run Hercules as root.

  1. Type the following command to create a non-root Linux account:
    useradd hercuser
  2. Be sure not to forget setting new password for new user
    passwd hercuser

Install Hercules

Login as your non-root Linux user

The rest of the setup is done as hercuser (the Linux user you created earlier)

  1. Logout from root SSH (or minimize the window).
  2. Login to your server via SSH as the hercuser Linux user.

Git Clone

git clone https://github.com/HerculesWS/Hercules.git ~/Hercules

Import MySQL Tables

  1. Change directory to the sql-files folder.
    cd sql-files/
  2. Execute these commands:
    When prompted, enter your MySQL root password.
    mysql -u root -prootpassword hercuser_rodb < main.sql
    mysql -u root -prootpassword hercuser_rodblog < logs.sql
  3. 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 < item_db.sql
    mysql -u root -prootpassword hercuser_rodb < mob_db.sql
    mysql -u root -prootpassword hercuser_rodb < mob_skill_db.sql
    (renewal)
    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
    (common to renewal and pre-renewal)
    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:

  1. login-server: global_acc_reg_num_db, global_acc_reg_str_db, ipbanlist, login, loginlog
  2. map-server: autotrade_data, autotrade_merchants, mapreg, npc_market_data
  3. 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
  • If you have added plugins for use with Hercules please use the below syntax instead of the above:
cd Hercules
./configure
make sql plugins


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 plugins

Start your Hercules 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

See Also