Loading...   

Current as of 9/28/2014:   This is a companion to the guide on GitHub https://github.com/EQEmu/Server/wiki/Linux-server-setup

 

In addition to the dependencies listed in step #2 add the following:  mysql-devel, cmake, perl-devel, boost, boost-devel, lua-devel, compat-lua, compat-lua-libs, and compat-lua-devel

Loading the SQL data could use a little explanation.

This is mentioned in step #17

1. start mysqld if it isn't running:    "service mysqld start"

2. If this is a fresh install of mysql, complete the install:   "mysql_secure_installation"

3.  Log into mysql "mysql -u root -p"  (you will be prompted to enter the password for the mysql root account, which may be a different password that Fedora's root account)

4. See if you already have a database setup for eqemu -- "show databases;"

    4.a  If not, create a database

MariaDB [(none)]> CREATE DATABASE eq;
Query OK, 1 row affected (0.01 sec)

5.  'use' the eqemu database, then load the sql.  The GitHub guide asks that your download SQL in step 11 (from http://peqtgc.com/releases).


MariaDB [(none)]> USE eq;
Database changed

MariaDB [(none)]> SOURCE 2_13.sql;               (or whatever database is available)

6.  Also source the SQL files in loginserver/login_util

     One way is to change directory to loginserver/login_util and then start the mysql client.  The files will now be in the current directory, and mysql can load
     them by name (without a path).

7.  If this is a new install, you will need to create a user for the database.  I created a user named 'eqemu'.  Make sure this user has the correct privileges.  Note that the
     
password specified after IDENTIFIED BY will be encrypted, as shown below.


MariaDB [(none)]> CREATE USER 'eqemu'@'%' IDENTIFIED BY '********';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON eq.* to 'eqemu'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

MariaDB [eqemu]> SHOW GRANTS FOR 'eqemu'@'%';
+--------------------------------------------------------------------------------------------------------+
| Grants for eqemu@%@%                                                                                   |
+--------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'eqemu@%'@'%' IDENTIFIED BY PASSWORD '*BE99DE24ACCF1FD5E726523A5FDABE277A35BC67'
| GRANT ALL PRIVILEGES ON `eq`.* TO 'eqemu@%'@'%' WITH GRANT OPTION                             |
+--------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

If you make a mistake, you can delete the user with " drop user 'eqemu'@'%'; "and start over.

Note that the way I suggest you create the user allows this user to log in from any host.  You may want to restrict this further by providing a host instead of the '%' symbol.  I have my
mysql server running on a local LAN behind a router, and the router uses port forwarding rules to limit which hosts can connect to the mysql port (3306).  Leaving your mysql server
open to the entire world is a bad idea.  Either restrict the hosts here, in your firewall rules, or on your router.

In step #18 you are asked to add credentials to the file eqemu_config.xml.  This means editing the following sections.


        
                external.ip.example.com
                3306
                eqemu
                my_eqemu_password
                eq
        

        
                external.ip.example.com
                3306
                eqemu
                my_eqemu_password
                eq
        

Since I am running behind a router, I have a private local address and a public external address.  The external address is the public address for my router, and is assigned by
my ISP.  The local address is something I picked, and is not routed.  Common local addresses are on the 192.168.0.0 network.  See the Wikipedia article on
private networks for more information:   http://en.wikipedia.org/wiki/Private_network

It is very important that you keep these two addresses separate when setting up EQEmu to run behind a router.  I will refer to these as private and public addresses.
If you want to access your server remotely (perhaps have friend log in) you will want to use a service like DynDNS to associate your public IP address with a domain name.
Perhaps an article on setting up a router is needed...

Starting and Stopping the Server

I created a couple of shell scripts to start/stop the server.  These are much simpler than needed in the past, but it is still important that things be brought up in the correct order.

#! /bin/bash

./loginserver 2>&1 > logs/loginserver&
./world 2>&1 > logs/worldserver&
./eqlaunch zone 2>&1 > logs/launcher.log &
./ucs 2>&1 > logs/ucs.log &

and

#! /bin/bash

killall eqlaunch
killall loginserver
killall zone
killall world
killall ucs

The worldserver needs to be started after the login server, so that it can register with the server manager.  Not doing this will result in an
empty server list when you get to server select.

A note on LUA

I was unable to build with lua version 5.2 hipped with Fedora 20.  The work-around is to load compat-lua, compat-lua-libs, and compat-lua-devel.

I then provided new paths to CMake.  From my cache file:

//Path to a file.
LUA_INCLUDE_DIR:PATH=/usr/include/lua-5.1

//Lua Libraries
LUA_LIBRARIES:STRING=/usr/lib64/liblua-5.1.so;/usr/lib64/libm.so

//Path to a library.
LUA_LIBRARY:FILEPATH=/usr/lib64/liblua-5.1.so