-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem to "deploy" using mod_wsgi on windows server 2019 local network. #845
Comments
At a guess you should have:
You had it pointing at the wrong directory. It should point to the parent directory of where your project is, not the project directory itself. |
Graham, Thank you for your help and attention. New httpd.conf Alias /robots.txt "C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios/static/robots.txt" Alias /media/ "C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios/media/media" <Directory "C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios/static"> <Directory "C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios/media/media"> LoadFile "C:/Python311/python311.dll" <Directory "C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios/projeto_cad_usuarios"> |
My mistake, I just copied what you had, which was in part wrong to start with ignoring the path issue. Use:
It should only be given one argument. |
Okay, I commented out the line as below, then it returns to the previous error. Apache manages to start, but when trying to access the application through the browser, it presents the errors as in the log above and does not load the application. WSGIPythonPath / "C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios" |
I believe it's something I'm doing wrong in the httpd.conf configuration. |
At the very start of the
What is the value for |
It was the first lines of the log and errors: |
You need to make a request to the WSGI application else you will not see the message as the |
With these httpd.conf settings, is this request not being made to the wsgi application? |
Using your web browser go to the same URL you have been using to try and access the application. The output of any So did you try and access your web site or not? Also ensure that |
Ahh yes, now I understand, I'm sorry that English is not my official language in my country. |
Graham, thank you for your patience, I changed the apache configuration to info and new lines appeared in the log: [Tue Jul 04 08:41:24.304642 2023] [wsgi:info] [pid 5348:tid 1248] [client 10.32.2.250:58795] mod_wsgi (pid=5348, process='', application='localhost:81|'): Loading Python script file 'C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios/projeto_cad_usuarios/wsgi.py'. |
Graham, performing the tests I added the root folder in the line: "WSGIScriptAlias /projeto_cad_usuarios "C:/Apache24/htdocs/Cadastro/projeto_cad_usuarios/projeto_cad_usuarios/wsgi.py" after the slash. [Tue Jul 04 10:10:36.489918 2023] [mpm_winnt:notice] [pid 12816:tid 540] AH00455: Apache/2.4.57 (Win64) mod_wsgi/4.9.5.dev1 Python/3.11 configured -- resuming normal operations When I stop apache: [Tue Jul 04 10:21:36.901895 2023] [mpm_winnt:notice] [pid 12816:tid 540] AH00422: Parent: Received shutdown signal -- Shutting down the server. |
Those last of logs with the exception traceback do not show any output that I can see corresponding to the lines:
which I told you to add. Were they added? To make it more obvious, change it to:
Ensure these two lines are the very first lines in the |
My file wsgi.py import os print("PATH:", sys.path) from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'projeto_cad_usuarios.settings') I did before and now again. Below I am also sending new log: access: 10.32.2.250 - - [06/Jul/2023:08:48:14 -0400] "GET /Cadastro/ HTTP/1.1" 200 322 error: [Thu Jul 06 08:48:06.739594 2023] [mpm_winnt:notice] [pid 8536:tid 584] AH00455: Apache/2.4.57 (Win64) mod_wsgi/4.9.5.dev1 Python/3.11 configured -- resuming normal operations There really wasn't anything corresponding to the ptint. I remember that when it was still giving an error, I did a test and a print appeared in the log, but with an error status: [Tue Jul 04 09:02:45.626529 2023] [wsgi:error] [pid 5348:tid 1248] teste*****\r** |
Hi Graham.
|
Did you ever sort this out? I have been travelling and so lots of stuff got neglected. Now only back and trying to catch up. |
No solution for this problem so far. |
I've been trying to put my django application in production for weeks and I got this situation:
mod_wsgi.py
httpd.conf
Show this message on the browser:
More information about this error may be available in the server error log.
I don't know where else to go, I'm using ApacheLounge after reading your recommendation in another post.
The text was updated successfully, but these errors were encountered: