On Windows created a getting started Django app (Rocket screen..). Implemented serving the Django app locally via Apache according to this guide. Followed all the previous threads here in stack. Result:
localhost:8000
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
httpd -e debug
[Thu Feb 08 19:44:25.462095 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module actions_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_actions.so
[Thu Feb 08 19:44:25.463099 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module alias_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_alias.so
[Thu Feb 08 19:44:25.465112 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module allowmethods_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_allowmethods.so
[Thu Feb 08 19:44:25.466114 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module asis_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_asis.so
[Thu Feb 08 19:44:25.467114 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module auth_basic_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_auth_basic.so
[Thu Feb 08 19:44:25.468159 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module authn_core_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_authn_core.so
[Thu Feb 08 19:44:25.470163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module authn_file_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_authn_file.so
[Thu Feb 08 19:44:25.471165 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module authz_core_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_authz_core.so
[Thu Feb 08 19:44:25.472163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module authz_groupfile_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_authz_groupfile.so
[Thu Feb 08 19:44:25.473164 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module authz_host_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_authz_host.so
[Thu Feb 08 19:44:25.477164 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module authz_user_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_authz_user.so
[Thu Feb 08 19:44:25.478163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module autoindex_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_autoindex.so
[Thu Feb 08 19:44:25.479164 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module cgi_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_cgi.so
[Thu Feb 08 19:44:25.480163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module dir_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_dir.so
[Thu Feb 08 19:44:25.481163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module env_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_env.so
[Thu Feb 08 19:44:25.482164 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module include_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_include.so
[Thu Feb 08 19:44:25.483164 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module isapi_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_isapi.so
[Thu Feb 08 19:44:25.485164 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module log_config_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_log_config.so
[Thu Feb 08 19:44:25.486163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module mime_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_mime.so
[Thu Feb 08 19:44:25.487164 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module negotiation_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_negotiation.so
[Thu Feb 08 19:44:25.488163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module setenvif_module from C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/modules/mod_setenvif.so
[Thu Feb 08 19:44:25.497163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(336): AH01576: loaded file C:/Users/u/AppData/Local/Programs/Python/Python39/python39.dll
[Thu Feb 08 19:44:25.500163 2024] [so:debug] [pid 23164:tid 436] mod_so.c(266): AH01575: loaded module wsgi_module from C:/Users/u/AppData/Local/Programs/Python/Python39/Lib/site-packages/mod_wsgi/server/mod_wsgi.cp39-win_amd64.pyd
httpd.conf
Define SRVROOT "C:\Users\u\Desktop\Ido\WorkSpace\Apps\apache\Apache24"
Define APACHE_LOG_DIR "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24/logs"
ServerRoot "${SRVROOT}"
DocumentRoot "${SRVROOT}/htdocs"
Listen 8000
#
# Dynamic Shared Object (DSO) Support
# Example:
# LoadModule foo_module modules/mod_foo.so
#
#LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule auth_form_module modules/mod_auth_form.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
#LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_core_module modules/mod_authz_core.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule brotli_module modules/mod_brotli.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule cache_socache_module modules/mod_cache_socache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule data_module modules/mod_data.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule http2_module modules/mod_http2.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
#LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule lua_module modules/mod_lua.so
#LoadModule macro_module modules/mod_macro.so
#LoadModule md_module modules/mod_md.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_express_module modules/mod_proxy_express.so
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
#LoadModule proxy_html_module modules/mod_proxy_html.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_http2_module modules/mod_proxy_http2.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule request_module modules/mod_request.so
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_crypto_module modules/mod_session_crypto.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
#LoadModule socache_memcache_module modules/mod_socache_memcache.so
#LoadModule socache_redis_module modules/mod_socache_redis.so
#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule xml2enc_module modules/mod_xml2enc.so
User u
Group daemon
ServerAdmin admin@example.com
ServerName localhost
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "${SRVROOT}/htdocs"
<Directory "${SRVROOT}/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
CustomLog "${APACHE_LOG_DIR}/access.log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "${SRVROOT}/cgi-bin/"
</IfModule>
<Directory "${SRVROOT}/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule headers_module>
RequestHeader unset Proxy early
</IfModule>
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
LoadFile "C:/Users/u/AppData/Local/Programs/Python/Python39/python39.dll"
LoadModule wsgi_module "C:/Users/u/AppData/Local/Programs/Python/Python39/lib/site-packages/mod_wsgi/server/mod_wsgi.cp39-win_amd64.pyd"
WSGIPythonHome "C:\Users\u\Desktop\Ido\WorkSpace\Apps\apache\miniDjango\venv\Scripts\python"
# WSGIDaemonProcess my_project python-home="C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/venv/"
# WSGIProcessGroup my_project
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/apache_works/wsgi.py"
WSGIPythonPath "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/"
<Directory "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works">
<Files wsgi.py>
Require all granted
</Files>
WSGIApplicationGroup %{GLOBAL}
</Directory>
Alias /static "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/static"
<Directory "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/static">
Require all granted
</Directory>
httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "${SRVROOT}/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
WSGIScriptAlias / "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/apache_works/wsgi_windows.py"
ErrorLog "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/logs/dashboard.error.log"
CustomLog "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/logs/dashboard.access.log" combined
<Directory "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/apache_works">
<Files wsgi_windows.py>
Require all granted
</Files>
</Directory>
Alias /static "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/static"
<Directory "C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/static">
Require all granted
</Directory>
</VirtualHost>
Two dummy hosts folders in a docs folder containing each index.html (can provide if important..)
Settings.py
from pathlib import Path
import os
DEBUG = False # same error when DEBUG = True
ALLOWED_HOSTS = ['localhost', '*', '127.0.0.1']
ROOT_URLCONF = 'apache_works.urls'
WSGI_APPLICATION = 'apache_works.wsgi.application
# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
Have successfully done python manage.py collectstatic
wsgi.py
import os
import sys
import site
from django.core.wsgi import get_wsgi_application
# Add the app’s directory to the PYTHONPATH
sys.path.append("C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango")
sys.path.append("C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works")
sys.path.append("C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/apache_works")
os.environ['DJANGO_SETTINGS_MODULE'] = 'apache_works.settings'
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'apache_works.settings')
application = get_wsgi_application()
Environment Variables:
MOD_WSGI_APACHE_ROOT_DIR : C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/Apache24
PYTHONHOME : C:/Users/u/AppData/Local/Programs/Python/Python39
PYTHONPATH : C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works;C:/Users/u/Desktop/Ido/WorkSpace/Apps/apache/miniDjango/apache_works/apache_works
On the IT side:
Created an in-bound and out-bound rules for Port 80 in the Firewall.
Using administrative user to run 'httpd -e debug' or for starting the Apache2.4 service in Services (Using the Log On As)
error log is clean.
Can provide more details.
What am I missing? maybe something in the Dynamic Shared Object (DSO) Support?
The issue was with my WSGIPythonHome path
Instead of "C:\Users\u\Desktop\Ido\WorkSpace\Apps\apache\miniDjango\venv\Scripts\python"
It should be
"C:\Users\u\Desktop\Ido\WorkSpace\Apps\apache\miniDjango\venv"