Skip to content

Commit

Permalink
httpd.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
stuggi committed Dec 12, 2023
1 parent 57f1e91 commit 8fd8aa2
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions templates/placementapi/config/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ Listen 8778
TypesConfig /etc/mime.types

Include conf.modules.d/*.conf
# XXX: To disable SSL
#+ exec /usr/sbin/httpd
#AH00526: Syntax error on line 85 of /etc/httpd/conf.d/ssl.conf:
#SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist or is empty
#Include conf.d/*.conf
# TODO: remove /etc/httpd/conf.d/00-placement-api.conf from image, so we can not just conf.d/* before
# this is removed
Include conf.d/ssl.conf

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
Expand All @@ -37,6 +35,16 @@ CustomLog /dev/stdout proxy env=forwarded
ServerName {{ $vhost.ServerName }}

## Vhost docroot
DocumentRoot "/var/www/cgi-bin/placement"

## Directories, there should at least be a declaration for /var/www/cgi-bin/placement
<Directory "/var/www/cgi-bin/placement">
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride None
Require all granted
</Directory>

## Logging
ErrorLog /dev/stdout
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /dev/stdout combined env=!forwarded
Expand All @@ -53,27 +61,12 @@ CustomLog /dev/stdout proxy env=forwarded
SSLCertificateKeyFile "{{ $vhost.SSLCertificateKeyFile }}"
{{- end }}

## Directories, there should at least be a declaration for /var/www/cgi-bin/placement
<Directory "/var/www/cgi-bin/placement">
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride None
Require all granted
</Directory>

## WSGI configuration
WSGIProcessGroup placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} processes=3 threads=1 user=placement group=placement
WSGIProcessGroup {{ $endpt }}
WSGIScriptAlias / "/usr/bin/placement-api"
WSGIPassAuthorization On
WSGIDaemonProcess placement-api processes=3 threads=1 user=placement group=placement
WSGIScriptAlias / /usr/bin/placement-api
</VirtualHost>
{{ end }}

Alias /placement-api /usr/bin/placement-api
<Location /placement-api>
SetHandler wsgi-script
Options +ExecCGI
WSGIProcessGroup placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
</Location>

0 comments on commit 8fd8aa2

Please sign in to comment.