Skip to content
Snippets Groups Projects
Commit c2b73a91 authored by mazenovi's avatar mazenovi
Browse files

mod_wsgi well documented

parent ae63aefa
Branches
No related tags found
No related merge requests found
# Ansible Boilerplate
on server
```bash
sudo apt install -y python openssh-server linux-image-extra-virtual && reboot
```
on ansible machine
```bash
ansible-playbook ispconfig.yml --extra-vars "host=isp, is_vagrant=false" --tags "quotas" --skip-tags "vagrant_context"
```
## Dependencies
- an hypervisor: [supported by vagrant](https://www.vagrantup.com/docs/providers/)
......@@ -56,13 +68,13 @@
* execute playbook on specific host
```bash
ansible-playbook ispconfig.yml --extra-vars "host=poll"
ansible-playbook ispconfig.yml --extra-vars "host=isp, is_vagrant=false" --tags "quotas" --exclude-tags "vagrant_context"
```
* execute specific tag(s) from playbook on specific host
```bash
ansible-playbook ispconfig.yml --extra-vars "host=poll" --tags "common,apt"
ansible-playbook ispconfig.yml --extra-vars "host=isp" --tags "common,apt"
```
* create a vault for your secret
......
127.0.0.1 localhost
127.0.0.1 localhost www
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
......
......@@ -73,6 +73,7 @@
- name: prevent if quotacheck already applied
raw: quotaoff -avug
when: is_vagrant
tags: [quotas, ftp, vagrant_context]
- name: scan a filesystem for disk usage, create, check and repair quota files
......
## How to deploy django site with ispconfig & mod_wsgi
1. create vhost in ispconfig (py.fr)
2. create venv (/var/www/py.fr/venv)
```
virtualenv /var/www/py.fr/venv
```
3. copy django sources (/var/www/py.fr/limos)
4. install pip packages and run django migration commands
5. add those apache directives in vhost
```
Alias /media/ /var/www/py.fr/limos/limos/media/
Alias /static/ /var/www/py.fr/limos/limos/static/
Alias /robots.txt /var/www/py.fr/limos/limos/static/robots.txt
Alias /favicon.ico /var/www/py.fr/limos/limos/static/images/favicon.ico
WSGIDaemonProcess py.fr user=web1 group=client0 python-home=/var/www/py.fr/venv python-path=/var/www/py.fr:/var/www/py.fr/venv/lib/python2.7/site-packages
WSGIProcessGroup py.fr
WSGIScriptAlias / /var/www/py.fr/limos/limos/wsgi.py
<Directory /var/www/py.fr/limos/>
Require all granted
</Directory>
<Directory /var/www/py.fr/limos/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment