Fuente de Instalación Unix

Instalación de servidor PvPGN en UNIX
Software y archivos que necesitaras:
 * Servidor PvPGN
 * Archivos de soporte PvPGN
 * Servidor MySQL (opcional)

Puedes conseguir los archivos del servidor PvPGN desde el sitio web oficial (http://pvpgn.berlios.de/).

Hasta el momento los archivos mas recientes para el servidor pvpgn son:
 * estable – version
 * archivos pvpgn soporte - version

Descarga de software y archivos:
Desde el sitio web http://pvpgn.berlios.de/:
 * Apunta tu navegador a la página que se menciona arriba
 * pincha en Download
 * Selecciona los archivos necesarios (servidor pvpgn estable y archivos de soporte pvpgn)
 * Guárdalos en tu disco duro.

Desde la consola de linux puedes conseguir los archivos utilizando los siguientes comandos: [root@mybox]# cd /usr/src – to change the current directory to /usr/src directory [root@mybox]# wget http://download.berlios.de/pvpgn/pvpgn-1.8.5.tar.gz - for the stable version [root@mybox]# wget http://download.berlios.de/pvpgn/pvpgn-support-1.2.tar.gz - for the support files

Después de conseguir los archivos PvPGN también tenemos que descargar el código fuente del servidor MySQL con el fin de compilarlo antes que el servidor PvPGN para que podamos hacer uso del controlador de almacenamiento del servidor mysql PvPGN (opcional).

Puedes descargar gratuitamente el servidor mysql desde http://dev.mysql.com/downloads/mysql/5.1.html:
 * En esta página tendrás que desplazarte hasta el final de la página y encontrar la fuente de descarga




 * 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:
Despues de todo esto, tenemos los archivos en un solo lugar y vamos a comenzar el trabajo de verdad.

En primer lugar extraer los archivos de sus archivos, esto se hará mediante la herramienta archivo tar (por lo general viene en todas las distribuciones de linux):

[root@mybox]# tar xfz pvpgn-1.8.5.tar.gz [root@mybox]# tar xfz pvpgn-support-1.2.tar.gz [root@mybox]# tar xfz mysql-5.1.32.tar.gz

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

/usr/src/pvpgn-1.8.5 /usr/src/pvpgn-support-1.2 /usr/src/mysql-5.1.32

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-1.8.5 directory.

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

[root@mybox]# cd src/                    - from inside the pvpgn-1.8.5 folder [root@mybox]# ./configure --with-mysql   - from inside the src folder [root@mybox]# make                       - from inside the src folder [root@mybox]# make install               - from inside the src folder

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

[root@mybox]# cd ../ pvpgn-support-1.2    - getting in the support files directory [root@mybox]# cp * /var/files/            - copying all the files from the pvpgn-support-1.2 directory in the default 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 /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]# 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 ./sbin/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.