Advanced tutorial which describes PvPGN 1.99 installation on Linux based operation system (Debian/Ubuntu).
If you are beginner then read another article where basics in linux are described better.
Follow the detailed steps1. Get the PvPGN 1.99 source.
I recommend my git repository with good code modifications.
Easy way to download all the files from any git repository is a command "git clone".
cd /home
git clone https://github.com/pvpgn/pvpgn-server.git
It will download files to a directory with the same name as the repository: /home/pvpgn
Note: first you have to install "git" package:
apt-get install git
2. Change current path to where "src" directory is located. Create a "build" directory here and switch to it:
cd /home/pvpgn
mkdir build
cd build
3. Make sure you are installed the following packages:
apt-get install cmake make build-essential zlib1g-dev
To enable Lua scripts:
apt-get install liblua5.1-0-dev
If you need MySQL support then install 3 more packages:
apt-get install mysql-server mysql-client libmysqlclient-dev
cmake and make - it will prepare the source code to build
build-essential - build tools including c++ compiler
zlib1g-dev - zlib source headers (required when build)
libmysqlclient-dev - MySQL source headers (required when build)
mysql-server - MySQL server daemon
mysql-client - MySQL console client
You can install them one by one using syntax "apt-get [package name]".
4. Run configuration:
cmake -D CMAKE_INSTALL_PREFIX=/usr/local/pvpgn -D WITH_MYSQL=true -D WITH_LUA=true ../
-D CMAKE_INSTALL_PREFIX=/usr/local/pvpgn - a directory where PvPGN will be installed
-D WITH_MYSQL=true - optional directive that points to build with MySQL support
-D WITH_LUA=true - optional directive that points to build with Lua support
../ - relative path from the current "build" directory; also you can set a direct path /home/pvpgn/pvpgn
Note: if the configuration failed then you should fix errors and clean the "build" directory to avoid strange errors
5. Run build
make
And then create directory tree with all the required files in the installation path
make install
Now we have complete directories in /usr/local/pvpgn:
bin - utilities
sbin - pvpgn executables (bnetd, d2cs, d2dbs)
etc - configs
var - files, logs, etc.
var/files - support files
var/lua - Lua scripts
share/man - manuals
Greetings! Installation is complete.
6. (optional) Change a variable "storage_path" according to your MySQL server credentials in the main config:
nano /usr/local/pvpgn/etc/bnetd.conf
7. (optional) Create an empty database "pvpgn" using console MySQL client:
mysql -u[user] -p[pass]
create database pvpgn;
quit
8. Start PvPGN server
/usr/local/pvpgn/sbin/bnetd
9. Examine logs and make sure the server is running
less /usr/local/pvpgn/var/bnetd.log
Common errors when building and it`s solutionsCMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
apt-get install make
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
apt-get install build-essential
CMake Error at cmake/Modules/FindZLIB.cmake:44 (MESSAGE):
Could NOT find z library
apt-get install zlib1g-dev
CMake Error at cmake/Modules/FindMySQL.cmake:60 (MESSAGE):
Could NOT find MySQL library
apt-get install libmysqlclient-dev
CMake Error: The source directory "XXX" does not exist.
or
CMake Error: The source directory "XXX" does not appear to contain CMakeLists.txt
Set last parameter according to a directory where is source code "src" (look at the beggining of the article)
Attachment files (no viruses):
|