[GH-ISSUE #555] webinterface only working when starting Django manually #417

Closed
opened 2026-02-27 16:39:13 +03:00 by kerem · 6 comments
Owner

Originally created by @undee123 on GitHub (May 14, 2015).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/555

Hi!

I've set up webvirtmgr on Ubuntu 14.04.2 LTS and it works fine, but only if I start Django manually with

./manage.py runserver 0:8000

I use Apache2 as webserver with the following configuration file:

WSGISocketPrefix /var/run/apache2/wsgi
VirtualHost *:8080>
ServerAdmin webmaster@dummy-host.example.com
ServerName meinserver.xx

WSGIDaemonProcess webvirtmgr display-name=%{GROUP} python-path=/var/www/webvirtmgr
WSGIProcessGroup webvirtmgr
WSGIScriptAlias / /var/www/webvirtmgr/webvirtmgr/wsgi.py

Alias /static /var/www/webvirtmgr/webvirtmgr/static/
Alias /media /var/www/webvirtmgr/webvirtmgr/media/

<Directory /var/www/webvirtmgr/webvirtmgr>
    <Files wsgi.py>
        Order deny,allow
        Allow from all
    </Files>
</Directory>

CustomLog ${APACHE_LOG_DIR}/webvirtmgr-access_log common
ErrorLog ${APACHE_LOG_DIR}/webvirtmgr-error_log

</VirtualHost

I don't understand what I have to do to make Django start when it's needed and not just manually. Andone could give me a hint for this?

Thank you very much!!!

Originally created by @undee123 on GitHub (May 14, 2015). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/555 Hi! I've set up webvirtmgr on Ubuntu 14.04.2 LTS and it works fine, but only if I start Django manually with ./manage.py runserver 0:8000 I use Apache2 as webserver with the following configuration file: WSGISocketPrefix /var/run/apache2/wsgi VirtualHost *:8080> ServerAdmin webmaster@dummy-host.example.com ServerName meinserver.xx ``` WSGIDaemonProcess webvirtmgr display-name=%{GROUP} python-path=/var/www/webvirtmgr WSGIProcessGroup webvirtmgr WSGIScriptAlias / /var/www/webvirtmgr/webvirtmgr/wsgi.py Alias /static /var/www/webvirtmgr/webvirtmgr/static/ Alias /media /var/www/webvirtmgr/webvirtmgr/media/ <Directory /var/www/webvirtmgr/webvirtmgr> <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory> CustomLog ${APACHE_LOG_DIR}/webvirtmgr-access_log common ErrorLog ${APACHE_LOG_DIR}/webvirtmgr-error_log ``` </VirtualHost I don't understand what I have to do to make Django start when it's needed and not just manually. Andone could give me a hint for this? Thank you very much!!!
kerem closed this issue 2026-02-27 16:39:13 +03:00
Author
Owner

@retspen commented on GitHub (May 14, 2015):

Add

WSGIPythonPath /var/www/webvirtmgr

after

WSGIScriptAlias / /var/www/webvirtmgr/webvirtmgr/wsgi.py

<!-- gh-comment-id:102146907 --> @retspen commented on GitHub (May 14, 2015): Add <code>WSGIPythonPath /var/www/webvirtmgr</code> after <code>WSGIScriptAlias / /var/www/webvirtmgr/webvirtmgr/wsgi.py</code>
Author
Owner

@undee123 commented on GitHub (May 15, 2015):

Hi,

when I do that apache2 says "WSGIPythonPath cannot occur within section" and won't start.
I tried put this line before "Virtualhost", the apache2 starts, but I still get a "ERR_CONNECTION_REFUSED" from Chrome browser.

<!-- gh-comment-id:102269782 --> @undee123 commented on GitHub (May 15, 2015): Hi, when I do that apache2 says "WSGIPythonPath cannot occur within <VirtualHost> section" and won't start. I tried put this line before "Virtualhost", the apache2 starts, but I still get a "ERR_CONNECTION_REFUSED" from Chrome browser.
Author
Owner

@undee123 commented on GitHub (May 15, 2015):

I've noticed the following errors in the logs when I restart apache2:

error.log:

[Fri May 15 08:02:05.229160 2015] [:error] [pid 22212:tid 140228962477952] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
[Fri May 15 08:02:05.229160 2015] [:error] [pid 22211:tid 140228962477952] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
[Fri May 15 08:02:05.229190 2015] [:error] [pid 22212:tid 140228962477952] Traceback (most recent call last):
[Fri May 15 08:02:05.229194 2015] [:error] [pid 22211:tid 140228962477952] Traceback (most recent call last):
[Fri May 15 08:02:05.229196 2015] [:error] [pid 22212:tid 140228962477952] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown
[Fri May 15 08:02:05.229199 2015] [:error] [pid 22211:tid 140228962477952] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown
[Fri May 15 08:02:05.229496 2015] [:error] [pid 22211:tid 140228962477952] assert tlock is not None
[Fri May 15 08:02:05.229498 2015] [:error] [pid 22212:tid 140228962477952] assert tlock is not None
[Fri May 15 08:02:05.229503 2015] [:error] [pid 22211:tid 140228962477952] AssertionError:
[Fri May 15 08:02:05.229512 2015] [:error] [pid 22212:tid 140228962477952] AssertionError:
[Fri May 15 08:02:05.239300 2015] [mpm_event:notice] [pid 22207:tid 140228962477952] AH00491: caught SIGTERM, shutting down
[Fri May 15 08:02:06.274863 2015] [mpm_event:notice] [pid 22353:tid 139926236125056] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/3.4.0 configured -- resuming normal operations
[Fri May 15 08:02:06.274910 2015] [core:notice] [pid 22353:tid 139926236125056] AH00094: Command line: '/usr/sbin/apache2'

webvirtmgr-error.log:
[Fri May 15 08:02:05.255560 2015] [:error] [pid 22210:tid 140228962477952] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
[Fri May 15 08:02:05.255599 2015] [:error] [pid 22210:tid 140228962477952] Traceback (most recent call last):
[Fri May 15 08:02:05.255605 2015] [:error] [pid 22210:tid 140228962477952] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown
[Fri May 15 08:02:05.255911 2015] [:error] [pid 22210:tid 140228962477952] assert tlock is not None
[Fri May 15 08:02:05.255919 2015] [:error] [pid 22210:tid 140228962477952] AssertionError:

<!-- gh-comment-id:102272176 --> @undee123 commented on GitHub (May 15, 2015): I've noticed the following errors in the logs when I restart apache2: error.log: [Fri May 15 08:02:05.229160 2015] [:error] [pid 22212:tid 140228962477952] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'> [Fri May 15 08:02:05.229160 2015] [:error] [pid 22211:tid 140228962477952] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'> [Fri May 15 08:02:05.229190 2015] [:error] [pid 22212:tid 140228962477952] Traceback (most recent call last): [Fri May 15 08:02:05.229194 2015] [:error] [pid 22211:tid 140228962477952] Traceback (most recent call last): [Fri May 15 08:02:05.229196 2015] [:error] [pid 22212:tid 140228962477952] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown [Fri May 15 08:02:05.229199 2015] [:error] [pid 22211:tid 140228962477952] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown [Fri May 15 08:02:05.229496 2015] [:error] [pid 22211:tid 140228962477952] assert tlock is not None [Fri May 15 08:02:05.229498 2015] [:error] [pid 22212:tid 140228962477952] assert tlock is not None [Fri May 15 08:02:05.229503 2015] [:error] [pid 22211:tid 140228962477952] AssertionError: [Fri May 15 08:02:05.229512 2015] [:error] [pid 22212:tid 140228962477952] AssertionError: [Fri May 15 08:02:05.239300 2015] [mpm_event:notice] [pid 22207:tid 140228962477952] AH00491: caught SIGTERM, shutting down [Fri May 15 08:02:06.274863 2015] [mpm_event:notice] [pid 22353:tid 139926236125056] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/3.4.0 configured -- resuming normal operations [Fri May 15 08:02:06.274910 2015] [core:notice] [pid 22353:tid 139926236125056] AH00094: Command line: '/usr/sbin/apache2' webvirtmgr-error.log: [Fri May 15 08:02:05.255560 2015] [:error] [pid 22210:tid 140228962477952] Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'> [Fri May 15 08:02:05.255599 2015] [:error] [pid 22210:tid 140228962477952] Traceback (most recent call last): [Fri May 15 08:02:05.255605 2015] [:error] [pid 22210:tid 140228962477952] File "/usr/lib/python3.4/threading.py", line 1288, in _shutdown [Fri May 15 08:02:05.255911 2015] [:error] [pid 22210:tid 140228962477952] assert tlock is not None [Fri May 15 08:02:05.255919 2015] [:error] [pid 22210:tid 140228962477952] AssertionError:
Author
Owner

@retspen commented on GitHub (May 18, 2015):

I tested apache2 and mod_wsgi - work without problem.

<VirtualHost *:8080>
    ServerAdmin webmaster@myhost.com
    ServerName myhost.com

    WSGIDaemonProcess webvirtmgr display-name=%{GROUP} python-path=/var/www/webvirtmgr
    WSGIProcessGroup webvirtmgr
    WSGIScriptAlias / /var/www/webvirtmgr/webvirtmgr/wsgi.py

    Alias /static /var/www/webvirtmgr/webvirtmgr/static/
    Alias /media /var/www/webvirtmgr/webvirtmgr/media/

    <Directory /var/www/webvirtmgr/webvirtmgr>
        <Files wsgi.py>
            Order deny,allow
            Allow from all
        </Files>
    </Directory>

    CustomLog ${APACHE_LOG_DIR}/webvirtmgr-access_log common
    ErrorLog ${APACHE_LOG_DIR}/webvirtmgr-error_log
</VirtualHost>

and in file /etc/apache/ports.conf you need change Listen 80 to Listen 8080

Installed package: apache2 and libapache2-mod-wsgi

<!-- gh-comment-id:103159320 --> @retspen commented on GitHub (May 18, 2015): I tested apache2 and mod_wsgi - work without problem. ``` txt <VirtualHost *:8080> ServerAdmin webmaster@myhost.com ServerName myhost.com WSGIDaemonProcess webvirtmgr display-name=%{GROUP} python-path=/var/www/webvirtmgr WSGIProcessGroup webvirtmgr WSGIScriptAlias / /var/www/webvirtmgr/webvirtmgr/wsgi.py Alias /static /var/www/webvirtmgr/webvirtmgr/static/ Alias /media /var/www/webvirtmgr/webvirtmgr/media/ <Directory /var/www/webvirtmgr/webvirtmgr> <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory> CustomLog ${APACHE_LOG_DIR}/webvirtmgr-access_log common ErrorLog ${APACHE_LOG_DIR}/webvirtmgr-error_log </VirtualHost> ``` and in file <code>/etc/apache/ports.conf</code> you need change `Listen 80` to `Listen 8080` Installed package: apache2 and libapache2-mod-wsgi
Author
Owner

@undee123 commented on GitHub (May 19, 2015):

Hi retspen,

the change in ports.conf did it! Couldn't find this step in the wiki, maybe you could add it?

Thank you very much!

Andy

<!-- gh-comment-id:103389652 --> @undee123 commented on GitHub (May 19, 2015): Hi retspen, the change in ports.conf did it! Couldn't find this step in the wiki, maybe you could add it? Thank you very much! Andy
Author
Owner

@retspen commented on GitHub (May 19, 2015):

First version WebVirtMgr worked on Apache with mod_wsgi but always went down or hung.

<!-- gh-comment-id:103391590 --> @retspen commented on GitHub (May 19, 2015): First version WebVirtMgr worked on Apache with mod_wsgi but always went down or hung.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#417
No description provided.