Jump to content

antiroot

Members
  • Posts

    302
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Everything posted by antiroot

  1. Just thought I would comment that the data in the MySQL databases is not platform specific. A TINYINT in 32bit is 1Byte and in 64bit is still 1Byte. A lot of the data stored in the database is already 64bit (timestamps for example). So your OS bit value has no affect on what MySQL understands as an INT or BIGINT or any other data type. I'm sure everyone would want to know if you have any issues migrating the databases from 32bit to 64bit as opposed to just a complete fresh install of everything, I would like to do this with my server as well (Just don't have the time or money currently)
  2. Check if an older realmd or another process is already bound to port 3724 as well netstat -ln | grep ":3724"
  3. Sounds like a database issue related to POI points, check that you don't have duplicates in your mangos.quest_poi_points table, mine has a total of 56,372 records. So if you have something closer to 112,744 than this data has been inserted twice. Which would cause the Map to crash the client when "show quest objectives" is turned on
  4. Try using your mysql root account to create the databases mysql -u root -p[b][color="Red"]<MySQL_root_Password>[/color][/b] < /opt/mangos/mangos/sql/create_mysql.sql Edit: Use root for the other two files that Create the databases as well, once they are created then use your mangos user to populate them
  5. Where does the macro HASH_NAMESPACE_START ever get defined in ObjectGuid.h? I would think that "game/ObjectGuid.h" would need to include "Utilities/UnorderedMapSet.h" in order to know what the definitions are in order to process platform specific pre-compiler macros This could be already happening somewhere else, but I didn't see it when I looked
  6. @coco77 a server on the internet is not private, it then becomes public. Public MaNGOS Servers are not supported by the MaNGOS community, the forums are here for support and group collaboration on developing private MaNGOS servers for educational use, and advancing C/C++ knowledge
  7. @willisoady, You are completely correct about the "REQUIRE: DAEMON, mysql" I have edited the guide to have the new change, thanks for the catch. I had that added on my live server but not in my development server that i used while making this guide. This guide has taken about a month and a half to get it to the state its in now (issues with some ports that needed to be updated in order to function correctly for a seamless non-interactive install) Automatic MySQL backups will be part of my Upgrade guide (since with a base install there's usually no need for a backup) my live server is currently running my update method and has worked flawlessly everytime except when Level1.cpp and other chat related files had some changes, but it was my fault with one of my custom patches I created. I hope to have the Upgrade based off of this install guide up within the week.
  8. Step 7 - Securing MaNGOS (Continued) FreeBSD MaNGOS rc Script (Start/Stop Script) This is a very simple script currently able to handle a single worldd and/or realmd instance. Eventually this will be rewritten to handle multiple realms/worlds Important! The code below is not the script, but the commands to generate the script. Execute the entire code block the same way all previous commands have been executed! echo '#\\!/bin/sh\\ #\\ # $FreeBSD: mangos-server.sh,v 0.1 2010/06/03 16:09:17 antiroot Exp $\\ # AUTHOR: antiroot aka geekspark\\ # DATE: 2010/06/03 16:09:17\\ \\ # PROVIDE: mangos-worldd mangos-realmd\\ # REQUIRE: LOGIN mysql\\ # KEYWORD: shutdown\\ \\ # Add the following lines to /etc/rc.conf.local or /etc/rc.conf\\ # to enable these services\\ #\\ # For both mangos-worldd and mangos-realmd\\ #mangos_enable="YES"\\ # or, separately as:\\ #mangosworldd_enable="YES"\\ #mangosrealmd_enable="YES"\\ #\\ # Running mangos as root is unsafe\\ # The following variable allows you to change\\ # the user that mangos will run as\\ # username mangos is default*\\ #mangos_user="mangos"\\ \\ . /etc/rc.subr\\ \\ name=mangos\\ rcvar=$(set_rcvar)\\ \\ # Only Edit These Options\\ name_prefix="mangos" #prefix for binaries/pids\\ mangos_daemons="realmd worldd" #binaries/pids without prefix/suffix\\ homedir="/opt/mangos" #path to mangos install dir\\ bindir="${homedir}/bin" #path to mangos/bin dir\\ rundir="${homedir}/run" #path to mangos/run dir\\ # Do Not Edit Below This Line\\ \\ load_rc_config "${name}"\\ mangos_user=${mangos_user:="mangos"}\\ extra_commands="status"\\ start_cmd="mangos_cmd"\\ stop_cmd="mangos_cmd"\\ restart_cmd="mangos_cmd"\\ status_cmd="mangos_cmd"\\ rcvar_cmd="mangos_rcvar_cmd"\\ command_args="> /dev/null 2>&1 &"\\ \\ mangos_enable=${mangos_enable:=NO}\\ \\ if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then\\ mangosworldd_enable=${mangosworldd_enable=YES}\\ mangosrealmd_enable=${mangosrealmd_enable=YES}\\ fi\\ eval real_${rcvar}="\\${${rcvar}:=NO}" ${rcvar}=YES\\ mangosworldd_enable=${mangosworldd_enable:=NO}\\ mangosrealmd_enable=${mangosrealmd_enable:=NO}\\ \\ mangos_rcvar_cmd() {\\ unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"\\ echo "# ${name}"\\ if [ -n "${rcvar}" ]; then\\ if checkyesno "real_${rcvar}"; then\\ echo "\\$${rcvar}=YES"\\ else\\ echo "\\$${rcvar}=NO"\\ fi\\ fi\\ mangos_cmd "${_rc_prefix}${rc_arg}" ${rc_extra_args}\\ }\\ \\ mangos_cmd() {\\ local name rcvar command pidfile mangos_daemons\\ unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd"\\ if [ "${rc_arg}" = "stop" ] ; then\\ mangos_daemons=$(reverse_list ${mangos_daemons})\\ fi\\ for name in ${mangos_daemons}; do\\ command="${bindir}/${name_prefix}-${name}"\\ pidfile="${rundir}/${name_prefix}-${name}.pid"\\ name=${name_prefix}${name}\\ eval ${name}_user=${mangos_user}\\ rcvar=$(set_rcvar)\\ run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}\\ done\\ }\\ \\ run_rc_command "$1"' > /usr/local/etc/rc.d/mangos-server ; chmod 555 /usr/local/etc/rc.d/mangos-server ; echo 'mangos_enable="YES"' >> /etc/rc.conf ; Step 8 - Optional Configurations mangos.conf (Optional) - Enable Vmap LOS and Height You will want this if you don't want creatures going through walls cd /opt/mangos ; sed -i "" '/vmap.enableLOS[ ]*=/ s/0/1/; \\ /vmap.enableHeight[ ]*=/ s/0/1/;' \\ etc/mangosd.conf ; MySQL With Sockets (Optional) If you disable Networking in MySQL you will need this scriptdev.conf states: "Unix sockets: experimental, not tested" I have been using Sockets since I first compiled MaNGOS around the time of revision 9139 and I have had zero issues cd /opt/mangos ; sed -i "" '/DatabaseInfo[ ]*=/ s/127.0.0.1;3306/.;\\/tmp\\/mysql.sock/;' \\ etc/*.conf ; mangos.conf (Optional) - Enable SOAP Useful for PHP scripts cd /opt/mangos ; sed -i "" '/SOAP.Enabled[ ]*=/ s/0/1/; \\ /SOAP.IP[ ]*=/ s/127.0.0.1/0.0.0.0/;' \\ etc/mangosd.conf ; mangos.conf (Optional) - Enable Full Two Side Interaction This only partially works, Client changes have made Two Sided Groups not work as intended cd /opt/mangos ; sed -i "" '/AllowTwoSide.Interaction.Chat[ ]*=/ s/0/1/; \\ /AllowTwoSide.Interaction.Channel[ ]*=/ s/0/1/; \\ /AllowTwoSide.Interaction.Group[ ]*=/ s/0/1/; \\ /AllowTwoSide.Interaction.Guild[ ]*=/ s/0/1/; \\ /AllowTwoSide.Interaction.Auction[ ]*=/ s/0/1/; \\ /AllowTwoSide.Interaction.Mail[ ]*=/ s/0/1/; \\ /AllowTwoSide.WhoList[ ]*=/ s/0/1/; \\ /AllowTwoSide.AddFriend[ ]*=/ s/0/1/;' \\ etc/mangosd.conf ; Step 9 - Starting MaNGOS Securely for the First Time /usr/local/etc/rc.d/mangos-server start ; MaNGOS should now be running in the background as a true daemon, owned by the system user mangos Since we disabled the console in Step 5, we won't be able to see the text flashing by, however you can read the log file located at /opt/mangos/log/Server.log to monitor its progress or research a bug View the last 10 lines of the log file tail /opt/mangos/log/Server.log ; Once your log file displays Starting Remote access listner on port 3443 on 0.0.0.0 You will be abe to connect to MaNGOS through your client or RA Step 10 - Creating User Accounts Conecting to MaNGOS RA With console disabled, we need to use RA to create user accounts telnet 127.0.0.1 3443 ; Username: ADMINISTRATOR Password: <MaNGOS Administrator Password> Once logged in you will be greeted with the prompt mangos> and will be able to execute all console commands availabe to a normal MaNGOS console session. Creating an Account Replace $account and $password with a username and password of your choice. .account create [b][color="RED"]$account[/color][/b] [b][color="RED"]$password[/color][/b] Exiting MaNGOS RA quit must be fully typed unlike other MaNGOS commands quit FreeBSD MaNGOS (Secure) Install - Complete You should have a completely functional MaNGOS Server running securely under FreeBSD. Notes * If your server ever reboots intentionally or accidentally, MaNGOS will start back up via it's rc script * All MySQL passwords stored in configuration files cannot be viewed or altered by any normal system user * The system user mangos can only be accessed by the root account when the rc script is executed * The MaNGOS console cannot be accessed by a normal user without using RA and knowing the MaNGOS Administrator password This guide/installation method is in a constant evolving process as I learn new more efficiency and security tricks. If anyone feels I've missed something please let me know and I'll make sure to get the guide updated. TODO: Only thing left is to make a guide on how to update based off of this guide (Its half finished currently just working out a cleaner way for maintaining custom patches)
  9. Requirements * Server with FreeBSD 7.3-RELEASE or FreeBSD 8.0-RELEASE (Recommended) A Minimal FreeBSD install works great, don't forget to set your root password and create a normal user account during the install though * You have direct or ssh access to the machine * Static IP Address for server * An Internet Connection used to fetch dependencies * Root access to get everything started (We'll make it secure at the end) * csh shell (Default in FreeBSD) Parts of this guide require builtin functions of csh Recommended Please use PuTTY or some other ssh client that allows you to copy code from this guide and paste/execute on the server, If you try to type everything yourself you are bound to have problems! Why Make a FreeBSD Guide? Because MaNGOS is an educational project and there is a lack of FreeBSD based MaNGOS guides available, users should have a complete guide to build, run, test and develop MaNGOS under FreeBSD. I will also cover security tips in this guide, as this is a major topic many other guides tend to lack. If you have a question about an unfamiliar command, ask and I'll explain it Readme Before Starting * Code to enter in your terminal/console will be in Code blocks, and can be copy/pasted * Italic text are notes about the step or code * The root account is required for the initial portion of the guide * If you choose to not follow my guide exactly, I may not be able to help with issues you encounter * At the end of this guide you should have a stable/functional/secure FreeBSD + MaNGOS server * Anything that says <MySQL Root Password>, <MySQL mangos Password>, or similar Replace with the appropriate information, and make sure to remove the <> characters Make sure to use csh Default root shell in freebsd is csh, however if you change this you will encounter errors. Always make sure to use the csh shell /bin/csh when following this guide (thanks Exelenz) Step 1 - Getting Dependencies All dependencies will be installed via ports to insure compatibility Gain root access The recommended way is to login as a normal user and su root or login as root directly, keep in mind this is insecure and bad administration practice This is a common issue for beginners that do not know the root user is needed to install software Populate Ports Tree Important only do Option 1 OR Option 2 Option 1 will make sure you have all the latest security and recommended updates Option 2 will be completely compatible with this guide Option 1) Current Ports Tree This will also give you the most current up-to-date ports tree and may make this guide incompatible with newer ports Use portsnap update instead of portsnap extract if your upgrading an existing snapshot obtained via portsnap portsnap fetch ; portsnap extract ; Option 2) Old Ports Tree (Current at time of writing this) If you wish to use the exact ports tree I use in the guide use the following commands If your server is not in the US, use http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#CVSUP-MIRRORS to find a mirror near you for the host=cvsup3.us.FreeBSD.org portion echo '*default [color="Olive"]host=cvsup3.us.FreeBSD.org[/color] \\ *default base=/var/db \\ *default prefix=/usr \\ *default release=cvs tag=. \\ *default delete use-rel-suffix \\ *default compress \\ date=2010.08.12.23.59.59 \\ ports-all' > /root/ports-supfile ; csup -L 2 /root/ports-supfile ; Installing CA Root list cd /usr/ports/security/ca_root_nss ; make -DWITH_ETCSYMLINK -DBATCH install clean ; Installing OpenSSL cd /usr/ports/security/openssl ; make -DBATCH install clean ; cp /usr/local/openssl/openssl.cnf.sample /usr/local/openssl/openssl.cnf; Installing MySQL MySQL 5.1 has ran stable for myself with FreeBSD-7.2, 7.3, 8.0 + MaNGOS If you use an older/newer version I cannot guarantee this guide will be 100% accurate for you cd /usr/ports/databases/mysql51-server ; make -DBATCH install clean ; echo 'mysql_enable="YES"' >> /etc/rc.conf ; /usr/local/etc/rc.d/mysql-server start ; Installing git git is needed to download the MaNGOS source code from the git repository cd /usr/ports/devel/git ; make -DBATCH install clean ; Installing subversion subversion is needed to download patches, DB content, etc from 3rd-party svn repositories cd /usr/ports/devel/subversion ; make -DBATCH install clean ; Installing unrar and unzip We might need both unzip and unrar because some 3rd-party projects use zip others use rar cd /usr/ports/archivers/unrar ; make -DBATCH install clean ; cd /usr/ports/archivers/unzip ; make -DBATCH install clean ; (Optional) Installing a Text Editor I have designed this guide so that a text editor is not needed AT ALL, you only need an editor if you wish to make manual changes to your configuration files! (This guide will not cover that unfortunately) FreeBSD by default comes with vi If you want nano cd /usr/ports/editors/nano ; make -DBATCH install clean ; If you want vim cd /usr/ports/editors/vim ; make -DBATCH install clean ; Verify Dependencies We should have all the dependencies required to build MaNGOS, because the dependencies for MaNGOS were installed transparently with the previous ports that were installed. To verify this execute the following command and compare with the dependency list pkg_info ; MaNGOS Dependencies You will have more, these are only the ones we need to have * autoconf-2.62 * autoconf-wrapper-20071109 * automake-1.9.6_3 * automake-wrapper-20071109 * libtool-2.2.6b * gmake-3.81_4 * m4-1.4.14_1,1 * mysql-client-5.1.49 * openssl-1.0.0_2 * perl-5.10.1_2 Making the Environment See Everything If you skip this you will get "Command not found" errors when running git,svn,etc set path = ( $path ) ; Or just log out and back in Step 2 - Getting MaNGOS and Compiling This covers downloading MaNGOS + SD2, patching, configuring, and compiling Downloading and Patching cd ~ ; git clone git://github.com/mangos/mangos.git ; cd mangos ; svn co [url]https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2/[/url] src/bindings/ScriptDev2/ --trust-server-cert --non-interactive ; git am src/bindings/ScriptDev2/patches/MaNGOS-*-ScriptDev2.patch ; autoreconf --install --force ; automake src/bindings/ScriptDev2/Makefile ; mkdir objdir ; cd objdir ; Configuring and Compiling You may change the --prefix=/opt/mangos path, but it is recommended to keep this the same as this guide Important you must use gmake to compile MaNGOS on FreeBSD ../configure --prefix=/opt/mangos --sysconfdir=/opt/mangos/etc --enable-cli --enable-ra --datadir=/opt/mangos/data --with-openssl=/usr/local ; gmake ; gmake install ; gmake clean ; cd /opt/mangos ; Step 3 - Getting MySQL and the Databases Ready This covers configuring and securing MySQL and populating the database with data Important use your own passwords (I will not be held responsible for a hacked DB) Setting a MySQL Root Password Replace <MySQL Root Password> with your own password (This is your MySQL superuser/Admin account, do not share your password) mysqladmin -u root password "[b][color="RED"]<MySQL Root Password>[/color][/b]" ; Create the MaNGOS Databases mysql -uroot -p[b][color="RED"]<MySQL Root Password>[/color][/b] < data/mangos/sql/create_mysql.sql ; mysql -uroot -p[b][color="RED"]<MySQL Root Password>[/color][/b] < data/scriptdev2/sql/scriptdev2_create_database.sql ; Change the MySQL MaNGOS User's Password Replace <MySQL MaNGOS Password> with your own password The MySQL MaNGOS User is created in data/mangos/sql/create_mysql.sql if this ever changes I will update this echo "UPDATE user SET password=PASSWORD('[b][color="RED"]<MySQL MaNGOS Password>[/color][/b]') WHERE User='mangos';" | mysql -uroot -p[b][color="RED"]<MySQL Root Password>[/color][/b] mysql ; echo "FLUSH PRIVILEGES;" | mysql -uroot -p[b][color="RED"]<MySQL Root Password>[/color][/b] ; Populate the MaNGOS Databases From this point on we will use our MySQL MaNGOS User This second Code block may be skipped if you plan on using UDB (We drop the mangos database in that step) mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] characters < data/mangos/sql/characters.sql ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] realmd < data/mangos/sql/realmd.sql ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] scriptdev2 < data/scriptdev2/sql/scriptdev2_create_structure_mysql.sql ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] scriptdev2 < data/scriptdev2/sql/scriptdev2_script_full.sql ; MaNGOS DB You may skip this if you plan to use UDB (Next step) mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] mangos < data/mangos/sql/mangos.sql ; World Database (UDB) (Optional) I have no experience with other DB projects, and cannot give instructions for others at this time At time of writing this, UDB was compressed in zip format, if this changes use the appropriate extractor cd ~ ; mkdir udb ; cd udb ; svn co [url]https://unifieddb.svn.sourceforge.net/svnroot/unifieddb/trunk/[/url] --trust-server-cert --non-interactive ; unzip trunk/Full_DB/UDB*.zip -d trunk/Full_DB/ ; echo 'DROP DATABASE IF EXISTS mangos; \\ CREATE DATABASE mangos DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; \\ GRANT ALL PRIVILEGES ON mangos.* TO mangos@localhost WITH GRANT OPTION;' | mysql -uroot -p[b][color="RED"]<MySQL Root Password>[/color][/b] ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] mangos < trunk/Full_DB/UDB*.sql ; Important Note: This step drops the mangos database! This is because the World Database (UDB) step is optional and I did not want to remove a required command in the previous step in the event that someone may not use this, there are conflicts with data/mangos/sql/mangos.sql and queries in UDB for updating tables related to locales_* Applying World Database Updates We need to apply the UDB MaNGOS updates, because UDB has downgraded our MaNGOS database characters, realmd, and scriptdev2 are unaffected, so we do not need to update these foreach sql_file ( trunk/Updates/*_additions/*mangos*.sql ) ; echo "Applying Update - $sql_file" ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] mangos < $sql_file ; end ; MySQL Will Return Errors If you got an Error similar to the following while applying the first update ERROR 1054 (42S22) at line 2: Unknown column 'coulmn_name' in 'db_version' this is not an error, it means that the update was already applied. If you get any errors other than that one, then you did not follow the steps exactly Applying MaNGOS & Scriptdev2 Updates Only the mangos database should require any updates, because of SD2 and UDB, however the rest of the updates are still applied as a failsafe incase a commit happened to not have the master sql file updated cd /opt/mangos ; foreach sql_file ( data/mangos/sql/updates/*mangos*.sql ) ; echo "Applying Update - $sql_file" ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] mangos < $sql_file ; end ; foreach sql_file ( data/mangos/sql/updates/*characters*.sql ) ; echo "Applying Update - $sql_file" ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] characters < $sql_file ; end ; foreach sql_file ( data/mangos/sql/updates/*realmd*.sql ) ; echo "Applying Update - $sql_file" ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] realmd < $sql_file ; end ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] mangos < ~/mangos/src/bindings/ScriptDev2/sql/mangos_scriptname_full.sql ; foreach sql_file ( data/scriptdev2/sql/updates/*mangos*.sql ) ; echo "Applying Update - $sql_file" ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] mangos < $sql_file ; end ; foreach sql_file ( data/scriptdev2/sql/updates/*scriptdev2*.sql ) ; echo "Applying Update - $sql_file" ; mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] scriptdev2 < $sql_file ; end ; MySQL Will Return Errors You will get several lines similar to ERROR 1054 (42S22) at line 1: Unknown column 'coulmn_name' in 'db_version' As long as all of these errors occur only on line 1 and state that a column is unknown, this is normal. This error is the same as the one from Applying World Database Updates it means that SQL the update has already been applied MaNGOS Realmlist Address Replace <Your Realm Name> with your desired Realm Name Replace <Your Realm Address> with your Server's Address (Typically your LAN IP) echo 'UPDATE realmlist SET name = "[b][color="RED"]<Your Realm Name>[/color][/b]" WHERE id = 1; \\ UPDATE realmlist SET address = "[b][color="RED"]<Your Realm Address>[/color][/b]" WHERE id = 1;' | mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] realmd ; Step 4 - Data Files To keep things simple download and install Filezilla FTP Client on your client computer, and connect to your server using SSH (Port 22) Copy ~/mangos/contrib/extractor/ad.exe and all the files in ~/mangos/contrib/vmap_extract_assembler_bin/ to the client installation directory on your client computer Run ad.exe and makevmaps_SIMPLE.bat on your client This will take a while to finish If ad.exe fails to run, Install Microsoft's Visual C++ Redistributable Package (Google for it) Copy the vmaps/, maps/, dbc/ directories to your MaNGOS data directory on the server This guide sets this to /opt/mangos/data/ If you use Filezilla in SFTP mode and it complains your user does not have permission, temporarily give your user permission to write to the directory (We will secure this later) chown [b][color="RED"]<FreeBSD User Account>[/color][/b] /opt/mangos/data/ ; Step 5 - Editing Configuration Files The following commands will get everything configured, however if you wish to change any other values you will have to do so manually on your own with vi, vim, or nano cd /opt/mangos ; mangos.conf - Change Log Options, Disable Console, Enable RA, Use PID File sed '/DataDir[ ]*=/ s/"."/"\\/opt\\/mangos\\/data\\/"/; \\ /LogsDir[ ]*=/ s/""/"\\/opt\\/mangos\\/log\\/"/; \\ /PidFile[ ]*=/ s/""/"\\/opt\\/mangos\\/run\\/mangos-worldd.pid"/; \\ /LogLevel[ ]*=/ s/3/0/; \\ /LogFileLevel[ ]*=/ s/0/2/; \\ /Console.Enable[ ]*=/ s/1/0/; \\ /Ra.Enable[ ]*=/ s/0/1/; \\ /Ra.Stricted[ ]*=/ s/1/0/;' \\ etc/mangosd.conf.dist > etc/mangosd.conf ; realmd.conf - Change Log Options, Use PID File sed '/LogsDir[ ]*=/ s/""/"\\/opt\\/mangos\\/log\\/"/; \\ /LogFileLevel[ ]*=/ s/0/2/; \\ /PidFile[ ]*=/ s/""/"\\/opt\\/mangos\\/run\\/mangos-realmd.pid"/;' \\ etc/realmd.conf.dist > etc/realmd.conf ; scriptdev.conf - No Changes (Just need the base for now) cp etc/scriptdev2.conf.dist etc/scriptdev2.conf ; All *.conf Files - Set the MySQL Passwords sed -i "" '/DatabaseInfo[ ]*=/ s/mangos;mangos/mangos;[b][color="RED"]<MySQL MaNGOS Password>[/color][/b]/;' \\ etc/*.conf ; Create New Directories - Used for PIDs and Logs mkdir run log ; Step 6 - Testing MaNGOS for the First Time At this point you can run/test mangos and everything should work /opt/mangos/bin/mangos-realmd & ; /opt/mangos/bin/mangos-worldd & ; If there were no errors congratulations, Continue to the next steps regarding securing everything, startup/shutdown scripts, and optional configurations If you would like to test if the client can connect set your client's realmlist to match your server and login as Username: ADMINISTRATOR Password: ADMINISTRATOR (We will secure this password later) If you did get an error try and determine what the error was, If you encountered database errors you may have to do all the Database steps from scratch again. Important! Stop MaNGOS from running so we can continue pkill "mangos-*" ; Step 7 - Securing MaNGOS Change Passwords of Default Privileged Accounts echo "UPDATE account SET sha_pass_hash=UPPER(CONVERT(SHA(CONCAT(UPPER(username),':',UPPER('[b][color="RED"]<MaNGOS Administrator Password>[/color][/b]'))) USING latin1)) WHERE username='ADMINISTRATOR';" | mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] realmd ; echo "UPDATE account SET sha_pass_hash=UPPER(CONVERT(SHA(CONCAT(UPPER(username),':',UPPER('[b][color="RED"]<MaNGOS Moderator Password>[/color][/b]'))) USING latin1)) WHERE username='MODERATOR';" | mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] realmd ; echo "UPDATE account SET sha_pass_hash=UPPER(CONVERT(SHA(CONCAT(UPPER(username),':',UPPER('[b][color="RED"]<MaNGOS Gamemaster Password>[/color][/b]'))) USING latin1)) WHERE username='GAMEMASTER';" | mysql -umangos -p[b][color="RED"]<MySQL MaNGOS Password>[/color][/b] realmd ; Creating a System User to Run MaNGOS The following will create a user and group named mangos This user/group will be used to run realmd and worldd and will only have access to alter files located in /opt/mangos/run and /opt/mangos/log pw group add mangos ; pw user add mangos -g mangos -d /nonexistent -s /usr/sbin/nologin; chown -R root:wheel /opt/mangos ; chown -R root:mangos /opt/mangos/etc/*.conf ; chmod 640 /opt/mangos/etc/*.conf ; chown -R mangos:mangos /opt/mangos/log ; chown -R mangos:mangos /opt/mangos/run ; chmod 750 /opt/mangos/log ; Continued in next post!
  10. Sounds like your missing the VMap configs in mangosd.conf vmap.enableLOS = 1 vmap.enableHeight = 1 BTW those 2 options are at line 202 and line 203 in MaNGOS revision 10355
  11. The code I provided uses the field `starttime` and compares that to php's time() function. In my case the code reports the same time that MaNGOS reports with .server info Maybe your server uses one timezone while php is using another? Edit: Actually I just changed my host system / mysql to use GMT, while PHP is using CST6CDT (America/Chicago) and I was not able to reproduce any incorrect uptime values compared to what ".server info" returns [irrelevant Edits Removed]
  12. I tried that code on my server and got the same results, but then I noticed the code itself had some typos and just seemed unfinished. Here's some working code based off of the 2nd uptime example that does work <?php require_once ('config.php'); mysql_connect($host, $user, $pass) or die ("Can't connect with $host"); mysql_select_db ("$mangosrealm"); $result = mysql_query ("SELECT `starttime` FROM $mangosrealm.`uptime` ORDER BY `starttime` DESC LIMIT 1"); $curtime = time() - mysql_result($result,0,0); $sec = $curtime%(60); $min = floor(($curtime/60)%60); $hours = floor(($curtime/(60*60))%24); $days = floor($curtime/(60*60*24)); echo "Time Online: $days days $hours hrs $min min $sec sec "; ?> Edit: Changed query so that it requests only the `starttime` and none of the others
  13. Oh one other thought.. when trying to connect to your server are you using an Account Name or Email Address? Email based login will log into official server, Account will log into MaNGOS The email login going directly to official servers as opposed to whats in your realmlist.wtf is a limitation of the client not MaNGOS and there's already a discussion going on about why email based login will never work with how the client currently handles it.
  14. maybe a setting in WTF/Config.wtf is telling the client to use a locale or realmlist.wtf other than the one that you are editing. I am not completely sure on the behavior of the client, but it would have to use a file at a static location to know which realmlist.wtf file to use whether its in enUS, enGB, dede, etc my Config.wtf file has SET locale "enUS" SET portal "us" and my client reads from enUS/realmlist.wtf This again is a complete guess at this point, since I am not on my network in order to test on my clients EDIT: How exactly do you know the client is trying to connect to an official server?
  15. To make sure, are you editing the correct file @ \\Data\\enUS\\realmlist.wtf ? I've noticed on Vista and Win 7, when you install the client the data files first go into "drive:\\Program Files", but is moved later to "drive:\\Users\\Public\\Games\\" for permissions reasons. If you are using Vista/7 are you editing the correct file in? Also on vista/7 the .wtf is not located in Data\\enUS\\ anymore but up one directory in Data\\ At least this is how everything has happened on the 3 clients I have on my private network
  16. I just upgraded from 10333 to 10342, no issues on my end (i don't recall seeing any commits that affected vmaps/dbc recently either) maybe wowarmory or ahbot downgraded your master working copy when you applied patches? not sure I don't use either, I don't know the full process for adding those addons
  17. I haven't used a debian based OS for over a year, but it would be pretty straight forward to write one. Just make a simple shell script that takes in an argument and passes it to a switch-case looking for the words start,stop,restart and execute the appropriate commands. just make sure in mangosd.conf to turn on / higher your error log file reporting so in the event of a crash you have something to look at. Also you may want to configure mangos to create PID files for worldd and realmd so that you have a way of knowing their process id's without relying on pgrep or similar (also useful for multi world/realm servers)
  18. I think you should check your realmd.realmlist entries in your database the mysql command to view them would be SELECT * FROM realmd.realmlist; Although I'm not sure how familiar you are with Command Line or what SQL admin software you have There should be a column named "address", what does your database have in any of the records returned EDIT: BTW you may want to remove your MYSQL username and password from your conf you provided, just in case your mysql server is open to the public
  19. Repacks are not supported by the MaNGOS project/community. You may be better off asking in a different forum. However it maybe something simple such as the database realmlist entry not being correct, mangosd.conf not configured, etc
  20. Please don't be offended, but no one will be able to assit you with the little information you provided. Did you follow a guide to setup your server, if yes, which guide? Is the server and the client the same computer, or two separate computers? If separate did you change the realmlist entry in your database to the LAN IP of the server instead of 127.0.0.1 (also edit the client's realmlist.wtf file) There are many members here that would be glad to help, but without proper information they can only make guesses
  21. Didn't think this was appropriate for any other thread so it's going here! I would like to get some help translating some English into other languages, I don't really prefer which languages at this time, I just want to experiment with making a multi-lingual web interface for my server and other little projects. We all know how well google translate can be "I paid first tour of coffee!" where tour should have been round I'll provide a list of common English words and phrases, and I would like anyone who can accurately translate to post back the translations in their preferred language. Thanks 1 - Home 2 - About 3 - Contact 4 - My Account 5 - Help 6 - Login 7 - Logout 8 - Register 9 - Hello 10 - Good bye 11 - Thank you 12 - You have been logged in 13 - You have been logged out 14 - Invalid data provided 15 - Your account has been updated 16 - Your account has been banned/suspended 17 - There was an error processing your request If anyone can think of additional words and phrases post the English version and a non-english translation if you can
  22. @adriann54 maybe fsockopen() is trying to connect to the port on UDP, which would return true/online even when it's offline (because UDP is connectionless) Try specifying the Transport Protocol as TCP manually and see what happens $fp = fsockopen("[b]tcp://[/b]127.0.0.1","8085", $enumber, $evalue, 1) BTW when fsockopen() connects with UDP on an invalid port number, no errors are thrown and appears online even the the port is higher than 65535, so I really think this may be your issue.. although this is the first time i've seen/heard of fsockopen using UDP by default instead of TCP Here's some expanded server checking code, its only a base example and can be altered to look pretty by someone with basic php/html knowledge <?php // BEGIN User Defined Variables $locales = array( 'enUS' => array( 'OK' => "Accepting Connections", 'TIMEOUT' => "Operation Timed Out", 'REFUSED' => "Connection Refused", 'PORTLIMIT' => "Can't Assign Requested Address" ), // Other languages would go here if desired ); $use_locale = 'enUS'; $timeout = 1; // If testing a connection across the WAN, increase this value // $servers Structure "IP address","Port","Description" $servers = array( array("tcp://127.0.0.1","8085","mangosd"), // MaNGOS mangosd array("tcp://127.0.0.1","3724","realmd"), // MaNGOS realmd array("tcp://127.0.0.1","7878","RA Console"), // MaNGOS RA console array("tcp://127.0.0.1","3443","SOAP"), // MaNGOS SOAP array("tcp://127.0.0.1","80","Apache"), // Webserver apache array("tcp://127.0.0.1","3306","MySQL"), // Database mysql ); $be_verbose = false; // END User Defined Variables $errno = NULL; $errstr = NULL; foreach($servers as $value){ $fp = @fsockopen($value[0],$value[1],$errno,$errstr,1); if($fp!==FALSE){ fclose($fp); } echo $value[2] . " - "; if($be_verbose===true){ echo $value[0] . ":" . $value[1] . " - "; } switch($errno){ case 0: echo $locales[$use_locale]['OK']; break; case 49: echo $locales[$use_locale]['PORTLIMIT']; break; case 60: echo $locales[$use_locale]['TIMEOUT']; break; case 61: echo $locales[$use_locale]['REFUSED']; break; } echo " \\n"; if($be_verbose===true && $errno!==0){ echo "(" . $errno . ") " . $errstr . " \\n"; //Be verbose about errors, set $be_verbose to false to disable, true to enable } } ?>
  23. How exactly are you checking if its "Online"? <?php $fp = @fsockopen("127.0.0.1","8085"); if($fp!==FALSE){ echo "Online"; fclose($fp); }else{ echo "Offline"; } ?> Nothing fancy/pretty, but this seems to work alright for me Edit: Personally I would just check if MaNGOS is running without trying to connect to it, (`ps | grep mangos` or something similar) as testing the connection could delay your script, but if your testing if the world is connect-able by a client than that fsockopen code should work
  24. Just thought i would point out my server handles doing all of this just fine. FreeBSD 32bit Celeron 1.8ghz single core (underclocked to 1.2ghz max, and self adjusted using powerd at 0.15ghz - 0.6ghz idle) the server runs mangos/apache/mysql within a jail, and there are 4 other jails on the host system with their own instances of apache/mysql. cpu usage for entire system (all 5 virtual systems + host system) are generally around 0.1% - 5.0% ... these number are with 10 users connected at most However when compiling thats a different story, system temperature rises 5-8 degrees celsius, powerd boosts cpu to 1.198ghz, and cpu usage goes to 75% - 98.5% The point is any system should be able to handle the load of running MaNGOS/apache+php/mysql with user registration, mine uses ajax and SOAP to query the realtime position of characters within an area and displays them on a map on the webserver as an overy resource hungry example
  25. 389_updatepack_mangos.sql is the name of a UDB database update, not a MaNGOS sql update. You may have more luck finding an answer on the UDB forums (atleast I know UDB uses that naming convention, not sure about others) Only thing i can think of is that your current database is already newer than the update, which means your new database has collums that the old update does not know about. This would happen for example when the MaNGOS team changes a single data field into mutliple fields, or many other cases. Check your db_version in your databases to make sure the update can be applied, and ask at your databases provider's forums for a clearer explantion if your still stuck
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use