Look in the main Apache error log file (not virtual host) and see if there is a message there about 'Segmentation fault' or something else that suggests the daemon process crashed. If yes, what are those messages from the main Apache error log file.
> On 13 Dec 2018, at 10:36 pm, Anderson Marques <[email protected]> wrote: > > Thanks for the answer Graham Dumpleton, the amount of memory was an act of > desperation, hehehe .... > I made the changes you said, now I'm having the following error exit: > > [Thu Dec 13 09:22: 01.073929 2018] [wsgi: info] [pid 58228] [remote > 172.30.212.65:52348 <http://172.30.212.65:52348/>] mod_wsgi (pid = 58228, > process = 'face', application = ''): Loading Python script file > '/var/www/html/face/app/wsgi.py'. > [Wsgi: error] [pid 58236] [client 172.30.212.65:52348 > <http://172.30.212.65:52348/>] Truncated or oversized response headers > received from daemon process 'face': / var / www / html / face / app / > wsgi.py, referer: http://172.30.212.76/admin/ <http://172.30.212.76/admin/> > [Thu Dec 13 09: 22: 02.630914 2018] [wsgi: info] [pid 58846] mod_wsgi (pid = > 58846): Attach interpreter ''. > [Thu Dec 13 09: 22: 02.640802 2018] [wsgi: info] [pid 58846] mod_wsgi (pid = > 58846): Adding '/var/www/html/face/venv/lib/python3.7/site-packages' to path. > > > > I realized that the error occurs when I import the openvc library, "import > cv2", if I take the application works and the error no longer appears. > > Thank you for the attention to my problem, thank you very much. > > Em qua, 12 de dez de 2018 às 19:19, Graham Dumpleton > <[email protected] <mailto:[email protected]>> escreveu: > See comments below. > >> On 12 Dec 2018, at 11:06 pm, Anderson Marques <[email protected] >> <mailto:[email protected]>> wrote: >> >> Hi, I'm implementing a rest for face recognition using django rest full, >> apache 2.4, python 3.7, wsgi 4.6.5, dlib and opencv running on a centos 7.5, >> but I'm having the following error: >> >> File "/var/www/html/facepy/facedetect/wsgi.py", line 40, in <module> >> [Wed Dec 12 09: 51: 15.345039 2018] [wsgi: error] [pid 75969] application = >> get_wsgi_application () >> [Wed Dec 12 09: 51: 15.345048 2018] [wsgi: error] [pid 75969] File >> "/var/www/html/facepy/venv/lib/python3.7/site-packages/django/core/wsgi.py >> ", line 12, in get_wsgi_application >> [Wed Dec 12 09: 51: 15.345053 2018] [wsgi: error] [pid 75969] django.setup >> (set_prefix = False) >> [Wed Dec 12 09: 51: 15.345062 2018] [wsgi: error] [pid 75969] File >> "/var/www/html/facepy/venv/lib/python3.7/site-packages/django/__init__.py", >> line 19, in setup >> [Wed Dec 12 09: 51: 15.345066 2018] [wsgi: error] [pid 75969] >> configure_logging (settings.LOGGING_CONFIG, settings.LOGGING) >> [Wed Dec 12 09: 51: 15.345074 2018] [wsgi: error] [pid 75969] File >> "/var/www/html/facepy/venv/lib/python3.7/site-packages/django/conf/__init__.py >> ", line 57, in __getattr__ >> [Wed Dec 12 09: 51: 15.345079 2018] [wsgi: error] [pid 75969] self._setup >> (name) >> [Wed Dec 12 09: 51: 15.345087 2018] [wsgi: error] [pid 75969] File >> "/var/www/html/facepy/venv/lib/python3.7/site-packages/django/conf/__init__.py >> ", line 44, in _setup >> [Wed Dec 12 09: 51: 15.345100 2018] [wsgi: error] [pid 75969] self._wrapped >> = Settings (settings_module) >> [Wed Dec 12 09: 51: 15.345109 2018] [wsgi: error] [pid 75969] File >> "/var/www/html/facepy/venv/lib/python3.7/site-packages/django/conf/__init__.py >> ", line 107, in __init__ >> [Wed Dec 12 09: 51: 15.345113 2018] [wsgi: error] [pid 75969] mod = >> importlib.import_module (self.SETTINGS_MODULE) >> [Wed Dec 12 09: 51: 15.345122 2018] [wsgi: error] [pid 75969] File >> "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module >> [Wed Dec 12 09: 51: 15.345126 2018] [wsgi: error] [pid 75969] return >> _bootstrap._gcd_import (name [level:], package, level) >> [Wed Dec 12 09: 51: 15.345134 2018] [wsgi: error] [pid 75969] File "<frozen >> importlib._bootstrap>", line 1006, in _gcd_import >> [Wed Dec 12 09: 51: 15.345143 2018] [wsgi: error] [pid 75969] File "<frozen >> importlib._bootstrap>", line 983, in _find_and_load >> [Wed Dec 12 09: 51: 15.345151 2018] [wsgi: error] [pid 75969] File "<frozen >> importlib._bootstrap>", line 953, in _find_and_load_unlocked >> [Wed Dec 12 09: 51: 15.345160 2018] [wsgi: error] [pid 75969] File "<frozen >> importlib._bootstrap>", line 219, in _call_with_frames_removed >> [Wed Dec 12 09: 51: 15.345168 2018] [wsgi: error] [pid 75969] File "<frozen >> importlib._bootstrap>", line 1006, in _gcd_import >> [Wed Dec 12 09: 51: 15.345177 2018] [wsgi: error] [pid 75969] File "<frozen >> importlib._bootstrap>", line 983, in _find_and_load >> [Wed Dec 12 09: 51: 15.345185 2018] [wsgi: error] [pid 75969] File "<frozen >> importlib._bootstrap>", line 965, in _find_and_load_unlocked >> [Wed Dec 12 09: 51: 15.345205 2018] [wsgi: error] [pid 75969] >> ModuleNotFoundError: >> [Wsgi: error] [pid 75969] [remote 172.30.212.65:63731 >> <http://172.30.212.65:63731/>] mod_wsgi (pid = 75969): Target WSGI script '/ >> var / www / html / facepy / facedetect / wsgi.py 'does not contain WSGI >> application' application '. >> >> the facepy.conf file looks like this: >> <VirtualHost *: 80> >> ServerName facepy >> ErrorLog /var/log/httpd/errorface.log >> >> DocumentRoot / var / www / html / facepy >> WSGIScriptAlias ??/var/www/html/facepy/facedetect/wsgi.py >> <Directory / var / www / html / facepy / facedetect> >> <Files wsgi.py> >> Require all granted >> </ Files> >> </ Directory> >> >> # adjust the following line to match your Python path >> WSGIDaemonProcess face processes = 2 threads = 95 display-name =% {GROUP} >> user = apache group = apache header-buffer-size = 99255932768 python-home = >> / var / www / html / facepy / venv python-path = / var / www / html / facepy >> / venv / lib / python3.7 / site-packages > > Don't know why you are doing it, but you should not be adding > 'header-buffer-size=99255932768' option like that. That is a ridiculously > large size to use and could result in failures as tries to allocate that > amount of memory. > > As part of solution to you problem, although you might not even need it, add > the option: > > startup-timeout=15 > >> >> <directory / var / www / html / facepy> >> WSGIProcessGroup face >> WSGIApplicationGroup% {GLOBAL} >> WSGIScriptReloading On > > You don't need 'WSGIScriptReloading On' as that is the default. > >> Require all granted >> </ directory> >> >> Alias ??/ static / / var / www / html / facepy / static / >> >> <Directory / var / www / html / facepy / static> >> Require all granted >> </ Directory> >> </ VirtualHost> >> >> >> the wsgi.py file >> import >> import time >> import traceback >> import signal >> import sys >> >> from django.core.wsgi import get_wsgi_application >> >> # sys.path.append ('/ var / www / html / facepy') >> # adjust the Python version in the line below as needed >> sys.path.append ('/ var / www / html / facepy / venv / lib / python3.7 / >> site-packages') >> >> # os.environ.setdefault ("DJANGO_SETTINGS_MODULE", "facedetect.settings") >> os.environ ['DJANGO_SETTINGS_MODULE'] = 'facedetect.settings' >> >> try: >> application = get_wsgi_application () >> except Exception: >> # Error loading applications >> if 'mod_wsgi' in sys.modules: >> traceback.print_exc () >> os.kill (os.getpid (), signal.SIGINT) >> time.sleep (2.5) > > Replace this whole try/except block with just: > > application = get_wsgi_application() > > The startup-timeout option above is better solution for failures on reentrant > import failures which that code trick was likely for. It is that code which > is likely causing your problems because there is a path through the code > which can result in application not being defined, but no error being > generated. > >> >> >> Someone could tell me what I'm doing wrong. >> >> Thank you very much in advance. >> >> ps I'm in Brazil, I'm sorry English >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <mailto:[email protected]>. >> To post to this group, send email to [email protected] >> <mailto:[email protected]>. >> Visit this group at https://groups.google.com/group/modwsgi >> <https://groups.google.com/group/modwsgi>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/modwsgi > <https://groups.google.com/group/modwsgi>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > Visit this group at https://groups.google.com/group/modwsgi > <https://groups.google.com/group/modwsgi>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
