... | ... | @@ -143,17 +143,64 @@ chmod g+w db.sqlite3 |
|
|
```
|
|
|
|
|
|
# auto signed certificat for apache2
|
|
|
```bash
|
|
|
sudo a2enmod ssl
|
|
|
```
|
|
|
|
|
|
Document from the website https://www.linuxtricks.fr/wiki/wiki.php?id_contents=1028
|
|
|
|
|
|
```bash
|
|
|
export WEBSITE=XXX
|
|
|
export domaine=XXX
|
|
|
cd /etc/ssl
|
|
|
sudo mkdir $WEBSITE
|
|
|
cd $WEBSITE
|
|
|
sudo openssl genrsa -out $WEBSITE.key 2048
|
|
|
sudo openssl req -new -key $WEBSITE.key -out $WEBSITE.csr
|
|
|
sudo mkdir $domaine
|
|
|
cd $domaine
|
|
|
sudo openssl genrsa -out $domaine.key 2048
|
|
|
sudo openssl req -new -key $domaine.key -out $domaine.csr
|
|
|
...
|
|
|
Common Name (e.g. server FQDN or YOUR name) []:$WEBSITE
|
|
|
Common Name (e.g. server FQDN or YOUR name) []:$domaine
|
|
|
...
|
|
|
sudo openssl x509 -req -days NUMBER_DAYS -in $WEBSITE.csr -signkey $WEBSITE.key -out $WEBSITE.crt
|
|
|
|
|
|
cat /etc/apache2/sites-available/000-stock-manager-ssl.conf
|
|
|
<IfModule mod_ssl.c>
|
|
|
WSGIScriptAlias / /opt/pao-stock-manager/conf/wsgi.py
|
|
|
WSGIPythonHome /opt/pao-stock-manager/.venv
|
|
|
WSGIPythonPath /opt/pao-stock-manager
|
|
|
<VirtualHost *:443>
|
|
|
ServerName fbcmecanique-rouen.fr
|
|
|
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>
|
|
|
<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>
|
|
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
|
SSLEngine on
|
|
|
|
|
|
SSLCertificateFile /etc/ssl/fbcmecanique-rouen.fr/fbcmecanique-rouen.fr.crt
|
|
|
SSLCertificateKeyFile /etc/ssl/fbcmecanique-rouen.fr/fbcmecanique-rouen.fr.key
|
|
|
|
|
|
<FilesMatch "\.(cgi|shtml|phtml|php)$">
|
|
|
SSLOptions +StdEnvVars
|
|
|
</FilesMatch>
|
|
|
<Directory /usr/lib/cgi-bin>
|
|
|
SSLOptions +StdEnvVars
|
|
|
</Directory>
|
|
|
</VirtualHost>
|
|
|
</IfModule>
|
|
|
|
|
|
$ ls -al /etc/apache2/sites-enabled/000-stock-manager-ssl.conf
|
|
|
lrwxrwxrwx 1 root root 45 févr. 19 13:47 /etc/apache2/sites-enabled/000-stock-manager-ssl.conf -> ../sites-available/000-stock-manager-ssl.conf
|
|
|
|
|
|
``` |
|
|
\ No newline at end of file |