updated install instructions.

This commit is contained in:
phear 2005-09-06 18:22:34 +00:00
parent a5eb556ebb
commit d588b554bf
2 changed files with 45 additions and 24 deletions

35
INSTALL
View file

@ -14,5 +14,36 @@ CREATE USER name PASSWORD 'password';
ALTER USER name CREATEUSER;
#now change the user and password variables in the script
webgouser
webgopassword
#default values at beginning of psql.py:
#webgouser
#webgopassword
----------------- configuring apache2 -----------------------
Steps to do to get a runnable version:
1. apt-get install apache2 libapache2-mod-python
2. create /etc/apache2/conf.d/webgo.conf with content:
Alias /webgo /home/mtsrc/daten/projekte/webgo/
<DirectoryMatch /home/mtsrc/daten/projekte/webgo/>
AddHandler mod_python .py
PythonHandler main
PythonDebug On
</DirectoryMatch>
You should replace the directory settings for optimal results ;>
3. set ownership of webgo directory to ownership of the web server
-- since the use of mod_python this should not be needed?
--------------------------------------------------------------
this should be all.
try visiting http://localhost/webgo.main.py with a web browser.
Errors get written to /tmp/cgi_errors.log and to the webpage.

34
README
View file

@ -1,26 +1,14 @@
-------------------------------------------
WebGo Development:
------------------------------------------
developers only! this game is currently not playable!
Steps to do to get a runnable version:
1. create /etc/apache2/conf.d/webgo.conf with content:
main.py is the main script. call this from a browser.
Alias /webgo /home/mtsrc/daten/projekte/webgo/stderr.py
the init_webgo.main() in main.py reinitializes the whole database on each call, so
comment the line out if you do not want that. init_webgo also creates two test users,
gast and gast2. password = username. you can use those to log in.
------------------------------------------
some code snippets for reference:
<DirectoryMatch /home/mtsrc/daten/projekte/webgo/>
Options ExecCGI
AddHandler cgi-script .py
AllowOverride None
order allow,deny
allow from all
</DirectoryMatch>
You should replace the directory settings for optimal results ;>
2. set ownership of webgo directory to ownership of the web server
this should be all. Errors get written to ./cgi_errors.log.
-------------------------------------------
How to make the goban clickable:
data += '<form method="post">'
@ -29,11 +17,13 @@ How to make the goban clickable:
data += '</form>'
print data
How to extract the data from this POST:
How to extract the data from this POST with the cgi module:
import cgi
#get instance of fieldstorage
form = cgi.FieldStorage()
#if form == empty (which means if page is displayed for the first time):
if form.keys() != []:
#cut out the name of the clicked button
print string.split(form.keys()[0],".x")[0]
print string.split(form.keys()[0],".x")[0]
------------------------------------------