Installing WebChess on Windows
Before you can do anything else, you will need a working webserver. Any webserver that can handle PHP scripting, either as module or as CGI will be good enough to run WebChess. However, we want to advise you to use the Apache webserver, which is the most widely used webserver on the Internet. To store data, you will also need a MySQL database. All three of these programs can be acquired freely over the Internet.
- The MySQL database can be downloaded here: http://www.mysql.com
- PHP can be downloaded from here: http://www.php.net
- Apache can be downloaded from here: http://www.apache.org/
Make sure you follow the instructions for installation carefully. If you have never done this before this can be quite tricky. Therefore alternatively you can download one of these three programs as a package from several sites. This allows you for a much easier setup.
- PHPtriad: http://sourceforge.net/projects/phptriad/
- EasyPHP: http://quickeasyphp.sourceforge.net/
- XAMPP: http://www.apachefriends.org/en/xampp.html
Once everything is installed successfully you are ready to install WebChess. Use the latest version. Place the zipfile into your webserver's DocumentRoot. To find out where this is, open the configuration file for Apache (it is called httpd.conf) and look for the line that starts with DocumentRoot. Then you will have to unzip the file in that place.
Next thing is to create tables in the MySQL database. For this you will need to login to MySQL, for which you will have to open your DOS window. First you need to make sure your MySQL database is running. Refer to your manual how to do this. In your DOS window type: \path\to\mysql\bin\mysql -u root -p MySQL will now prompt you for a password. If you did not provide a password during installation, you can now simply hit enter, else type in the password you chose and then hit enter.
Congratulations you are now in MySQL! You can see this because your prompt will look like this: mysql> Next is to create the database itself. At the MySQL prompt type: create database webchess; Just include the ; along with it. Next is to let mysql know you want to use the database called webchess. Again at the MySQL prompt type: use webchess;
Next is to create the tables, of the database. These are the places that are actually going to store the data. Open up your file explorer and find the webchess directory. In there open the docs directory, and then the tables directory.
In there you will see 7 files. Leave user_permissions.txt out of it for now. For the other 6 files do the following: open them in Notepad, and copy and paste the file, starting with the create table statement, to your mysql prompt. Make sure you hit enter, after each time you have pasted the content. That's it, your database can now store chessgames.
Last thing you need to do is create a user that will access the webchess database. Again at the MySQL prompt type the following: GRANT SELECT, INSERT, UPDATE, DELETE ON webchess.* TO someusername IDENTIFIED BY 'somepassword'; Change the bold names into something specifically for you and keep it safe. One last thing to do is type: FLUSH PRIVILEGES; at the MySQL prompt.
You can now exit the MySQL database, by typing exit. This will bring you back to DOS.
One last thing to do is open the config.php file in Notepad. Config.php resides in the webchess directory. In this file you will find 4 specific entries, that you will have to change: $CFG_SERVER, $CFG_USER, $CFG_PASSWORD, $CFG_DATABASE. The first one should read localhost, unless the MySQL database is on another server as your webserver. Change $CFG_USER to what you had typed earlier for someusername, and $CFG_PASSWORD for it's password. Finally change $CFG_DATABASE to the name of your database, which is webchess. There are some other variables in here that you can change, but for the moment this will be sufficient. Save the file.
Now open up your favorite browser, and point to http://mydomain.com/webchess/index.php
That's it, you are running your own WebChess server!