... | ... | @@ -114,9 +114,11 @@ make run |
|
|
# Apache configuration
|
|
|
The apache module libapache2-mod-wsgi-py3 must be installed.
|
|
|
|
|
|
Change the owner of the application directory
|
|
|
In the following example the stock manager is installed in /opt/pao-stock-manager directory.
|
|
|
|
|
|
Change the owner of the application directory.
|
|
|
```bash
|
|
|
sudo chown -R www-data.www-data STOCK_MANAGER_PATH
|
|
|
sudo chown -R www-data.www-data /opt/pao-stock-manager
|
|
|
```
|
|
|
|
|
|
Create the configuration file, like :
|
... | ... | @@ -124,16 +126,27 @@ Create the configuration file, like : |
|
|
cd /etc/apache2
|
|
|
cat sites-available/000-stock-manager.conf
|
|
|
|
|
|
WSGIScriptAlias / /opt/pao-stock-manager/conf/wsgi.py
|
|
|
WSGIPythonHome /opt/pao-stock-manager/venv
|
|
|
WSGIPythonPath /opt/pao-stock-manager
|
|
|
|
|
|
<VirtualHost *:80>
|
|
|
Alias /static/admin/ /opt/pao-stock-manager/venv/lib/python3.6/site-packages/django/contrib/admin/static/admin/
|
|
|
Alias /static/ /opt/pao-stock-manager/stock/static/
|
|
|
|
|
|
<Directory /opt/pao-stock-manager>
|
|
|
Options FollowSymLinks MultiViews
|
|
|
AllowOverride None
|
|
|
<Files wsgi.py>
|
|
|
Require all granted
|
|
|
</Files>
|
|
|
</Directory>
|
|
|
|
|
|
<Directory /opt/pao-stock-manager/stock/static>
|
|
|
Require all granted
|
|
|
</Directory>
|
|
|
|
|
|
<Directory /opt/pao-stock-manager/venv/lib/python3.6/site-packages/django/contrib/admin/static/admin>
|
|
|
Require all granted
|
|
|
</Directory>
|
|
|
</VirtualHost>
|
|
|
|
|
|
ls -al sites-enabled/
|
... | ... | @@ -142,5 +155,3 @@ drwxr-xr-x 2 root root 4096 mai 2 18:59 . |
|
|
drwxr-xr-x 8 root root 4096 mai 1 08:31 ..
|
|
|
lrwxrwxrwx 1 root root 41 mai 2 18:59 000-stock-manager.conf -> ../sites-available/000-stock-manager.conf
|
|
|
``` |
|
|
|
|
|
Replace the default configuration file : |