Installing Textual Communities on your own computer
This installation is designed and tested for use on a Mac OS X computer running Mavericks. It should work on earlier Mac OS X systems (later than 10.5) also, and on Linux and Unix systems. We have not tested this for Windows computers, though all components are known to work on Windows machines. You will need to know how to use the Macintosh Terminal application (in /Applications/Utiliities on your Mac.)
Before you start, you need to install rather a lot of software on your computer:
- A working C compiler. See http://www.cyberciti.biz/faq/howto-apple-mac-os-x-install-gcc-compiler/
- The Brew system (or similar, for other systems) for installing applications from the internet. You can get this from http://brew.sh. To install brew, paste the following into the terminal:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
The versions of Python and Mysl pre-installed on the Macintosh are not adequate for our purposes. We require development tools which are not part of the standard Mac installation. We use Python as the scripting language to hold it all together, Mysql as the database to hold all data. At the terminal prompt type the following lines one at a time, hitting return after each line:
brew install python brew install mysql
At this point, you will be prompted to create a root password, by running the command mysql_secure_installation. Paste the following into the terminal, and press return:
IMPORTANT. Take note of the password you create here: you will need it later.
brew install rabbitmq brew install npm npm install -g bower brew install git brew install libjpeg
You are now ready to pull our Textual Commmunities code onto your computer. You need to create a directory on your computer into which the code will be placed:
- Create a directory from the finder in the Mac, for example TCInstall in the Applications folder (thus, with the path /Applications/TCInstall
- At the terminal: move into this directory by typing the following at the terminal prompt, and hitting the return key
Now, get the code and install it, by pasting the following lines at the terminal prompt, with a return after each line (it helps to cross your fingers at this moment).
git clone https://github.com/DigitalResearchCentre/api.git|https://github.com/DigitalResearchCentre/api.git cd api bash setup.sh
Now, presuming all is in order, we have to configure what we have loaded. Start the mysql server, by typing the following at the terminal prompt:
Not, type at the terminal prompt:
mysql -u root -p
You will be prompted for the root password you created a few steps ago. Enter this. The prompt will now change to mysql> prompt. Paste the following commands at this prompt, making sure you include the trailing semi-colon, and pressing return after each:
CREATE DATABASE api CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'api'@'localhost' IDENTIFIED BY 'api'; GRANT ALL ON api.* TO 'api'@'localhost'; exit;
You should be back at the api> prompt now. You now need to activate the virtual environment. This was created for you, within the api directory, so that Textual Communities can run in its own envelope without affecting anything else on your computer. At the terminal prompt, type or paste (followed by a return, and being sure to include the opening period)
You now should install the default specimen database which comes with this starter kit. Type the following into the terminal and press return:
mysql -u api -p api < setup/dbspecimen.sql
You will be prompted for a password. Use the password 'api' (the password for user api which you just created).
Your installation is now ready! You can now start up the various pieces which make the TC puzzle work:
- Open a new terminal window. Type rabbitmq-server into the terminal (followed by return). This starts the messaging system (you might need to give the full path to rabbitmq, typically /usr/local/sbin/rabbitmq-server)
- Start the celery server, in its own venv. Start a new terminal window. Move into the same api folder you created earlier (by cd /Applications/TCInstall/api), and type . venv/bin/activate into the terminal, and then celery worker --app=mycelery -l info (followed by return in each case)
- Go back to first terminal window, which should be showing a prompt such as "(venv)PeterMac:api". Type the following into the terminal followed by the return
python manage.py runserver & ./collatex/collatex-tools-1.5/bin/collatex-server &
You should get a happy series of messages!
If all is well: you are ready to start using the specimen database:
- Go to a web browser, and type localhost:8000 into the address bar. You should see links to the fundamental api calls underlying the whole TC system
- Type http://localhost:8000/client/index.html into your browser. You should get the base TC home page
- Click on "Sign in" in the top right. Use 'admin' for both user name and password.
- You can add users and assign them roles, etc, via the fundamental django administrative interface: localhost:8000/admin
You now have access through this interface to all the basic functions of the system.