EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Linux Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=588)
-   -   Trying to set up server (https://www.eqemulator.org/forums/showthread.php?t=31368)

Jster22 05-23-2010 06:06 PM

Trying to set up server
 
Hello,
I am trying to set up a server. I have been following the guide Installing EQEmu on Debian Linux but it is very out of date. I followed the guide up until the section "Extract Source" where is instructs me to execute "tar xzf EQEmu-0.7.0-1043-source.tgz".

I have created the user eqemu, added directories home/source and home/server. I have got the files from the svn repository. I'm not sure how to compile to code now? My source directory contains the folders eqemumaps-ready-only, projecteqemu-read-only, projecteqdb-current-only, projecteqqests-read-only.

What do I do next? Is there an updated guide somewhere?
Thank you for your help!

trevius 05-23-2010 07:27 PM

Well, for one thing, you are going to have to move the maps and quests folders into your server directory and rename them to "maps" and "quests" respectively. Make sure that the maps are directly inside that maps folder and not inside another folder within it. Also, quests should be in folders named after the shortname of each zone directly inside the quests folder.

You will also need to move your quests/plugins folder to your server folder.

Really, most of the debian install guide should still be useful information for getting setup. I think the only thing that has really changed is how you get the source code and database, as they both come from google svn now. Unfortunately, I don't have instructions on how to do that on Linux yet, but there may be some directions around the forums/wiki somewhere for it.

Once you get the EQEmuServer source code downloaded, you can just go into that folder and type "make" and if you have followed all of the other steps, it should compile properly.

Mirakus 05-27-2010 12:22 PM

If you're still having problems, I would recommend reading this thread: http://eqemulator.org/forums/showthread.php?t=30773 and using the script described there.

I started out with trying to use the Debian guide, and had a lot of problems along the way. Snag the later version of the script from that other thread, and then add into the section where it adds links a link for commands.pl and login.ini. I'm not sure of the exact directory locations at this time. You might be able to get that setup script working with your existing installation, but you may need to rename some directories or move things around. I know that the script creates a lot of soft links into the server directory that you do not create (and need) when using the Debian guide.

If you're planning on running your own login server and running locally only in your LAN, I would recommend setting the address and local address values in eqemu_config.xml. A couple of guides out there say it is unnecessary, but I had to do that in order to get up and running.

Jster22 05-28-2010 07:31 PM

Hello trevius and Mirakus,

Thanks for the replies. I will look into both of your suggestions. Hopefully I can get this working. I'm sure I'll be replying back with more questions.

trevius, I have logged into your server before. You have done a very good job with it.

Jster22 05-28-2010 10:01 PM

Mirakus,

I don't know the exact commands for adding the links for commands.pl and login.ini. I did find those files in eqemulator/projecteqemu/utils/defaults/commands.pl and eqemulator/projecteqemu/EQEmuLoginServer/login_util/login.ini. Would this mean the link commands would look like this
Code:

user@server:/home/eqemulator/server$ ln -s ../projecteqemu/utils/defaults/commands.pl \
done
user@server:/home/eqemulator/server$ ln -s ../projecteqemu/EQEmuLoginServer/login_util/login.ini \
done

That doesn't seem right to me. Any ideas on this?

My end goal is to set up a private server for a few of my friends and myself. They live in different cities so I will need to setup a login server.

Thank you for taking time to help me.

Kobaz 05-29-2010 04:38 AM

Assuming you're in your server directory, the command you want will look like:

Code:

ln -s ../projecteqemu/utils/defaults/commands.pl .
The keywork "done" terminates a loop block, such as a for or while loop.

Jster22 06-01-2010 07:46 PM

Thanks for the clarification Kobaz.

After running the script that Mirakus suggested, it said to cd into projecteqemu and make it. It errored out, so I tried it again and it errored out again. I'm not sure how to resolve this. Below is the error message from my second attempt.
Quote:

make -C EMuShareMem
make[1]: Entering directory `/home/eqemulator/projecteqemu/EMuShareMem'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/eqemulator/projecteqemu/EMuShareMem'
make -C world
make[1]: Entering directory `/home/eqemulator/projecteqemu/world'
gcc -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wcomment -Wcast-align -Wno-deprecated -g -march=i686 -O -pthread -pipe -I../common/SocketLib -DFX -D_GNU_SOURCE -DINVERSEXY -DWORLD -DDEBUG=5 -DEQDEBUG=5 -DSHAREMEM -DCATCH_CRASH -DNO_PIDLOG -DFIELD_ITEMS -DIRC -Di386 -DAPP_OPCODE_SIZE=2 -DEMBPERL -DEMBPERL_PLUGIN -DHAS_UNION_SEMUN -I/usr/include/mysql -DBIG_JOINS=1 -fPIC -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.10/CORE Adventure.cpp -o Adventure.o
Adventure.cpp: In member function ‘void Adventure::MoveCorpsesToGraveyard()’:
Adventure.cpp:381: error: ‘atoi’ was not declared in this scope
make[1]: *** [Adventure.o] Error 1
make[1]: Leaving directory `/home/eqemulator/projecteqemu/world'
make: *** [all] Error 2

Mirakus 06-02-2010 09:41 AM

Jster22, the errors you listed are caused by the latest version of GCC. With some of the older versions, you would not have gotten that error. At the very top of both <yoursourcedir>/world/Adventure.cpp and <yoursourcedir>/world/AdventureManager.cpp, put #include <stdlib.h>

That should resolve your error.

Jster22 06-02-2010 08:19 PM

Thanks Mirakus. I didn't get any build errors after making those changes.

The next step is to "Build the login server". I assume that this means to cd into projecteqemu/EQEmuLoginServer and make. However, I get another error.
Quote:

gcc -o EQEmuLoginServer Client.o ClientManager.o Config.o DatabaseMySQL.o ErrorLog.o Main.o ServerManager.o WorldServer.o .obj/BasePacket.o .obj/Condition.o .obj/CRC16.o .obj/crc32.o .obj/debug.o .obj/emu_opcodes.o .obj/EmuTCPConnection.o .obj/EmuTCPServer.o .obj/EQPacket.o .obj/EQStream.o .obj/EQStreamFactory.o .obj/logsys.o .obj/logsys_eqemu.o .obj/misc.o .obj/MiscFunctions.o .obj/Mutex.o .obj/opcodemgr.o .obj/packet_dump.o .obj/packet_functions.o .obj/rdtsc.o .obj/TCPConnection.o .obj/TCPServer.o .obj/timeoutmgr.o .obj/timer.o .obj/unix.o -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wno-deprecated -Wcomment -Wcast-align -O -g -march=i686 -pthread -pipe -DEQLAUNCH -DEQDEBUG=5 -I/usr/include/mysql -DBIG_JOINS=1 -fPIC -rdynamic -L. -lstdc++ -ldl -L/usr/lib/mysql -lmysqlclient -lEQEmuAuthCrypto -lcryptopp
/usr/bin/ld: cannot find -lEQEmuAuthCrypto
collect2: ld returned 1 exit status
make: *** [EQEmuLoginServer] Error 1
I assume that this is a similar issue but I'm not sure which file(s) need to be edited.

Also looking ahead at the next steps, what is the file eqemu_config.xml used for? It says that I need to create/edit it. What needs to be in there? As well as the next step which is "Create/Edit your login server configuration"

Thanks again for your help!

Mirakus 06-03-2010 12:10 AM

Okay, I'm not sure why, but the AuthCrypto files needed by the login server are pre-built into static libraries, probably for security reasons, although I'm clueless as to the true reason why.

In the login server directory, there is another directory called login_util, or something similar. Navigate through to the linux folder, and then you should see a couple of zip files based on distribution. Choose the one closest to your distribution, and unzip the .a (static libraries on linux) into the main directory for the login server, then try making again. There isn't a file in there for every distrib; just choose the one closest. I used the RedHat64 one for a Debian 64-bit system and it worked fine. After that lib is in the LoginServer directory, it should build fine.

The eqemu_config.xml is kind of like an overall configuration file for your world server, not the login server. This is the place you will set up your ip's, ports, etc. This page: http://www.eqemulator.net/wiki/wikka...rConfiguration documents the file pretty well, although some of the things can be kind of misleading, depending on your exact intentions. For example, it says you do not need to set the ips at the beginning, but I had to in order to get things working. If you are just running over a lan, I would set both the address and local address to your local ip, or the address to your WAN address if you're opening up for friends on the internet. It may be possible that it's not necessary to modify those lines (uncommenting them - the <!-- in xml represent beginning of comments), but for whatever reason, I had to uncomment and set them to get things working on two different servers.

Your "login server configuration" refers to your login.ini file while is also located in the login_util directory of the login server directory. I just made a link to mine in the server directory, since that's where the script starts from, but if you're planning on using the official eqemulator login server, you probably don't want to do that. You will also need to set your necessary port and database information in that file.

Please someone correct me if I'm wrong on any of this!

orkim 06-03-2010 09:29 AM

You pretty much got it there Mirakus.

One note I will add, is "adding your ip to the top of the config file" portion from above.

Typically when the world server connects to the login server it will save the IP address from which the world server connected. Say, world server at 1.2.3.4 connects to login server at 4.3.2.1, therefor the login server knows the public IP address of the world server.

However, when you run both on the same machine (or within a LAN and desire outside connections) this can be a bit tricky. Local LAN + outside connections typically runs into some routing problems (i.e. route the internal LAN packets properly using internal addresses and still listen/respond to external addresses). If you're not concerned about external connections (i.e. from the internet) then you have a easier job. But I digress...

Here in lies the rub, the login server will not know the public/private IP address to which it should use to connect to the world server. This is why when you are running the login server and world server on a single machine you MUST set these fields. Otherwise the 'IP' gets recorded as 127.0.0.1 and all clients are then routed back to themselves (127.0.0.1) to look for the worldserver, which of course isn't there.

As clear as mud?

Hope that helps.

-ork

Jster22 06-05-2010 01:54 PM

Thanks for the replies Mirakus and orkim.

In my login_util>linux there are the folders fedora-12-64, gentoo32, and ubuntu-9-10-32. I chose ubuntu. I moved the files into EQEmuLoginServer and ran make. I believe it built ok this time.
Quote:

gcc -o EQEmuLoginServer Client.o ClientManager.o Config.o DatabaseMySQL.o ErrorLog.o Main.o ServerManager.o WorldServer.o .obj/BasePacket.o .obj/Condition.o .obj/CRC16.o .obj/crc32.o .obj/debug.o .obj/emu_opcodes.o .obj/EmuTCPConnection.o .obj/EmuTCPServer.o .obj/EQPacket.o .obj/EQStream.o .obj/EQStreamFactory.o .obj/logsys.o .obj/logsys_eqemu.o .obj/misc.o .obj/MiscFunctions.o .obj/Mutex.o .obj/opcodemgr.o .obj/packet_dump.o .obj/packet_functions.o .obj/rdtsc.o .obj/TCPConnection.o .obj/TCPServer.o .obj/timeoutmgr.o .obj/timer.o .obj/unix.o -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wno-deprecated -Wcomment -Wcast-align -O -g -march=i686 -pthread -pipe -DEQLAUNCH -DEQDEBUG=5 -I/usr/include/mysql -DBIG_JOINS=1 -fPIC -rdynamic -L. -lstdc++ -ldl -L/usr/lib/mysql -lmysqlclient -lEQEmuAuthCrypto -lcryptopp
Reading the eqemu_config.xml configuration guide, it says the file should be located in world/eqlaunch/zone. However, I found my file in projecteqemu/utils/defaults. Is this ok?

My goal is to open this server up for my friends to log on to. They live in different cities so I wont be connecting using LAN. Is there an easy way to find your WAN ip? I just went to whatismyip.com and put that value in for both <address> and <localaddress>. Or does localaddress need to be 127.0.0.1? Following the guide, this is my eqemu_config.xml file currently
Code:

<?xml version="1.0">
<server>
        <world>
                <shortname>setme</shortname>
                <longname>I Forgot To Edit My Config</longname>
                <address>(whatismyip.com)</address>
                <localaddress>(whatismyip.com)</localaddress>
                <key>some long random string</key>
        </world>
        <database>
                <host>localhost</host>
                <port>3306</port>
                <username>eq</username>
                <password>eq</password>
                <db>eq</db>
        </database>
</server>

I don't have a database set up yet. I am having problems installing mysql. I install it using the command "apt-get install mysql-server" but when I type "mysql -u root" to set up the root account, I get this error "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)". How do I completely remove mysql-server and start again? Or is there another way to fix this?

I will work on login.ini after I have eqemu_config.xml configured and mysql working.

Thanks again for your help. I am looking forward to getting this running!

pfyon 06-05-2010 03:17 PM

sudo apt-get remove mysql-server

I remember getting that error with mysql when I set up my server too, will have to try to remember how I fixed it.

Jster22 06-05-2010 03:31 PM

Hi pfyon, I removed mysql and reinstalled but still get the same error. Please let me know if you remember how you got around this error.

Thanks.

Jster22 06-05-2010 06:58 PM

I wanted to post an update in case anyone else runs into this problem because I think I have found a solution.

I ran "sudo ln -s /etc/mysql/my.cnf /etc/my.cnf" because I think it was looking for /etc/my.cnf instead of /etc/mysql/my.cnf. This seems to have fixed that problem. When I ran mysql -u root again I got a new error "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)". I fixed that by running "mysql --user=root -p" and entering a new password.

I think I have mysql set up correctly. I am going to work on sourcing my database. However, the guide says that the databasefile.sql should be in server/database but I don't have the database directory. I'm going to try and find it. Does my eqemu_config.xml look correct from a couple posts back?

Thank you.


All times are GMT -4. The time now is 07:14 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.