
Installation instructions

This application is an open-source collection of selected texts in Ancient
Greek and English translation from the Perseus Digital Library. There are five
components:

1. Data files containing texts by Plato and Aristotle from the Perseus Digital
Library in Ancient Greek (using ASCII encoding) and English. These files are
in XML format and are located in the 'source_data' directory.

2. The installation script, db2013.py. This Python script will load and format
the XML data files and create the database and HTML files.

3. A MySQL database which stores the Greek and English texts. It is used by
db2013.py for generating HTML files and by search2013.py for retrieving search
results.

4. The search script, search2013.py. This is the Python script, located in the
CGI bin, which serves as an interface between the Web site and the database and
carries out searches entered by Web site users.

5. The HTML files which are generated by db2013.py; they utilize CSS,
JavaScript, and jQuery.

Procedure:

Follow these steps to install the database and Web site: 

1. Download and unzip db2013.zip: this will create the 'db2013' directory
where installation and data files will reside.

2. Create a MySQL database with a user with full privileges.

3. Set the following environment variables in db2013.py and search2013.py:

db2013.py environment variables:

i. target_directory: this is the path to the directory on the Web server where
HTML files will be located.
ii. db_files_target_directory: in most cases, this can be left as is - this is
where text files for creating the database will be stored.
iii. search_script_url: this is the path to the search2013.py file in the Web
server's cgi-bin directory.
iv. base_url: this is the URL that will point to the directory with index.html
and the other HTML files.
v. db_settings: database host (usually 'localhost'), user name and password,
and database name are specified here.

search2013.py environment variables:

i. base_url and db_settings: same as above
ii. search_results_html_dir: path to header and footer text files for search
results (by default, the same directory as db2013.py).

4. Place search2013.py in the cgi-bin. Make sure directory and file
permissions are correct, and make sure the path to Python at the top of the
file is correct.

5. Run 'python db2013.py' from the command line. If necessary, specify the
path to Python at the top of the script. Running the script will erase
existing Greek and English database tables (if any), create new tables,
reformat and insert data from the XML data files, and create and write the
HTML files to the directory specified by target_directory.


