Version 3 (modified by 9 years ago) ( diff ) | ,
---|
LCBRU Events Registration Website HowTo Install
Tags: GENVASC Study HowTo Install Pain in the proverbial UoL LAMP Server
Requirements
Before installation can start, the following packages will have to be installed by IT services:
- libmysqlclient-dev
- python-dev
Difficulties
This installations is made more difficult by 3 things:
- Suse Linux does not have mod_wsgi in its repositories, so you're going to have to compile it.
- mod_wsgi seems picky about where it picks python apps and libraries from
- The LAMP servers don't put things where you'd expect them to be.
- Some other stuff that I don't quite understand
Start Services
Start the Apache and MySQL and make sure that they are restarted when the server is rebooted.
sudo /sbin/chkconfig uol.apache2 on sudo /sbin/chkconfig uol.mysql on
Proceduce
- HowTo Compile mod_wsgi for LAMP servers
- For this install I actually just copied the mod_wsgi.so from the Telomere Length Recording Application Instance Live
- Copy the Telomere application from the
git
repository into/local/
directory. - Install virtualenv:
easy_install --install-dir=/local/python virtualenv
For some reason that I can't work out (point 4. above), it would only pick up some of the python libraries from a virtual env and not when they were installed in
/local/python/
. Maybe this was because of the order that I installed things, but I couldn't get it to work without the virtual environment.
- Create a virtual environment in the application directory.
cd /local/lcbru-events /local/python/virtualenv --no-site-packages BASELINE
BASELINE
is the name of the virtual environment. It could be called anything, but it's called that! Also note that you need to use the full path to thevirtualenv
utility, since/local/python
isn't in$PATH
.
- Activate the environment, install the required packages, then deactivate:
source BASELINE/bin/activate easy_install flask easy_install flask-sqlalchemy easy_install mysql-python easy_install flask-wtf easy_install WTForms-Components deactivate
- Load the WSGI module into Apache, by editing the file
/local/apache2/etc/loadmodule.conf
by adding this line at the end.
LoadModule wsgi_module /local/apache2/etc/mod_wsgi.so
This presumes that you've copied the compiled
mod_wsgi.so
file into the/local/apache2/etc/
directory.
- Add the WSGI config to the Apache config file
/local/apache2/etc/httpd.conf
:
<Directory /local/lcbru-events> WSGIProcessGroup lcbru-events WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> WSGIDaemonProcess lcbru-events user=wwwrun threads=5 python-path=/local/lcbru-events/BASELINE/lib/python2.6/site-packages:/local/python:/usr/lib64/python2.6/site-packages:/usr/share/doc/packages/ home=/local/lcbru-events/ WSGIScriptAlias / /local/lcbru-events/lcbru_events/app.wsgi
The two hard won things here are the values for the
python-path
andhome
arguments. Thepython-path
must contain every directory where python libraries are installed, including a sub-directory of the virtualenv directory you created earlier. Thehome
must point to your application directory, or you won't be able to pick up your own modules.
- Restart apache:
sudo /etc/init.d/uol.apache2 restart
- Pray.
Other Possible Stuff (Not done Yet)
- You may need to give
wwwrun
extra permissions to the/local/lcbru-events
directory. - You might need to pray a bit more.
setfacl -m u:wwwrun:rwx /local/lcbru-events/ setfacl -m d:u:wwwrun:rwx /local/lcbru-events/