-
Notifications
You must be signed in to change notification settings - Fork 34
Apache
luissian edited this page Jul 26, 2018
·
25 revisions
To install the Apache web server, use the YUM package manager:
yum install httpd httpd-devel
(NOTE: httpd-devel is needed for python module 'mod_wgsi')
cd /srv/iSkyLIMS
source virtualenv/bin/activate
pip install mod-wsgi
deactivate
Check wsgi installation and Apache configuration.
## Checks good installation (it can take a while)
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>
./manage.py collectstatic
service httpd start
In case that selinux is installed in your system, check /etc/selinux/conf: SELINUX must be ‘disabled’