How To Create a BOARD18 WEB Site

From BOARD18 Project WIKI
Revision as of 12:25, 27 July 2015 by Rich (talk | contribs) (→‎Perform these steps on your Linux web server: added stuff about game boxes)
Jump to navigation Jump to search

How to create a BOARD18 web site using Linux

These instructions assume that you already have shell access to a server environment that is running Apache with PHP version 5.3 or later and MySQL version 5.5 or later. You first have to decide whether to create a new domain for the application or to put it on a sub directory of an existing domain. In the following instructions, the directory that you choose to use will be referred to as the "web root directory" regardless of whether it is "really" a root or not.

The work of setting up a domain is well documented and quite beyond the scope of this how to. So it will be assumed that this work has been done.

Some comments about the BOARD18 MySQL Database

Before starting this procedure, you will have to create a new (empty) MYSQL database on your DB server.
How to do this varies and is beyond the scope of this how to document.

But I do suggest that you create two usernames for access to this database. The first or "root user" should have complete access to the database and should be used to create and load it. This is the username that you will put in the config.php file in the utility sub directory [see below]. The second should be limited to select, insert and update access. This is the username that you will put in the config.php file in the php sub directory of the web root directory. The board18 web application will use this second username. It is called "board18" in the supplied php/config.php file. The following commands can be used to create this username if the database resides on the web server:

 
CREATE USER 'board18'@'localhost' IDENTIFIED BY 'board18';
GRANT SELECT, INSERT, UPDATE ON board18.* TO 'board18'@'localhost'

Many web hosting providers [such as dreamhost] provide web pages that have all the capabilities needed to create a database and its associated usernames.

Perform these steps on your local PC

  • Browse to the download page and download the zip file: board18-version.zip where version is the version that you wish to have.
  • Using FTP or SCP, move this zip file to your web server.
  • The above zip file will contain game boxes for 1830 and 1870. For each aditional game box that you wish to install in board18 do the following.
    • Browse to the game box download page and download the zip file: board18-gamebox.zip where game box is the name of the game box.
    • Using FTP or SCP, move this zip file to your web server.

Perform these steps on your Linux web server

  • Create the MySQL database. See above.
  • Extract board18-version.zip into your shell root directory.
  • Move the contents of the webroot sub directory to your web root directory.
  • Create a utility directory in your shell root directory.
  • Move the contents of the utility sub directory to this new directory.
  • Edit the webroot/php/config.php file.
    • Change DB_HOST only if your DB server is different from your web server.
    • Change DB_DATABASE to the name you gave to your BOARD18 database.
    • You can also change the database user ID and password if you want.
    • Save the edited file.
  • Edit the webroot/php/configMail.php file.
    • Change MAIL_HOST to point to your SMTP server.
    • Change MAIL_USER to your mail user name on this SMTP server.
    • Change MAIL_PASS to your mail user password on this SMTP server.
    • Save the edited file.
  • Edit the utility/config.php file.
    • Change DB_HOST only if your DB server is different from your web server.
    • Change DB_DATABASE to the name you gave to your BOARD18 database.
    • Change the database user ID and password to the "root user" [see above].
    • Save the edited file.
  • For each board18-gamebox.zip file that you downloaded to the server:
    • Extract the board18-gamebox.zip file into your shell root directory.
    • Move the gamebox sub directory to the images sub directory of your web root directory.
    • Move the gamebox.json file to the utility/control sub directory of your shell root directory.

Load the BOARD18 DataBase

  • Start a command line window on the server.
  • cd to the utility directory.
  • Enter on the command line:
 
mysql -u username -ppassword -h hostname databasename < board18db.txt
  • The hostname (DB_HOST), databasename (DB_DATABASE), username and password should be those specified in the utility/config.php file.

You should now have an empty BOARD18 database. All the tables are defined but they are all empty.
The only table that should be preloaded with data is the game box table.

To preload the game box table, repeat the following steps for every boxname.json file in the utility/control directory:

  • Enter on the command line:
 
php loadGameBox.php control/boxname.json
  • For each game box you should see an output that looks something like this:
 
Successfully created game box table row 1.
The box name is 1826.
The version is REP01.
The author is Rich Price.
The date is 2013-07-15 09:26:48.

How to create a BOARD18 web site using Windows

If you have a Windows environment please modify the above Linux instructions, test them and then enter them here.

How to create a BOARD18 web site using a MAC

If you have a MAC environment please modify the above Linux instructions, test them and then enter them here.