- Ensure you have
git
andmod_wsgi
installed on your box, install using yum if necessary - Install the Python
Virtualenv
package using yum - Clone this repository:
git clone https://github.com/urschrei/CDP.git
cd
to the directory (it's probably calledCDP
)- Create a new virtualenv called
venv
, by executingvirtualenv venv
- Activate it by executing
source venv/bin/activate
- Install the required Python libraries by executing
pip install -r requirements.txt
- Ensure that a MySQL database named
glyph
exists. Username and password should both beglyph
. See the section on Character Sets, below, for encoding and collation settings - Execute
fab build_db
to create the database structure and populate it. The db can also be populated by first importingdb_dumps/schema.sql
, then importingdb_dumps/glyph_latest.sql
- Open the
run.wsgi
file in an editor, and modify the first line with the full path to theactivate_this
script. For example, if you've cloned this repository into the/var/www
directory, the full path would be/var/www/CDP/venv/bin/activate_this.py
- See here for a sample Apache WSGI virtualhost
- Remember to reload Apache when you've created the new vhost.
- Install Vagrant and Virtualbox
- Clone this repository, and
cd
into it - Run
vagrant up
. This will create a new virtual machine with all necessary packages - When it's completed, run
vagrant ssh
to access the VM - Run
fab build_db
to populate the database - Run
fab run_app
to start the application in debug mode - Access the site on localhost:5000
- The site will run in production configuration on
10.11.12.15
Other fab
commands:
fab shell
: open an IPython shell with an imported app context and db instance. Queries can then be run like so:db.session.query(Cdp).join(Sign).filter(Sign.sign_ref == 'AK').all()
The database can be accessed via SSH (using e.g. Sequel Pro):
- The SSH host is 10.11.12.15
- The SSH user and password are
vagrant/vagrant
- The MySQL user is
root
, the password is blank
The application user/pass are glyph/glyph
, and the db is glyph
The search functionality requires Elasticsearch, running on port 9200.
In order to generate the index before first use, run fab elasticsearch
. Record changes and insertions should propagate to the index automatically, so long as the ORM is being used (i.e. in the normal course of things). The import script may also be run manually from a fab shell
: %run utils/elastic.py
As we're using MySQL, please pay particular attention to your DB's character encoding and collation settings, if you're setting it up manually.
For encoding, utf8mb4
should be used.
For collation, utf8mb4_bin
should be used. Binary collation is required in order to distinguish between e.g. S and Š.
This project has a DOI: 10.5281/zenodo.11647
Cite as:
Stephan Hügel (2014). Cuneiform Digital Palaeography Project (CDPP) v0.2. ZENODO.
10.5281/zenodo.11647