This project is the code base that powers the website osucabs. This website was born in 2009 as a means to provide quick mobile access for the Campus Area Bus Service on the Ohio State University campus. Since I have since graduated from OSU (and left Ohio), I have little desire or incentive to improve upon the site. Since the site still has several hundred users per month (Google Analytics), I want to give the code back to the students that use it to improve upon it and make it better!
Word of warning: This was one of my first big python projects so I'm sure the code is a bit sloppy at times, documented poorly, and has 0% test coverage. I encourage anyone that wants to help out to do so by submitting code cleanup as well as documentation. :)
This installation guide is setup up assuming you have a brand new server compatible with Redhat Enterprise Linux (e.g. CentOS, Scientific Linux, Amazon AMI). I have tested deploying to a clean Amazon EC2 Amazon AMI Linux instance several times. Feel free to get a hold of me if you have any issues!
httpd mod_wsgi python-setuptools python-devel # Required for lxml (can be removed after lxml install) gcc # Required for lxml (can be removed after lxml install) libxslt-devel # Required for lxml (can be removed after lxml install) mongo18-10gen-server # MongoDB Server
web.py lxml pymongo
Copied from http://docs.mongodb.org/manual/tutorial/install-mongodb-on-redhat-centos-or-fedora-linux/
cat << EOF | sudo tee /etc/yum.repos.d/10gen.repo
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
enabled=1
EOF
sudo yum install -y git httpd mod_wsgi python-setuptools python-devel gcc libxslt-devel mongo18-10gen-server
sudo easy_install web.py lxml pymongo
NOTE: I don't like the fact that we have to install gcc...but it is needed for lxml.
umask 022
sudo mkdir /webdata
cd /webdata/
sudo git clone https://github.com/patrickshuff/osucabs.git
sudo cp /webdata/osucabs/osucabs_apache.conf /etc/httpd/conf.d/osucabs.conf
Apply for it here: http://trip.osu.edu/bustime/login.jsp
sudo cp /webdata/osucabs/sample_settings.py /webdata/osucabs/settings.py
sudo vim /webdata/osucabs/settings.py
sudo chkconfig mongod on
sudo service mongod start
sudo chkconfig httpd on
sudo service httpd start
The first place you should probably start (assuming you have apache installed, and the config in place) is looking at the apache error_log:
sudo less /var/log/httpd/error_log
Well the problem is likely your server is in a different timezone. Make sure your server is set up to use eastern time zone
sudo cp /usr/share/zoneinfo/US/Eastern /etc/localtime