-
Notifications
You must be signed in to change notification settings - Fork 15
Installation of abstrackr on a shared host (Site5)
Shared hosting is cheap but you don't have root access to mysql or the ability to add server-wide python modules. Luckily you can still run abstrackr on a shared host by using a virtual environment. These are the steps I took to install abstrackr on a Site5 shared hosting package - they could work for other shared hosting providers.
-
Login to the Site5 control panel and create a new database and user in the SiteAdmin control panel - make a note of the name of the database, the user and the password.
-
Now login to your site5 server using ssh (make sure you enable ssh access first in the control panel) and cd to your home directory
cd ~
- Download virtualenv from https://pypi.python.org/pypi/virtualenv and extract it
wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz --no-check-certificate
tar -zxvf virtualenv-1.10.1.tar.gz
cd virtualenv-1.10.1
- create a virtual environment called (for example) myVE in the home directory and then activate it
python2.6 virtualenv.py ~/myVE
cd ~/myVE/bin
source activate
- Create the project root folder in your home directory (I called mine "abstrackr").
cd ~
mkdir abstrackr
cd abstrackr
- Install eutils
git clone https://github.com/hpiwowar/eutils
cd eutils
python setup.py build
python setup.py install
cd ..
- Install PyGoogleChart, Numpy, Biopython and Abstrackr
pip install pygooglechart
pip install numpy
pip install "biopython==1.57"
easy_install abstrackr
- Install Flup
easy_install flup
-
Copy the sample ini file to the project root folder. I called my ini file "live.ini" - (you will need to refer to this ini file in your Fast CGI server file in a couple of steps time).
-
Edit the ini file - changing the database name and password to the one you created. Change smtp_host and smtp_port to your own settings (check the Site5 SiteAdmin client e-mail information). I had to use port 2525 on Site5. Make sure debug is set to FALSE.
-
I also added the following lines to my ini file - I'm not sure if it is strictly necessary
[server:main]
use = egg:Flup#fcgi_thread
host = 0.0.0.0
port = 6500
- Now you need to build your database tables. Run the following command on your ini file from the 'project root' directory. My ini file is called "live.ini".
paster setup-app live.ini
- create a Fast CGI server file in the ~/public html directory to deploy abstrackr (I called mine "index.fcgi"). Substitute YOURUSERNAME for your own username! Change the permissions on this server file to 755.
#!/home/YOURUSERNAME/myVE/bin/python2.6
import sys
from paste.deploy import loadapp
from flup.server.fcgi_fork import WSGIServer
app = loadapp('config:/home/YOURUSERNAME/abstrackr/live.ini')
server = WSGIServer(app)
server.run()
- Add following lines to the .htaccess file in your ~/public_html directory
Options +ExecCGI
AddHandler fcgid-script .fcgi
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index\.fcgi/index\.fcgi(.*)$ index.fcgi/$1 [L]
RewriteRule ^index\.fcgi/ - [L]
RewriteRule ^(.*)$ index.fcgi/$1 [L]
- If you want to upgrade to the development version of abstrackr, then activate your virtual environment (as in step 4) then type the following command:
easy_install --upgrade abstrackr