diff --git a/templates/watcher/config/10-watcher-wsgi-main.conf b/templates/watcher/config/10-watcher-wsgi-main.conf index 182b48b..0b1b68e 100644 --- a/templates/watcher/config/10-watcher-wsgi-main.conf +++ b/templates/watcher/config/10-watcher-wsgi-main.conf @@ -31,9 +31,9 @@ ## WSGI configuration WSGIApplicationGroup %{GLOBAL} - WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=watcher processes=8 threads=1 user=watcher + WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=watcher processes=2 threads=1 user=watcher WSGIProcessGroup {{ $endpt }} - WSGIScriptAlias / "/var/www/cgi-bin/watcher/main" + WSGIScriptAlias / "/usr/bin/watcher-api-wsgi" {{ end }} {{ end }} diff --git a/templates/watcher/config/httpd.conf b/templates/watcher/config/httpd.conf index 3eeb8d7..7154373 100644 --- a/templates/watcher/config/httpd.conf +++ b/templates/watcher/config/httpd.conf @@ -17,6 +17,7 @@ User apache Group apache Listen {{ .APIPublicPort }} + AccessFileName .htaccess Require all denied @@ -32,6 +33,7 @@ AccessFileName .htaccess LogLevel debug EnableSendfile On + TypesConfig /etc/mime.types Include "/etc/httpd/conf.modules.d/*.conf" LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined diff --git a/templates/watcher/config/main b/templates/watcher/config/main deleted file mode 100755 index 3b2e937..0000000 --- a/templates/watcher/config/main +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/python3 -#PBR Generated from 'wsgi_scripts' - -import threading - -from watcher.api.wsgi import initialize_wsgi_app - -if __name__ == "__main__": - import argparse - import socket - import sys - import wsgiref.simple_server as wss - - parser = argparse.ArgumentParser( - description=initialize_wsgi_app.__doc__, - formatter_class=argparse.ArgumentDefaultsHelpFormatter, - usage='%(prog)s [-h] [--port PORT] [--host IP] -- [passed options]') - parser.add_argument('--port', '-p', type=int, default=8000, - help='TCP port to listen on') - parser.add_argument('--host', '-b', default='', - help='IP to bind the server to') - parser.add_argument('args', - nargs=argparse.REMAINDER, - metavar='-- [passed options]', - help="'--' is the separator of the arguments used " - "to start the WSGI server and the arguments passed " - "to the WSGI application.") - args = parser.parse_args() - if args.args: - if args.args[0] == '--': - args.args.pop(0) - else: - parser.error("unrecognized arguments: %s" % ' '.join(args.args)) - sys.argv[1:] = args.args - server = wss.make_server(args.host, args.port, initialize_wsgi_app()) - - print("*" * 80) - print("STARTING test server watcher.api.wsgi.initialize_wsgi_app") - url = "http://%s:%d/" % (server.server_name, server.server_port) - print("Available at %s" % url) - print("DANGER! For testing only, do not use in production") - print("*" * 80) - sys.stdout.flush() - - server.serve_forever() -else: - application = None - app_lock = threading.Lock() - - with app_lock: - if application is None: - application = initialize_wsgi_app() diff --git a/templates/watcher/config/mime.conf b/templates/watcher/config/mime.conf deleted file mode 100644 index ac91a1c..0000000 --- a/templates/watcher/config/mime.conf +++ /dev/null @@ -1,38 +0,0 @@ -TypesConfig /etc/mime.types - -AddType application/x-compress .Z -AddType application/x-gzip .gz .tgz -AddType application/x-bzip2 .bz2 - -AddLanguage ca .ca -AddLanguage cs .cz .cs -AddLanguage da .dk -AddLanguage de .de -AddLanguage el .el -AddLanguage en .en -AddLanguage eo .eo -AddLanguage es .es -AddLanguage et .et -AddLanguage fr .fr -AddLanguage he .he -AddLanguage hr .hr -AddLanguage it .it -AddLanguage ja .ja -AddLanguage ko .ko -AddLanguage ltz .ltz -AddLanguage nl .nl -AddLanguage nn .nn -AddLanguage no .no -AddLanguage pl .po -AddLanguage pt .pt -AddLanguage pt-BR .pt-br -AddLanguage ru .ru -AddLanguage sv .sv -AddLanguage zh-CN .zh-cn -AddLanguage zh-TW .zh-tw - -AddHandler type-map var - -AddOutputFilter INCLUDES .shtml - -AddType text/html .shtml diff --git a/templates/watcher/config/watcher-api-config.json b/templates/watcher/config/watcher-api-config.json index 3573774..64fd0b4 100644 --- a/templates/watcher/config/watcher-api-config.json +++ b/templates/watcher/config/watcher-api-config.json @@ -34,20 +34,6 @@ "owner": "root", "perm": "0640", "optional": true - }, - { - "source": "/var/lib/config-data/default/main", - "dest": "/var/www/cgi-bin/watcher/main", - "owner": "watcher", - "perm": "0640", - "optional": true - }, - { - "source": "/var/lib/config-data/default/mime.conf", - "dest": "/etc/httpd/conf.modules.d/mime.conf", - "owner": "root", - "perm": "0640", - "optional": true } ], "permissions": [