diff --git a/roles/copr/frontend/files/httpd/coprs.conf b/roles/copr/frontend/files/httpd/coprs.conf index fca4120950..11dc062d7f 100644 --- a/roles/copr/frontend/files/httpd/coprs.conf +++ b/roles/copr/frontend/files/httpd/coprs.conf @@ -10,16 +10,8 @@ Alias /robots.txt /var/www/html/robots.txt # Needs to be above WSGIScriptAlias / - # @TODO With this configuration it needs to be accessed via [1] instead of [2] - # [1] http://127.0.0.1:8080/module-build-service/module-build-service/1/module-builds/ - # [2] http://127.0.0.1:8080/module-build-service/1/module-builds/ - - WSGIDaemonProcess module-build-service user=mbs group=mbs threads=15 display-name=module-build-service - WSGIScriptAlias /module-build-service /usr/share/copr/coprs_frontend/mbs - - WSGIProcessGroup module-build-service - - + # http://stackoverflow.com/a/9690110 + IncludeOptional /etc/httpd/conf/vhost[s]/mbs/mbs.conf WSGIDaemonProcess 127.0.0.1 user=copr-fe group=copr-fe threads=15 display-name=other WSGIDaemonProcess api user=copr-fe group=copr-fe threads=15 display-name=api diff --git a/roles/copr/mbs/files/httpd/mbs.conf b/roles/copr/mbs/files/httpd/mbs.conf new file mode 100644 index 0000000000..94dacdf311 --- /dev/null +++ b/roles/copr/mbs/files/httpd/mbs.conf @@ -0,0 +1,18 @@ +# Needs to be above WSGIScriptAlias / +# @TODO With this configuration it needs to be accessed via [1] instead of [2] +# [1] http://127.0.0.1:8080/module-build-service/module-build-service/1/module-builds/ +# [2] http://127.0.0.1:8080/module-build-service/1/module-builds/ + +WSGIDaemonProcess module-build-service user=mbs group=mbs threads=15 display-name=module-build-service +WSGIScriptAlias /module-build-service /opt/module-build-service/mbs.wsgi + + WSGIProcessGroup module-build-service + + + + WSGIApplicationGroup %{GLOBAL} + Require all granted + + +RewriteEngine On +RewriteRule ^/module/(.*)$ /module-build-service/module-build-service/$1 [PT] diff --git a/roles/copr/mbs/handlers/main.yml b/roles/copr/mbs/handlers/main.yml index 2f57b2832a..e8c3b4b57a 100644 --- a/roles/copr/mbs/handlers/main.yml +++ b/roles/copr/mbs/handlers/main.yml @@ -1,2 +1,4 @@ +- include: "{{ handlers }}/restart_services.yml" + - name: daemon reload command: systemctl daemon-reload diff --git a/roles/copr/mbs/tasks/main.yml b/roles/copr/mbs/tasks/main.yml index 301bc6f752..47a4ba235c 100644 --- a/roles/copr/mbs/tasks/main.yml +++ b/roles/copr/mbs/tasks/main.yml @@ -128,9 +128,13 @@ - name: Copy mbs.wsgi file copy: src=mbs.wsgi dest=/opt/module-build-service/mbs.wsgi -# @FIXME Use apache instead -- name: Run mbs-frontend - shell: nohup mbs-frontend < /dev/null >& /tmp/mbs-frontend.out & +- name: Create vhosts directory + file: path=/etc/httpd/conf/vhosts/mbs state=directory + +- name: Copy httpd/mbs.conf to vhosts directory + copy: src=httpd/mbs.conf dest=/etc/httpd/conf/vhosts/mbs/mbs.conf + notify: reload httpd + # Only for testing purposes