File: apache.conf

package info (click to toggle)
slm 2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,504 kB
  • sloc: python: 15,349; javascript: 5,043; makefile: 184; sh: 182; xml: 57
file content (51 lines) | stat: -rw-r--r-- 1,717 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Fichier de configuration pour Apache 2.4


WSGIDaemonProcess __SERVERNAME__ python-path=/srv/__SERVERNAME__ user=www-data group=www-data

WSGIProcessGroup __SERVERNAME__

<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
    ServerName __SERVERNAME__

    ServerAdmin webmaster@localhost
    DocumentRoot /srv/__SERVERNAME__

    RewriteEngine on
    RewriteCond %{SERVER_NAME} =__SERVERNAME__
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot "/srv/__SERVERNAME__"
    ServerName __SERVERNAME__

    Alias /static/ /srv/__SERVERNAME__/static/
    <Directory /srv/__SERVERNAME__/static>
	Require all granted
    </Directory>

    Alias /media/ /srv/__SERVERNAME__/media/
    <Directory /srv/__SERVERNAME__/media>
	Require all granted
    </Directory>

    WSGIScriptAlias / /srv/__SERVERNAME__/manuels/wsgi.py process-group=__SERVERNAME__ application-group=%{GLOBAL}

     <Directory /srv/__SERVERNAME__/manuels>
	<Files wsgi.py>
	    Require all granted
	</Files>
    </Directory>
    SSLEngine on
    SSLCertificateFile	/etc/letsencrypt/live/__SERVERNAME__/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/__SERVERNAME__/privkey.pem
</VirtualHost>