MISP / misp-dashboard

A live dashboard for a real-time overview of threat intelligence from MISP instances
GNU Affero General Public License v3.0
194 stars 65 forks source link

WSGI Apache Reload Error, Need Correct Format for Apache Conf file #75

Closed faustus25 closed 5 years ago

faustus25 commented 6 years ago

Reinstall the dashboard according to the new MISP install guide:

https://misp.github.io/MISP/INSTALL.ubuntu1804/#misp-dashboard

Reloading the apache service fails:

 Reloading LSB: Apache2 web server.
apache2[5786]:  * Reloading Apache httpd web server apache2
apache2[5786]:  *
apache2[5786]:  * The apache2 configtest failed. Not doing anything.
apache2[5786]: Output of config test was:
apache2[5786]: AH00543: apache2: bad user name misp
apache2[5786]: Action 'configtest' failed.

Output of misp-dashboard.conf for Apache2:

<VirtualHost *:8001>
    ServerAdmin admin@admin
    ServerName misp.local
    DocumentRoot /var/www/misp-dashboard

    WSGIDaemonProcess misp-dashboard
        user=misp group=misp
        python-home=/var/www/misp-dashboard/DASHENV
        processes=1
        threads=15
        maximum-requests=5000
        listen-backlog=100
        queue-timeout=45
        socket-timeout=60
        connect-timeout=15
        request-timeout=60
        inactivity-timeout=0
        deadlock-timeout=60
        graceful-timeout=15
        eviction-timeout=0
        shutdown-timeout=5
        send-buffer-size=0
        receive-buffer-size=0
        header-buffer-size=0
        response-buffer-size=0
        server-metrics=Off
    WSGIScriptAlias / /var/www/misp-dashboard/misp-dashboard.wsgi
    <Directory /var/www/misp-dashboard>
        WSGIProcessGroup misp-dashboard
        WSGIApplicationGroup %{GLOBAL}
        Require all granted
    </Directory>
    LogLevel info
    ErrorLog /var/log/apache2/misp-dashboard.local_error.log
    CustomLog /var/log/apache2/misp-dashboard.local_access.log combined
    ServerSignature Off
</VirtualHost>

Permissisons as follows:

/var/www/misp-dashboard# ls -al
total 172
drwxr-xr-x 12 www-data www-data  4096 Nov  2 17:04 .
drwxr-xr-x  5 root     root      4096 Nov  2 17:03 ..
-rwxr-xr-x  1 www-data www-data  2573 Nov  2 17:04 clean.py
drwxr-xr-x  2 www-data www-data  4096 Nov  2 17:04 config
drwxr-xr-x  6 root     root      4096 Nov  2 17:04 DASHENV
drwxr-xr-x  3 www-data www-data  4096 Nov  2 17:04 data
drwxr-xr-x  2 www-data www-data  4096 Nov  2 17:04 doc
drwxr-xr-x  8 www-data www-data  4096 Nov  2 17:04 .git
-rwxr-xr-x  1 www-data www-data  7641 Nov  2 17:04 give_honors_to_org.py
drwxr-xr-x  2 www-data www-data  4096 Nov  2 17:04 helpers
-rwxr-xr-x  1 www-data www-data  5339 Nov  2 17:04 install_dependencies.sh
-rw-r--r--  1 www-data www-data 34520 Nov  2 17:04 LICENSE
-rw-r--r--  1 www-data www-data   185 Nov  2 17:04 misp-dashboard.wsgi
-rw-r--r--  1 www-data www-data  9243 Nov  2 17:04 README.md
-rwxr-xr-x  1 www-data www-data  2148 Nov  2 17:04 retreive_map_pic.py
drwxr-xr-x  2 www-data www-data  4096 Nov  2 17:04 screenshots
-rwxr-xr-x  1 www-data www-data 20710 Nov  2 17:04 server.py
-rwxr-xr-x  1 www-data www-data  2482 Nov  2 17:04 start_all.sh
drwxr-xr-x  6 www-data www-data  4096 Nov  2 17:04 static
drwxr-xr-x  2 www-data www-data  4096 Nov  2 17:04 templates
drwxr-xr-x  2 www-data www-data  4096 Nov  2 17:04 tests
-rw-r--r--  1 www-data www-data  3341 Nov  2 17:04 util.py
-rwxr-xr-x  1 www-data www-data  9952 Nov  2 17:04 zmq_dispatcher.py
-rwxr-xr-x  1 www-data www-data  1978 Nov  2 17:04 zmq_subscriber.py

What is the appropriate user if "misp" or "www-data" don't work?

user=misp group=misp

Originally posted by @faustus25 in https://github.com/MISP/misp-dashboard/issues/71#issuecomment-435436712

faustus25 commented 6 years ago

Also in the README section the listening port is set to 8000 rather than 8001 in the VirtualHosts directive:

<VirtualHost *:8000>
    ServerAdmin admin@misp.local
    ServerName misp.local

The current MISP install README has the correct port in its VirtualHosts directive:

echo "<VirtualHost *:8001>
    ServerAdmin admin@misp.local
    ServerName misp.local
    DocumentRoot /var/www/misp-dashboard

https://misp.github.io/MISP/INSTALL.ubuntu1804/#misp-dashboard

Could you put some more details on setting the WSGI up?

mokaddem commented 6 years ago

Thanks, I updated the README with the up to date information. However, I don't see something wrong on your configuration. Maybe @SteveClement will be able to help?

faustus25 commented 5 years ago

Reverted back to the non WSGI setup for the time being. Can reopen if tested or solution found.

pietrogu commented 3 years ago

Hi @faustus25,

i had the same problem: you need to change from

user=misp group=misp

to

user=USERNAME group=www-data

where USERNAME is the one you used for install misp