Howto setup a Linux Eqemu server
Advanced EqEmu Linux Setup
This guide has for goal to show how to install a working eqemu server on a Linux box. It's written for Linux but will prolly also work with FreeBSD and Linux clones. It requires a basic Linux knowledge, I certainly won't go deeper enough to teach you how to install Linux, or login on your system. This is widely covered on the web, Google is your best friend. I won't also cover all the details of the server configuration (ini files), since they are exactly the same with Linux or Windows. Please refer to the following guides if you need to : HOWTO: Host a 6.0-DR2 Server! + Minilogin! (WIN32) : http://www.eqemulator.net/forums/viewtopic.php?t=18935 HOWTO: Host a 6.0 Server on Windows (Perl Quests enabled!!) : http://www.eqemulator.net/forums/viewtopic.php?t=17531 Please keep in mind that you can setup a Linux box as Eqemu server only if you're on your own LAN (private network). Usually, LAN addresses are taken into the 192.168.*.* range, but if you are on an company network (don't let your boss know that you play EQ at work !), it can be something else. Prerequisites - A working Linux box, with a working LAN connexion - Around 1.5 Gbytes of freespace. - An EqEmu source package, get it from Sourceforge (links on http://eqemulator.net), or from anywhere else, it doesn't matter much. - Eqemu maps, needed for pathing and line of sight code, get them from sourceforge, or http://www.rogean.com/maps/maps.zip - A ton of patience and concentration. - Minilogin.exe (also from Sourceforge) if you want to run a private server. - Perl 5.8.0+ (this is installed on most recent Linux distribs) Optional - A working install of Samba (Windows server emulator, I won't also cover it here since there's several billions tutorial about Samba on the web). - Knowing how to use a linux text editor, vi for example. - A 6.0+ database. PEQ lastest release for example, and all the database updates from http://www.eqemulator.net/databases_v6.php. Part 0 : What are we going to install ? We're about to install, starting from nothing, an EqEmu server, on a Linux box. This means that, once done, you'll have your own EqEmu server. If you only want to play to Everquest on an EqEmu server, you don't need to do all this, just go back to the Tutorial forum and open an "How to play" topic. This is only for people who want to run their own server, private or public. For that guide, we will decide that we want to create a PEQ Minilogin server. Mysql is running on the linux box (it could be ran on another box, Linux or Windows, doesn't matter much). We will connect to it with an account named eqemu and eqpassword as password and the EQ database's name will be eqemu . The server's IP address is 192.168.0.100 Part 1 : Preparing the battlefield Before unpacking your source or doing any compilation, you must think about what you're going to do. We will install a software that is frequently updated and requires lot's of tweaking. This parameters must be kept in mind when installing. You will have to change your server's version at least 1 or 2 times per month if you wanna stay uptodate, perhaps even more if your goal is to have a public server. Which version of Linux ? Well, it's not important as long as it's 'modern' enough. A 2.4.18 or more recent is ok. Memory usage will depend of what you'll do of your server. For private use, 256 Mb and 512 Mb of swap are enough, for a public server, the more the better. Hard disk space : EqEmu requires now lots of disk space for the map files. The software by itself occupies only a few Mb. I suggest you to choose a partition which has at least 3 or 4 free Gb, even if you don't need them all, there's nothing more boring than full partitions. Avoid the partition(s) that contain /, /tmp and /var. One of the best choices would be to have a dedicated partition for eqemu. For that guide, we will consider that we have mounted a 5+ Gb partition on /eqemu. Directory structure : Login as root and create the following directories : /eqemu/source : This is where you'll unpack your packages and compile them. /eqemu/server : This is where you'll set your server. Code:
mkdir /eqemu Part 2 : Compilation Note concerning non-Intel or old CPUs: If the CPU or your Linux Box isn’t a Pentium 2 or higher and you encounter an error message of the kind Code:
[1]+ Illegal instruction ./world Compiling is the hardest part of the process and where you may encounter most of the problems. Unpack the source archive into /eqemu/source. You will then obtain a new directory named Source. Rename that directory with the date of the day : Code:
mv Source 12152004 Mysql include files Run the following command : Code:
mysql_config --cflags Code:
-I'/usr/local/include' List the files from the directory returned by mysql_config : ls /usr/local/include/mysql*h If you obtain a list of files that contains mysql.h, mysql_com.h and some other mysql* files, you're good to go. If not, you have 2 options : - Pretty one : Edit the makefile (the file where compilation options are) of what you gonna compile, it means 3 makefile edition per EqEmu compilation. - Uggly one : Copy or link the needed mysql include files into /usr/local/include (or any directory returned by mysql_config !) - Advanced one : Edit your mysql_config script and fix the error. For once, we gonna be uggly because it will be easier. Find your mysql include files : locate mysql_com.h This will return prolly several rows. Determinate the one that points where mysql have been installed. If you did it yourself, you certainly yet know where it was, if you didn't, its perhaps something like /usr/include/mysql/mysql_com.h Now, run this : Code:
ln -s /usr/include/mysql/mysql*.h /usr/local/include/ Compilation : libEMuShareMem.so Go to /eqemu/source/12152004/EMuShareMem, and run make Code:
cd /eqemu/source/12152004/EMuShareMem Compilation : world Go to /eqemu/source/12152004/world, and run make Code:
cd /eqemu/source/12152004/world Code:
cd /eqemu/source/12152004/zone Create it somewhere in your PATH, for example in /usr/bin : Code:
vi /usr/bin/mysql_config Code:
#!/bin/sh Code:
chmod +x /usr/bin/mysql_config Step 1 : creating a mysql account for eqemu If your mysql server is on another box, please be smart enough to work on that box :) Under Linux, you will access to your mysql server from your mysql client with the following command : Code:
mysql -p We will work on the database named mysql (the one that contains mysql accounts, privileges and such...) Code:
mysql> use mysql; Code:
mysql> select Host,User from user; If your mysql server is on your Linux box : Code:
mysql> insert into user set Host='localhost', User='eqemu', Password=password('eqpassword'); Code:
mysql> insert into user set Host='192.168.0.100', User='eqemu', Password=password('eqpassword'); Code:
mysql> create database eqemu; Code:
mysql> grant all privileges on eqemu.* to 'eqemu'@'localhost'; Code:
mysql> grant all privileges on eqemu.* to 'eqemu'@'192.168.0.100'; Code:
mysql> flush privileges; Code:
mysql> exit; Code:
Step 2 : connect to mysql using the eqemu account Note : you could do that step using the root account, but if you do it with the eqemu account (and from the eqemu server box if mysql server is on another box), you ll be sure that your mysql config is operationnal ! Create a directory name database into your eqemu tree : mkdir /eqemu/database (Do this even if your mysql box isnt your eqemu box) Copy and unpack your db files into that directory. There should be the PEQ file, and several smaller update files. You will also need to find every recent update made to the database, in the forum and by reading the HISTORY file contained in the eqemu packages. Now connect to mysql, mysql server is your eqemu box : Code:
mysql -p -u eqemu eqemu Code:
mysql -p -u eqemu -h 192.168.0.120 eqemu Source all the database files using the 'source' command : Code:
mysql> source PEQ_Kunark_RC1.sql; Database structure is the same for Linux and Windows. Tips : I suggest you to add -s as option when connecting to mysql. Doing so, mysql client won't show you what he sources into the database, and it ll be 15 or 20 time faster :) : Code:
mysql -p -u eqemu -s eqemu Log into mysql, like explained at step 2 and run the following queries : Code:
mysql> INSERT INTO variables (varname, value, information) VALUES ('LoginType', 'Minilogin', 'Set this to Minilogin to login using a minilogin server :)'); Part 4 : Perl (Quests) Create a quests directory into /eqemu/server : mkdir /eqemu/server/quests Download : http://search.cpan.org/CPAN/authors/...y-2.109.tar.gz and copy it somewhere onto your Linux box, then run the following commands : Code:
tar zxvf IO-stringy-2.109.tar.gz Part 5 : Installing the server Everything will now take place into /eqemu/server Step 1 : the server binaries We will now use the binaries generated during the Part 2. You can either copy them here, or link them. Choose to link them if you're working on a private server and think you ll play with eqemu source code, so, after each compile, your server will be operationnal. Copy them if you're running a public server and can't shut it down too often. Links : Code:
ln -s /eqemu/source/12152004/EMuShareMem/libEMuShareMem.so /eqemu/server/libEMuShareMem.so Create a directory named maps where you'll unpack your map files. Code:
mkdir /eqemu/server/maps Step 3 : db.ini We need to create several files that will contain eqemu configurations into the server's directory. I suggest you to create the files from nothing, that's the best way to understand what you're doing. Code:
cd /eqemu/server Code:
[Database] Code:
[Database] Two alternatives here, choose the one that suits you : go to step 5 if you create a Minilogin server (private server) go to step 6 if you create a public server (using eqemulator login servers) Step 5 : Minilogin If you plan to use the public login servers, go directly to step 7. Start by reading this : http://www.eqemulator.net/forums/viewtopic.php?t=17843 Since we're running the server on a Linux box and Minilogin.exe is a Win32 software, we can't run it on the server box. Any Windows client on your Lan will do the job very well. Let's say that the computer you will play on is 192.168.0.30. Edit LoginServer.ini Code:
cd /eqemu/server Code:
[LoginServer] Now, copy Minilogin.exe and LoginServer.ini on your Windows computer (192.168.0.30), and place them into a directory you'll remember, like c:\minilogin for example. Remember that you'll need to launch minilogin.exe each time you will start your eqemu server ! Step 6 : Public login servers If you plan to use Minilogin as login server, go back to step 5. Code:
Edit LoginServer.ini Code:
[LoginServer] Code:
traceroute yahoo.com Launch Minilogin.exe on your Windows computer. It should display the following text : Code:
LoginServer.ini read. Go to your server directory : Code:
cd /eqemu/server Code:
./world | grep EMuShare If it says something about libEMuShareMem not loaded : Code:
[Error] LoadEMuShareMemDLL::Load() failed to load library 'libEMuShareMem.so'. Error=0 Code:
echo "/eqemu/server" >> /etc/ld.so.conf ; ldconfig Code:
./world | grep EMuShare Code:
[Status] libEMuShareMem.so loaded Step 8 : zone script Create a short script named zone, and put it somewhere in your path, /usr/bin for example. Code:
vi /usr/bin/zone Code:
#!/bin/sh Code:
chmod +x /usr/bin/zone Code:
zone . 90 Code:
zone commons 91 Step 9 : Finishing the install Create a directory for the log files : Code:
mkdir /eqemu/server/logs Part 6 : Running the server This is the typical process needed to run the server (take into consideration that Minilogin if you use it must be running on your Windows box) : Code:
cd /eqemu/server You can also create a startup script that could looks like this : Code:
#!/bin/sh Part 7 : A few tips - How to browse a logfile : tail -f /eqemu/server/logs/eqemu_zone.log - Refer to Fathernitwit security post if you wanna secure your server. - Kill telnet daemon and only use sshd. - If you have samba, share /eqemu/server and copy Minilogin.exe in it. Doing this, you won't need it on your Windows computer, it can be ran thru a share. - After your server crashed or when you started it with an incorrect database setup, zone could eventually refuse to boot up and will block on Loading doors or another table of the database. This problem is certainly linked to the fact that there’s a remaining and unvalid memory segment allocated by libEMuShareMem.so that wasn’t freed when the server crashed. To remove it, you will have to use ipcs and ipcrm commands. This is a running server : Code:
ipcs Code:
ipcs Code:
ipcrm –m 393217 Revisions - Added the part concerning IPCs - Added the archictecture specific note (suggested by residentninja) - Added a fix for the mysql errors 1251 and 2006. (suggested by residentninja) - Rewrote mysql_config so there’s no more compilation errors - Completed mysql_config support for people who don’t have it (suggested by residentninja) - Modified starting script so it doesn’t use /usr/bin/zone script but directly /eqemu/server/zone binary |
Waiting for feedback before moving this to tutorials forum.
(self-moderation isn't fun :p) |
I tried your tutorial last night and found it very helpful. A few things you may want to add in. I am running Debian 2.4.18 kernel:
I did not have mysql-config for some reason but I had all mysql packages install that I could see so I had to do: find / -iname mysql*.h At which time I did not have those files and I to find out that I needed to install libmysql-dev to get them. Might want to make a Note for future people to know what package to get if they do not have the files need.I think there have been a few other small things but i can't remember now. The problem I am have though after the tutorial is when I run server i get this: bashir:/home/eqemu/server# ./world & [1] 8142 bashir:/home/eqemu/server# /usr/bin/zone . 91 [1]+ Illegal instruction ./world bashir:/home/eqemu/server# If a do: ps aux | grep world ps aux | grep zone I find that neither are running. I also tried just running world and checking to see if it was running and I get this: bashir:/home/eqemu/server# ./world & [1] 8131 bashir:/home/eqemu/server# ps aux | grep zone root 8141 0.0 0.1 1332 432 pts/0 S 15:09 0:00 grep zone [1]+ Illegal instruction ./world I have recompiled EMuShareMem, world, and zone just to make sure and still I get the same thing. I also get the same result using the init script in the tutorial. It says it starts both but then there is nothing running. Also zone is not creating log files and there is nothing about it in syslog or any other log i have found so far. world doesn't seem to be creating log files either (not sure if it normally does). Also one last thing. I am unable to connect to the mysql server with EQAdmin. Not that important at this point but... Not sure what to do from here. I've exhausted everything I can think of and am getting brain fried since I'm in no way an EQEmu expert. |
I m busy ATM and can't answer you immediately, but i ll test it tomorrow at work on a debian. World not running might not be linked to compilation troubles or kernel issues. World will crash on certain database errors. Try running it without the &, from the /eqemu/server directory, ie :
cd /eqemu/server ./world What shows on the console will certainly help ya to figure what's wrong... If you can't fix it by urself, please ask for support into the linux support forum please, we d'like to keep tutorial forums for ... tutorials :) I ll revise the part concerning mysql-config, if you don't have it, you can still compile the Freebsd way, thank you for leading my attention to that point, i ll add it to the guide. |
Residentninja, I had no issue compiling under debian, Woody with a 2.4.18-bf2 kernel. I think your problems are coming from your configuration. If you're still blocked, start a thread into the linux forum, post your ini files and such...
|
Saving lives
please save millions of lives by adding this to your tutorial to be done right after the GRANT statement for mysql:
SET PASSWORD FOR 'someuser'@'bashir.pgprog.net' = OLD_PASSWORD('somepasswd'); Because I was not doing this I was getting errors #1251 and #2006 no matter how I did my grant permissions. This seems to only effect people running MySQL 4.1 and up...It caused me rage for several days. Also I was only able to get world working on my system by editing the makefile and changing the -march statement to my specific processor (i586 for me) and by setting the option -O3 Anything else would cause world to compile but not to run. Hope this helps your tutorial and others who my be having these problems. |
Re: Saving lives
Quote:
Quote:
Thank you for feedback. |
Added support for IPCs.
|
Quote:
it should be mkdir /eqemu/server/Maps great guide btw ;) |
Any ideas on this error?
[root@server EMuShareMem]# make gcc -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wno-deprecated -Wcomment -Wcast-align -DDEBUG=1 -DCATCH_CRASH -g -fPIC -O2 -D_GNU_SOURCE -DINVERSEXY -DFX `mysql_config --cflags` -c Doors.cpp -o Doors.o cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ In file included from ../zone/zonedump.h:31, from Doors.h:2, from Doors.cpp:12: ../zone/../common/Item.h:285: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected ../zone/../common/Item.h:500: error: within this context ../zone/../common/Item.h:288: error: `sint16 Inventory::_HasItem(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, const Item_Struct*, uint8)' is protected ../zone/../common/Item.h:573: error: within this context ../zone/../common/Item.h:290: error: `sint16 Inventory::_HasItemByUse(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, uint8, uint8)' is protected ../zone/../common/Item.h:575: error: within this context ../zone/../common/Item.h:285: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected ../zone/../common/Item.h:582: error: within this context make: *** [Doors.o] Error 1 |
Quote:
|
Quote:
Find the class declaration where the errors are (common/Item.h around line 280) Find the word Code:
public: Note that it's worthwhile learning a bit about C++ - there are heaps of good books and web references that can teach you about C++ scoping and hiding. |
Hello all,
last linux guide is on the wiki : http://www.eqemulator.net/wiki/wikka...ka=LinuxServer and some usefull information :) You can use, edit and correct this !!! |
yeah I figured that out.
I am a novice C++ programmer lol... self-taught... I dont know much but I figured that out. Now Zones wont compile... |
All times are GMT -4. The time now is 04:37 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.