Skip to content
jlgarciapacheco edited this page May 17, 2018 · 25 revisions

Installation of Apache TBD (here rather than 2. installation of packages y tal y tal..?)

In order to install the Apache web server, use the YUM package manager:

yum install httpd httpd-devel

(NOTE: httpd-devel may be needed for python module 'mod_wgsi')

Configuration of Apache

Check wsgi installation and Apache configuration.

## Checks good installation
mod_wsgi-express start-server
## This command outputs configuration line for module loading in system Apache.
mod_wsgi-express module-config

Edit Apache configuration file:

vim /etc/httpd/conf/httpd.conf

Append the following information at the bottom of the LoadModule block:

## Load wsgi module with library associated in virtualenv
LoadModule wsgi_module "/srv/iSkyLIMS/virtualenv/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"

Add the following lines at the end of the file:

## Django iSkyLIMS site configuration
# Socket prefix for socket file storage (permissions issues in Linux)
WSGISocketPrefix /var/run/wsgi
# Path to serve your app at and wsgi script path
WSGIScriptAlias / /srv/iSkyLIMS/iSkyLIMS/wsgi.py
# Path to virtualenv
WSGIPythonHome /srv/iSkyLIMS/virtualenv
# Ensures your project package is available for import on the Python Path.
WSGIPythonPath /srv/iSkyLIMS

# Directory piece. This ensures that apache can access wsgi.py script.
<Directory /srv/iSkyLIMS/iSkyLIMS>
        <Files wsgi.py>
                ## This lines work for Apache 2.2 version. For 2.4 this sintaxix changes.
                Satisfy Any
                Allow from all
        </Files>
</Directory>
    
# Lines for serving static files (This could be done with nginx instead of Apache)
Alias /static /srv/iSkyLIMS/static
<Directory /srv/iSkyLIMS/static>
## This lines work for Apache 2.2 version. For 2.4 this sintaxis changes.
   Satisfy Any
   Allow from all
</Directory>
Alias /documents /srv/iSkyLIMS/documents
<Directory /srv/iSkyLIMS/documents>
   ## This lines work for Apache 2.2 version. For 2.4 this sintaxis changes.
   Satisfy Any
   Allow from all
</Directory>

Start the httpd server:

service httpd start
```Bash
Remark: SELINUX must be ‘disabled’
Clone this wiki locally