Unix Nightly Install

Installing nightly PvPGN server on UNIX
Software and files you need:
 * Cmake build system
 * PvPGN server
 * PvPGN support files
 * MySQL server (optional)

You can get the pvpgn server files from the official website (http://pvpgn.berlios.de/).

At the time the latest pvpgn server files are:
 * development – version 1.99.r577
 * pvpgn support files - version

Downloading the software and files:
From the http://www.cmake.org/ website:
 * point your browser to the above website
 * click Resouces -> Download
 * select the lastest version
 * save them on your local hard-drive

From linux console you can get the files by using the following commands: [root@mybox]# cd /usr/src – to change the current directory to /usr/src directory [root@mybox]# wget http://www.cmake.org/files/v2.6/cmake-2.6.2.tar.gz

The current pvpgn svn uses cmake to prepare the make scripts instead of the ./configure. We will compile cmake first so we are able to later compile pvpgn svn later.

From the http://pvpgn.berlios.de/ website:
 * point your browser to the above website
 * click Download -> More files...
 * select your required files (pvpgn server svn and pvpgn support files)
 * save them on your local hard-drive

From linux console you can get the files by using the following commands: [root@mybox]# wget http://download.berlios.de/pvpgn/pvpgn-199.r577.tar.gz - for the svn version [root@mybox]# wget http://download.berlios.de/pvpgn/pvpgn-support-1.2.tar.gz - for the support files

After getting the cmake and pvpgn files, we also need to download the mysql server sources in order to compile it before pvpgn server so that we can make use of the mysql storage driver from pvpgn server (optional).

You can get the free mysql server form http://dev.mysql.com/downloads/mysql/5.1.html:
 * On this page you’ll need to scroll to the bottom of page and find the source download




 * Then you must click the Pick a mirror link and select the best mirror place for your internet connection.


 * After you done that you’ll find the direct link to get your file using wget in linux, in my case:

[root@mybox]# wget ftp://ftp.astral.ro/mirrors/mysql.com/Downloads/MySQL-5.1/mysql-5.1.32.tar.gz

Extracting and installing the software and files:
After we have all this files in one place we’ll start the real job.

Firstly extract the files from their archives, this we will be done using the tar archive tool (usually comes in all linux distributions):

[root@mybox]# tar xfz cmake-2.6.2.tar.gz [root@mybox]# tar xfz pvpgn-199.r577.tar.gz [root@mybox]# tar xfz pvpgn-support-1.2.tar.gz [root@mybox]# tar xfz mysql-5.0.51b.tar.gz

After extracting all the files, you’ll have four new directories in your /usr/src directory with the following names:

/usr/src/cmake-2.6.2 /usr/src/pvpgn-199.r577 /usr/src/pvpgn-support-1.2 /usr/src/mysql-5.0.51b

First we must compile and install cmake build system:

[root@mybox]# cd cmake-2.6.2 [root@mybox]# ./bootstrap [root@mybox]# make ( if the previous step completed successfully ) [root@mybox]# make install ( if the previous step completed successfully )

Now we must compile and install mysql server (optional):

[root@mybox]# cd mysql-5.1.32 [root@mybox]# ./configure (with no arguments you’ll get the default settings and paths, please see mysql documentation for a more detailed setup INSTALL-SOURCE) [root@mybox]# make (if the previous step completed successfully) [root@mybox]# make install (if the previous step completed successfully)

After making the config file for mysql server (default it is in /etc/ with the my.cnf name) and making all the necessary dependencies like users/group and the default database, and setting up the root password for mysql (you can read a step by step how to from the INSTALL-SOURCE file locate in the /usr/src/mysql-5.1.32 directory), you can start the mysql server using the command:

[root@mybox]# mysqld_safe --user=mysql &

After issuing the above command your mysql server should be running in background (daemon).

You can check this by using the command:

[root@mybox]# ps ax | grep mysqld_safe

If everything is ok the above command should output something similar to:

32485 ?       S      0:00 /bin/sh /usr/local/dbmysql/bin/mysqld_safe --user=mysql 25641 pts/1   S+     0:00 grep mysqld_safe

If you got this up and running, then we can go further with the installation of pvpgn server itself. We must leave the mysql-5.1.32 directory and enter the pvpgn-199.r577 directory.

To change the directory and compile the pvpgn server, you must do the following:

[root@mybox]# cd ../pvpgn-199.r577/ [root@mybox]# mkdir build [root@mybox]# cd build [root@mybox]# cmake -D CMAKE_INSTALL_PREFIX=/usr/local/pvpgn/ -D WITH_MYSQL=true ../ - from inside the build folder [root@mybox]# make                                                                   - from inside the build folder [root@mybox]# make install                                                           - from inside the build folder

After completing the above steps, you need copy the support files into the required folder:

[root@mybox]# cd /usr/src/pvpgn-support-1.2    - getting in the support files directory [root@mybox]# cp * /usr/local/pvpgn/var/files/ - copying all the files from the pvpgn-support-1.2 directory to the files directory of pvpgn server.

Configuring the software and files:
After completing the above steps, you need to edit the /etc/bnetd.conf file for the pvpgn server to start. You must enter the mysql server information so that the pvpgn server can use it as a storage method (optional):

'''First you must create an empty database in the mysql server, so that it can be used be pvpgn server. Login into your mysql server to do this:'''

[root@mybox]# mysql –u root –p

After this command you’ll be asked for the mysql root user password (you set it earlier at the configure mysql step, but we’ll take for example “mysql” as password).

If you entered the correct credentials you will get a similar output:

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 599680 Server version: 5.1.32 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>

At this time you must use the following command to create a new database:

mysql>CREATE DATABASE pvpgn; mysql>quit

Now you have created an empty database named pvpgn.

Second you must create a proper entry in your /etc/bnetd.conf, which will allow pvpgn server to use the mysql server and database:

Open the /etc/bnetd.conf file in your preferred editor (I’ll use vi or vim, a text based editor):

[root@mybox]# cd /usr/local/pvpgn/etc/ [root@mybox]# vi bnetd.conf

After opening the file in the editor you must search for the default settings for storage engine.

Search for the line that is starting with:

storage_path = file:mode=plain;dir=

After you found it, you must comment it so that the pvpgn server ignores it. You can do this by a placing a # character in front, like:


 * 1) storage_path = file:mode=plain;dir=

Now you must setup your own storage engine configuration. To do it you must write in the file immediately after the above commented line:

storage_path = sql:mode=mysql;host=localhost;name=db_name;user=mysql_user;pass=mysql_pass;default=0

where: db_name is the database name – in our case – pvpgn mysql_user is the mysql user used to connect to mysql server – in our case – root mysql_pass is the mysql user password – in our case – mysql

so the entire line will be:

storage_path = sql:mode=mysql;host=localhost;name=pvpgn;user=root;pass=mysql;default=0

Starting the pvpgn server:
After completing this steps you should be able to start a minimal pvpgn server by issuing the following command:

[root@mybox]# cd /usr/local/pvpgn/sbin/ [root@mybox]# ./bnetd

You can check to see if your pvpgn is up and running by issuing:

[root@mybox]# ps ax | grep bnetd

If everything works you should see a similar output:

29730 ?       S      0:29 ./bnetd 26383 pts/1   S+     0:00 grep bnetd

'''Congratulations! You made a PvPGN Server.'''

If you encounter any problem you can check the log file generated automatically by the pvpgn server in /var/bnetd.log.

[root@mybox]# less /usr/local/pvpgn/var/bnetd.log