Install OSQA on webfaction
Python Shell Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.hgignore
README
backupscript.sh.tmpl
batch.sh
configureawstats.sh
configurebackup.pl
cpanel.py
createdb.sh
getsource.sh
globals.py.dist
install-webfaction-cpanel-awstats.py
install-webfaction-cpanel.py
makeenv.py
modifycron.py
modifyhttpdconf.py
modifysettings.py
modifywsgi.py
randompassword.py
startapache.sh

README

Install git latest OSQA onto a webfaction shared host.

    by Joseph Turian

Based upon the instructions here:
    http://github.com/OSQA/osqa/blob/master/INSTALL.webfaction

Instructions, only once:
    * Set up Webfaction, as described at the bottom of this file.
    * Create a mod_wsgi application to host all your OSQA sites:
            https://panel.webfaction.com/app_/create
        Name: allosqa       [globals.APPALLOSQA]
        Type: mod_wsgi 2.5/Python 2.5
    Disregard the assigned port, each OSQA will have be a custom app with its own port.
    TODO: Automate this step

Instructions for each OSQA:
    * Copy globals.py.dist to globals.py, and edit it.

    * rm moreglobals.py*

    * Run ./install-webfaction-cpanel.py

    * Get awstats cpanel configured:
        ./install-webfaction-cpanel-awstats.py

    * Get OSQA env variables:
        eval $(./makeenv.py )

    * Configure awstats:
        ./configureawstats.sh

    * Get the OSQA source + make a virtualenv:
        ./getsource.sh

    * Configure settings_local.py
        ./modifysettings.py

    * Configure database backup:
        ./configurebackup.pl

    * Configure cron jobs:
        ./modifycron.py

    * Create the database:
        ./createdb.sh
    Copying in the appropriate lines that are output at the top of the program

    * Update the httpd.conf:
        ./modifyhttpdconf.py

    * Update the wsgi file:
        ./modifywsgi.py

    * Start apache server:
        ./startapache.sh
    You might need to run this twice.

    * Copy the settings to the WEBAPPDIR:
        chmod go-rwx globals.py* moreglobals.py*
        cp globals.py moreglobals.py $OSQA_WEBAPPDIR ; chmod go-rwx $OSQA_WEBAPPDIR/globals.py $OSQA_WEBAPPDIR/moreglobals.py

    ==========
    * Combined version of above, after you have created globals.py:
        ./batch.sh 2>&1 | tee batch.log.`date +'%F-%T'`
    * If anything breaks in the middle and you have to run it manually, make sure you type:
        eval $(./makeenv.py )
    to set up the appropriate environment variables in that shell.

Note:
    * If you run the setup several times, you should look at your crontab
    and .pgpass to make sure there aren't duplicates:
        crontab -e
        vi ~/.pgpass

Webfaction setup:
    * Put the following in ~/.bashrc, then 'source ~/.bashrc':
export UTILS="$HOME/utils/"
export PATH="$PATH:$UTILS/bin"
export INCLUDE="$UTILS/include/:$INCLUDE"
export LD_LIBRARY_PATH="$UTILS/lib/:$LD_LIBRARY_PATH"
export PYTHONPATH="$UTILS/lib/python2.4/site-packages/:$PYTHONPATH"
alias easy_install="easy_install --prefix $UTILS"
    * Make a src directory
mkdir -p $UTILS/src/
    * Install git
cd $UTILS/src/
wget http://kernel.org/pub/software/scm/git/git-1.7.0.4.tar.bz2
tar jxvf git-1.7.0.4.tar.bz2
cd git-1.7.0.4
make prefix=$UTILS all
make prefix=$UTILS install
    * Install pip and virtualenv:
        easy_install --prefix=~/utils/ pip
        easy_install --prefix=~/utils/ virtualenv
    * Get source:
cd $UTILS/src/
git clone git://github.com/turian/osqa-install-webfaction.git
cd cd osqa-install-webfaction/
    * Run code, based upon instructions above.

Webfaction API documentation here:
    http://docs.webfaction.com/xmlrpc-api/tutorial.html
    http://docs.webfaction.com/xmlrpc-api/apiref.html

NOTES:
    * All OSQA sites should share one env dir (ENVDIR).

For TODO items, grep TODO in install.py
Also:
    * awstats by default
    * Google analytics by default
    * sphinx search instead of pgfulltext?
    * Check that full domain (including subdomain) is valid
    * modifycrontab.py doesn't check if the lines are already in the
    crontab, so it might add duplicates if you run it twice!
    * Toggle DEBUG mode
    * Want SERVE_MEDIA=False, and an Nginx media server
    * You should log in to the admin interface (http://DOMAIN.com/admin/),
    and go to "Sites > Sites", and change the domain name that is used in
    all emails.