I am trying to deploy a project on windows server with Apache24 on a Windows server. I am fairly new to this but I have spent more than a week trying to figure out what I need to do and what configurations I need to put in. The server is configured to work on HTTPS with a certificate. You can assume that any request coming on 80 or 8080 port is redirected to 443 that all works fine.
The VM config:
<VirtualHost *:443>
DocumentRoot "${DOCROOT}/TIPS"
ServerName domain
SSLEngine on
SSLCertificateFile "${SRVROOT}/conf/${SSLCRT}"
SSLCertificateKeyFile "${SRVROOT}/conf/${SSLPEM}"
SSLCertificateChainFile "${SRVROOT}/conf/${SSLINTCRT}"
#SSLCACertificateFile "${SRVROOT}/conf/${SSLROOTCRT}"
<Directory "${DOCROOT}/TIPS">
Require all granted
</Directory>
<FilesMatch "\.(cgi|shtml|phtml|php|py)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "${SRVROOT}/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
WSGIScriptAlias / "path/to/wsgi.py"
# WSGIScriptAlias / "E:/wwwroot/TIPS/test.wsgi"
# Alias for static files
Alias /static "path/to/static"
Alias /media "path/to/media"
<Directory "path/to/static">
Require all granted
</Directory>
<Directory "path/to/media">
Require all granted
</Directory>
ErrorLog ${SRVROOT}/logs/error-TIPS.log
CustomLog ${SRVROOT}/logs/access-TIPS.log combined
BrowserMatch "MSIE [2-5]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
</VirtualHost>
IN the httpd.conf file there are the following relevant configurations aside from some others:
RequestHeader unset Proxy early
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
LoadFile "C:/Program Files/Python310/python310.dll"
LoadModule wsgi_module "path/to/venv/lib/site-packages/mod_wsgi/server/mod_wsgi.cp310-win_amd64.pyd"
WSGIPythonHome "path/to/venv"
WSGIPythonPath "path/to/"
The weird thing is that if i request anything from the server apart from the django python file, i.e. images, it serves them alright. As soon as i request a URL that is mapped to the django project then I get empty response. I even replaced my index view function to a simple hello world. What is more weird is that I have a custom middleware and any print statement I put in there it gets printed as it should [msgi:error] but then the request sort of vanishes and therefore returns empty response error. Anyone has any idea as to why?
Thank you in advance.