Theater is based on the Turbogears framework and SQLObject has its ORM. So first of all you need to install this two.
To get the Turbogears framework you can simply download and install it by running the tgsetup.py script as root.
After having installed Turbogears you have to install SQLObject by running easy_install ‘SQLObject=0.9.7’
Then you can simply setup Theater itself.
By default Theater will run on a sqlite database ( to change this please read the documentation at Turbogears Page ) you can initialize the database by running two instructions.
The first will create the schema and the second one will fill it with some basic data like an admin account (Remember to change the admin password inside init_database.py before running it)
First of all run: tg-admin sql create to setup the schema, then run tg-admin shell to open a python shell with access to the created database.
From this shell import the init_database module which will perform the initialization process
amol@quasar ~/web/theater $ tg-admin sql create
Using database URI sqlite:///home/amol/wrk/theater/devdata.sqlite
amol@quasar ~/web/theater $ tg-admin shell
Python 2.5.2 (r252:60911, Aug 4 2008, 13:06:43)
>>> import init_database
Creating Groups and default admin user
2008-12-24 12:16:47,047 turbogears.identity.soprovider INFO Succesfully loaded "theater.model.User"
2008-12-24 12:16:47,048 turbogears.identity.soprovider INFO Succesfully loaded "theater.model.Group"
2008-12-24 12:16:47,048 turbogears.identity.soprovider INFO Succesfully loaded "theater.model.Permission"
2008-12-24 12:16:47,048 turbogears.identity.soprovider INFO Succesfully loaded "turbogears.identity.soprovider.TG_VisitIdentity"
DONE
>>> ^D
Do you wish to commit your database changes? [yes]y
Now simply run start-theater.py from the theater directory to have it serve the 8080 port.
Every option in theater is configured inside the dev.cfg file for development mode and prod.cfg file for production mode.
The Feng configuration file can be changed from the theater configuration file.
feng_conf = "/etc/feng.conf"
Inside Theater configuration file there is an option for the port to serve. Simply uncomment it and set it to the required value
# server.socket_port=8080
Production mode is faster but has less powerfull error detection, while in production mode the exceptions traceback won't be printed anymore and a simple 500 error will be generated.
To switch Theater in production mode copy the dev.cfg file as prod.cfg, change server.environment=“development” line to server.environment=“production” and then remove the setup.py file. (Remember to delete it as it is the one which will make theater read prod.cfg instead of dev.cfg as configuration file)
Now restart Theater to have it in production mode
To have Theater run behind an apache proxy you have to configure a Virtual Host to serve the requested uri. Then add the Proxy options:
ProxyPreserveHost on
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
As before you have to setup the Proxy to redirect the requested url to Theater.
For example if you want to serve the /media directory
ProxyPreserveHost on
ProxyPass /media http://localhost:8080/
ProxyPassReverse /media http://localhost:8080/
Now you have to tell to Theater that it is running on a different URI
To do this you have to change the theater configuration file by adding thos two lines:
base_url_filter.on = True
base_url_filter.base_url = "http://lscube.top-ix.org"
The second option has to point to the base_url of your domain (like http://lscube.top-ix.org in this case)
Then you have to tell to Theater which directory it has to serve (which is /media in this case):
server.webpath="/media"
Remember that Theater will now serve from the feng avroot only the content inside its webpath
So if you choose to have Theater serve the /media path every video file will be uploaded and looked up inside a /media subdirectory inside the feng avroot. If you have /var/feng/avroot as your avroot only files from /var/feng/avroot/media will be served. This directory has to exist.