Changes between Initial Version and Version 1 of LCBRU Events Registration Website HowTo Install


Ignore:
Timestamp:
10/07/15 11:13:32 (9 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LCBRU Events Registration Website HowTo Install

    v1 v1  
     1= LCBRU Events Registration Website HowTo Install
     2
     3Tags: [[GENVASC Study]] [[HowTo]] [[Install]] [[Pain in the proverbial]] [[UoL LAMP Server]]
     4
     5== Requirements
     6
     7Before installation can start, the following packages will have to be installed by IT services:
     8
     9- libmysqlclient-dev
     10- python-dev
     11
     12== Difficulties
     13
     14This installations is made more difficult by 3 things:
     15
     161. Suse Linux does not have mod_wsgi in its repositories, so you're going to have to compile it.
     172. mod_wsgi seems picky about where it picks python apps and libraries from
     183. The LAMP servers don't put things where you'd expect them to be.
     194. Some other stuff that I don't quite understand
     20
     21== Proceduce
     22
     231. [[HowTo Compile mod_wsgi for LAMP servers]]
     24 - For this install I actually just copied the mod_wsgi.so from the [[Telomere Length Recording Application Instance Live]]
     252. Copy the Telomere application from the `git` repository into `/local/` directory.
     263. Install virtualenv:
     27
     28{{{
     29easy_install --install-dir=/local/python virtualenv
     30}}}
     31
     32    ''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.''
     334. Create a virtual environment in the application directory.
     34
     35{{{
     36cd /local/lcbru-events
     37/local/python/virtualenv --no-site-packages BASELINE
     38}}}
     39
     40    ''`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 the `virtualenv` utility, since `/local/python` isn't in `$PATH`.''
     41
     425. Activate the environment, install the required packages, then deactivate:
     43
     44{{{
     45source BASELINE/bin/activate
     46easy_install flask
     47easy_install flask-sqlalchemy
     48easy_install mysql-python
     49easy_install flask-wtf
     50easy_install WTForms-Components
     51deactivate
     52}}}
     53
     546. Load the WSGI module into Apache, by editing the file `/local/apache2/etc/loadmodule.conf` by adding this line at the end.
     55
     56{{{
     57LoadModule wsgi_module /local/apache2/etc/mod_wsgi.so
     58}}}
     59
     60    ''This presumes that you've copied the compiled `mod_wsgi.so` file into the `/local/apache2/etc/` directory.''
     61
     627. Add the WSGI config to the Apache config file `/local/apache2/etc/httpd.conf`:
     63
     64{{{
     65<Directory /local/lcbru-events>
     66    WSGIProcessGroup lcbru-events
     67    WSGIApplicationGroup %{GLOBAL}
     68    Order deny,allow
     69    Allow from all
     70</Directory>
     71
     72WSGIDaemonProcess 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/
     73WSGIScriptAlias / /local/lcbru-events/lcbru_events/app.wsgi
     74}}}
     75
     76    ''The two hard won things here are the values for the `python-path` and `home` arguments.  The `python-path` must contain every directory where python libraries are installed, including a sub-directory of the virtualenv directory you created earlier.  The `home` must point to your application directory, or you won't be able to pick up your own modules.''
     77
     788. Restart apache:
     79
     80{{{
     81sudo /etc/init.d/uol.apache2 restart
     82}}}
     83
     849. Pray.
     85
     86== Other Possible Stuff (Not done Yet)
     87
     881. You may need to give `wwwrun` extra permissions to the `/local/lcbru-events` directory.
     892. You might need to pray a bit more.
     90
     91{{{
     92setfacl -m u:wwwrun:rwx /local/lcbru-events/
     93setfacl -m d:u:wwwrun:rwx /local/lcbru-events/
     94}}}
     95
     96[[BackLinks]]