Operations Manual

From US Go Wiki
Jump to: navigation, search

Contents

Accessing the Site

General

EGD (Windows)

  1. Run E:\EasyPHP1-8\mysql\bin\mysqld (the DOS window will not accept input till the process terminates)
  2. Run E:\EasyPHP1-8\apache\Apache (the DOS window will not accept input till the process terminates)

AGAGD (Linux RedHat Fedora Core release 5)

Apache

The Apache configuration files are stored at and below /data/etc/httpd/conf/

Once PHP is verified and the file phpinfo.php created, as shown below, to verify that the AGAGD site works with PHP, point a web browser at http://agagd.usgo.org/phpinfo.php

MySQL

The MySQL configuration file is /data/etc/my.cnf

To access the AGAGD database, use the command

[usgo_agagd@dosaku ~]$ /usr/bin/mysql -u usgo_agagd -h localhost -p usgo_agagd
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 83407 to server version: 5.0.22-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

PHP

To verify that PHP works on the box, create this basic PHP script in the file phpinfo.php

<?php phpinfo(); ?>
<pre>
and run the command, with the following output
<pre>
[usgo_agagd@dosaku ~]$ php foo.php | more
phpinfo()
PHP Version => 5.1.6

System => Linux dosaku.ctipc.com 2.6.17-1.2157_FC5 #1 SMP Tue Jul 11 22:53:56 EDT 2006 x86_64
Build Date => May  9 2007 11:26:28
...

If you did not receive a copy of the PHP license, or have any
questions about PHP licensing, please contact license@php.net.

ssh

To access the server housing the AGAGD, use the command

%ssh usgo_agagd@dosaku.ctipc.com
Enter passphrase for key '/home/jmb/.ssh/id_dsa':
Last login: Fri Nov 21 07:02:35 2008 from c-68-49-8-198.hsd1.md.comcast.net
[usgo_agagd@dosaku ~]$

Common Operations

Stopping PHP

E:\EasyPHP1-8\mysql\bin>mysqladmin --hex-blob -h localhost -u root shutdown 

After shutdown, the DOS window captured in starting mysqld will return to accepting input

Backup

1. cd ~agagd/dev/work
2. ./Backup
3. ls -Flagtr Backup

Restore

User Management

Removing an Player Alias

Example: Kevin Zhou, AGA ID 13366, played in a single tournament as Yinan Zhou, AGA ID 13329. To remove the alias (Yinan Zhou) from the database and update Kevin Zhou, perform the following steps:

  1. Determine if the most recent games to be switch are part of a tournament that is newer than the last appearance of the proper ID. If so, update the Last_Appearance field in the players table.
  2. Note the number of tournaments and games played under each ID. (for example: Kevin Zhou 10 and 41, Yinan Zhou 1 and 5)
mysql> select count(distinct Tournament_Code) from games where Pin_Player_1 = "proper ID" or Pin_Player_2 = "proper ID";
mysql> select count(*) from games where Pin_Player_1 = "proper ID" or Pin_Player_2 = "proper ID";

mysql> select count(distinct Tournament_Code) from games where Pin_Player_1 = "alias ID" or Pin_Player_2 = "alias ID";
mysql> select count(*) from games where Pin_Player_1 = "alias ID" or Pin_Player_2 = "alias ID";
  1. Update the proper ID to include the number of games and tournaments for both IDs

mysql> update players set Tot_Tournaments = "TT", Tot_Games = "GG" where Pin_Player = "proper ID";

  1. Switch all games using the alias AGA ID to the proper AGA ID
mysql> update games set Pin_Player_1 = "proper ID" where Pin_Player_1 = "alias ID";
mysql> update games set Pin_Player_2 = "proper ID" where Pin_Player_2 = "alias ID";
  1. Verify that the proper ID has the sum of the both players games and that the alias ID has no games listed (for example: Kevin Zhou 46, Yinan Zhou 0).
  2. Remove the alias ID from the ratings table

mysql> delete from ratings where Pin_Player = "alias ID";

  1. Remove the alias ID from the biography table

mysql> delete from biography where Pin_Player = "alias ID";

  1. Remove the alias ID from the players table

mysql> delete from players where Pin_Player = "alias ID";

  1. Verify the number of tournaments and games listed in the database for the proper ID
  2. Update the Wallist for each tournament moved to show the proper name, if required.

MySQL Database

Dump Database Data

mysqladmin --hex-blob -h localhost -u root agagd > data.txt

Dump Database Schema Only

mysqladmin -d -h localhost -u root agagd > schema.txt

Status Check

mysqladmin -h localhost -u root status
Uptime: 371  Threads: 1  Questions: 5  Slow queries: 0  Opens: 6  Flush tables:
1  Open tables: 0  Queries per second avg: 0.013

Populating the Database

Smarty

Compiling Template Files

Smarty does not automatically recompile the templates. Rather you must run php against the file that references the template in order for the template to be compiled and made available to the web server (example command line: php <file_referencing_template>


American_Go_Assocation_Go_Database

Personal tools