-
Notifications
You must be signed in to change notification settings - Fork 0
/
apache.conf
44 lines (35 loc) · 1.39 KB
/
apache.conf
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
# Example configuration of WSGI service for Apache
# Place into /etc/httpd/conf.d/SERVICE_NAME.conf
# web path to the service
Define ExampleBaseLoc /example
# local directory with WSGI script and associated files
Define ExampleBaseDir /path/to/service/dir/
WSGIDaemonProcess example python-path=${ExampleBaseDir}
WSGIScriptAlias ${ExampleBaseLoc} ${ExampleBaseDir}/example.py
<Location ${ExampleBaseLoc}>
WSGIProcessGroup example
</Location>
# Allow access to the WSGI script to anyone
<Directory ${ExampleBaseDir}>
<Files example.py>
# Allow access to all
Require all granted
# Authentication using HTTP Authentication and local accounts ("htpasswd" file)
# AuthType basic
# AuthName "SERVICE_NAME"
# AuthUserFile "/path/to/htpasswd"
# Require valid-user
</Files>
</Directory>
# Static files should be served direcly by Apache, not by Flask
Alias ${ExampleBaseLoc}/static/ ${ExampleBaseDir}/static/
<Directory ${ExampleBaseDir}/static>
Require all granted
</Directory>
# API handlers
#<Location ${ExampleBaseLoc}/api>
# # Pass Authorization header (useful if auth. is done by application using API keys passed in Authorization header)
# WSGIPassAuthorization On
# # Return JSON-formatted error message in case something goes wrong.
# ErrorDocument 500 "{\"err_n\": 500, \"error\": \"Internal Server Error\"}"
#</Location>