Was able to create a working Django application and works fine in development (runserver). However, I'm currently stuck with my production build using Apache as the web server. Hope someone can help.
Have added the following lines in my httpd.conf file:
# ServerName localhost:80 # use this if you're running this on a VirtualBox VM or PC
ServerName localhost:8000
# Django Project
LoadFile "C:/Users/Anton/AppData/Local/Programs/Python/Python310/python310.dll"
LoadModule wsgi_module "C:/Users/Anton/Documents/Dad/PythonVirtual/lib/site-packages/mod_wsgi/server/mod_wsgi.cp310-win_amd64.pyd"
WSGIPythonHome "C:/Users/Anton/Documents/Dad/PythonVirtual"
WSGIPythonPath "C:/Users/Anton/Documents/Dad/Complere"
WSGIScriptAlias / "C:/Users/Anton/Documents/Dad/Complere/Complere/wsgi.py"
<Directory "C:/Users/Anton/Documents/Dad/Complere/Complere/">
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Alias /static/ "C:/Users/Anton/Documents/Dad/Complere/static/"
<Directory "C:/Users/Anton/Documents/Dad/Complere/static/">
Require all granted
`
Without the additional lines mentioned above, I can see the apache service running in background. However, once above lines have been added, the apache server is in stopped status. Below is the log file content.
Starting the 'Apache2.4' service
The 'Apache2.4' service is running.
pm_winnt:notice] [pid 8692:tid 408] AH00455: Apache/2.4.54 (Win64) mod_wsgi/4.9.4 Python/3.10 configured -- resuming normal operations
[Mon Nov 07 22:01:09.941909 2022] [mpm_winnt:notice] [pid 8692:tid 408] AH00456: Apache Lounge VS16 Server built: Jun 22 2022 09:58:15
[Mon Nov 07 22:01:09.941909 2022] [core:notice] [pid 8692:tid 408] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Mon Nov 07 22:01:09.945903 2022] [mpm_winnt:notice] [pid 8692:tid 408] AH00418: Parent: Created child process 6552
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\Apache24\\bin\\httpd.exe'
sys.base_prefix = 'C:\\Users\\Anton\\AppData\\Local\\Programs\\Python\\Python310'
sys.base_exec_prefix = 'C:\\Users\\Anton\\AppData\\Local\\Programs\\Python\\Python310'
sys.platlibdir = 'lib'
sys.executable = 'C:\\Apache24\\bin\\httpd.exe'
sys.prefix = 'C:\\Users\\Anton\\AppData\\Local\\Programs\\Python\\Python310'
sys.exec_prefix = 'C:\\Users\\Anton\\AppData\\Local\\Programs\\Python\\Python310'
sys.path = [
'C:\\Users\\Anton\\AppData\\Local\\Programs\\Python\\Python310\\python310.zip',
'.\\DLLs',
'.\\lib',
'C:\\Apache24\\bin',`
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x0000156c (most recent call first):
[Mon Nov 07 22:01:10.411286 2022] [mpm_winnt:crit] [pid 8692:tid 408] AH00419: master_main: create child process failed. Exiting.
`
``
Related
I followed this guide exactly: https://www.codementor.io/#aswinmurugesh/deploying-a-django-application-in-windows-with-apache-and-mod_wsgi-uhl2xq09e
I am trying to deploy my django application for the first time ever using mod_wsgi and apache on windows 10.
As mentioned in the guide, I changed a few things:
wsgi_windows.py
activate_this = 'C:/pythonvenv/djangoproj/Scripts/activate'
# execfile(activate_this, dict(__file__=activate_this))
exec(open(activate_this).read(),dict(__file__=activate_this))
import os
import sys
import site
# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('C:/pythonvenv/djangoproj/Lib/site-packages')
# Add the app's directory to the PYTHONPATH
sys.path.append('C:/pythonstuff/djangoproj')
sys.path.append('C:/pythonstuff/djangoproj/djangoproj')
os.environ['DJANGO_SETTINGS_MODULE'] = 'djangoproj.settings'
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoprog.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
httpd.conf i added the following two lines as given by: mod_wsgi-express module-config
LoadModule wsgi_module "c:/pythonvenv/djangoproj/lib/site-packages/mod_wsgi/server/mod_wsgi.cp38-win32.pyd"
WSGIPythonHome "c:/pythonvenv/djangoproj"
httpd-vhosts.conf
# Virtual Hosts
#
# virtual SupervisionTool
<VirtualHost *:80>
ServerName localhost
WSGIPassAuthorization On
ErrorLog "logs/my_application.error.log"
CustomLog "logs/my_application.access.log" combined
WSGIScriptAlias / "C:\pythonstuff\djangoproj\djangoproj\wsgi_windows.py"
<Directory "C:\pythonstuff\djangoproj\djangoproj">
<Files wsgi_windows.py>
Require all granted
</Files>
</Directory>
Alias /static "C:/pythonstuff/djangoproj/djangoproj/static"
<Directory "C:/pythonstuff/djangoproj/djangoproj/static">
Require all granted
</Directory>
</VirtualHost>
# end virtual SupervisionTool
Everytime i try to run httpd.exe to start my webserver, it gives the following error and then doesn't start. The error is found in the logs.
[Mon Jul 06 19:31:33.542403 2020] [mpm_winnt:notice] [pid 19432:tid 748] AH00455: Apache/2.4.41 (Win32) PHP/7.3.12 mod_wsgi/4.7.1 Python/3.8 configured -- resuming normal operations
[Mon Jul 06 19:31:33.542403 2020] [mpm_winnt:notice] [pid 19432:tid 748] AH00456: Apache Lounge VS16 Server built: Aug 9 2019 16:32:28
[Mon Jul 06 19:31:33.542403 2020] [core:notice] [pid 19432:tid 748] AH00094: Command line: 'httpd.exe -d C:/wamp/bin/apache/apache2.4.41'
[Mon Jul 06 19:31:33.546388 2020] [mpm_winnt:notice] [pid 19432:tid 748] AH00418: Parent: Created child process 17612
Python path configuration:
PYTHONHOME = 'c:\pythonvenv\djangoproj'
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'C:\\wamp\\bin\\apache\\apache2.4.41\\bin\\httpd.exe'
sys.base_prefix = 'c:\\pythonvenv\\djangoproj'
sys.base_exec_prefix = 'c:\\pythonvenv\\djangoproj'
sys.executable = 'C:\\wamp\\bin\\apache\\apache2.4.41\\bin\\httpd.exe'
sys.prefix = 'c:\\pythonvenv\\djangoproj'
sys.exec_prefix = 'c:\\pythonvenv\\djangoproj'
sys.path = [
'C:\\pythonvenv\\djangoproj\\Scripts\\python38.zip',
'c:\\pythonvenv\\djangoproj\\DLLs',
'c:\\pythonvenv\\djangoproj\\lib',
'C:\\wamp\\bin\\apache\\apache2.4.41\\bin',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00004a24 (most recent call first):
<no Python frame>
[Mon Jul 06 19:31:35.480078 2020] [mpm_winnt:crit] [pid 19432:tid 748] AH00419: master_main: create child process failed. Exiting.
I am not sure what went wrong... can anyone please advise? If not, is there any more hassle-free ways to deploy django on windows 10?
I've a weird error in a flask website.
Important : The first page (a form) is running, but when I submit, I've a 505.
I try severals things thaks to StackOverflow :), but I cannot find the solution.
Here the log :
Mon Feb 25 09:17:37.863313 2019] [wsgi:info] [pid 30874:tid 140525377849088] [remote 192.168.56.1:61092] mod_wsgi (pid=30874, process='flask_my_app', application=''): Loading WSGI script '/var/www/my_app/my_app/flask_my_app/flask_my_app.wsgi'.
[Mon Feb 25 09:17:38.191855 2019] [wsgi:error] [pid 30874:tid 140525377849088] /home/vagrant/.virtualenvs/my_app/lib/python2.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
[Mon Feb 25 09:17:38.191899 2019] [wsgi:error] [pid 30874:tid 140525377849088] """)
[Mon Feb 25 09:17:44.995445 2019] [wsgi:error] [pid 30781:tid 140525239768832] [client 192.168.56.1:3595] Truncated or oversized response headers received from daemon process 'flask_my_app': /var/www/my_app/my_app/flask_my_app/flask_my_app.wsgi, referer: http://vm.my_app/
==> /var/log/apache2/error.log <==
[Mon Feb 25 09:17:45.562808 2019] [core:notice] [pid 30767:tid 140525508945792] AH00051: child pid 30874 exit signal Segmentation fault (11), possible coredump in /etc/apache2
==> /var/log/apache2/my_app-error.log <==
[Mon Feb 25 09:17:45.589899 2019] [wsgi:info] [pid 30956:tid 140525508945792] mod_wsgi (pid=30956): Attach interpreter ''.
[Mon Feb 25 09:17:45.591070 2019] [wsgi:info] [pid 30956:tid 140525508945792] mod_wsgi (pid=30956): Adding '/var/www/my_app/my_app' to path.
[Mon Feb 25 09:17:45.595458 2019] [wsgi:info] [pid 30956:tid 140525508945792] mod_wsgi (pid=30956): Adding '/home/vagrant/.virtualenvs/my_app/lib/python2.7/site-packages' to path.
[Mon Feb 25 09:17:45.608611 2019] [wsgi:info] [pid 30956:tid 140525377849088] [remote 192.168.56.1:61092] mod_wsgi (pid=30956, process='flask_my_app', application=''): Loading WSGI script '/var/www/my_app/my_app/flask_my_app/flask_my_app.wsgi'.
[Mon Feb 25 09:17:45.916197 2019] [wsgi:error] [pid 30956:tid 140525377849088] /home/vagrant/.virtualenvs/my_app/lib/python2.7/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
[Mon Feb 25 09:17:45.916224 2019] [wsgi:error] [pid 30956:tid 140525377849088] """)
My Virtual Host in Apache 2.7 is here :
<VirtualHost *:80>
ServerName vm.my_app
ServerAlias vm.my_app
DocumentRoot /var/www/my_app/my_app
LogLevel info
WSGIDaemonProcess flask_my_app python-path=/var/www/my_app/my_app:/home/vagrant/.virtualenvs/my_app/lib/python2.7/site-packages display-name=%{GROUP}
WSGIProcessGroup flask_my_app
WSGIScriptAlias / /var/www/my_app/my_app/flask_my_app/flask_my_app.wsgi
WSGIApplicationGroup %{GLOBAL}
#Alias /favicon.ico /var/www/my_app/my_app/static/favicon.ico
Alias /site_media/ /var/www/my_app/my_app/site_media/
Alias /media/ /var/www/my_app/my_app/media/
Alias /static/ /var/www/my_app/my_app/static/
AliasMatch /([/]*\.css) /var/www/my_app/my_app/static/css/$1
<Directory /var/www/my_app/my_app>
Order allow,deny
Allow from all
Require all granted
</Directory>
<Directory /var/www/my_app/my_app/flask_my_app>
Order allow,deny
Allow from all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/my_app-error.log
CustomLog ${APACHE_LOG_DIR}/my_app-access.log combined
</VirtualHost>
The python version is 2.7.12, and I use "virtual env wrapper".
The version of the wsgi module is old I think :
lrwxrwxrwx 1 root root 15 mai 3 2016 mod_wsgi.so -> mod_wsgi.so-2.7*
-rwxrwxrwx 1 root root 223K mai 3 2016 mod_wsgi.so-2.7*
The wsgi file is "classic", and the requirements.txt file :
$ cat ../requirements.txt
click==6.7
Flask==1.0.2
Flask-Assets==0.12
Flask-Caching==1.4.0
Flask-Login==0.4.1
Flask-SQLAlchemy==2.3.2
Flask-WTF==0.14.2
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
pbr==5.1.1
psycopg2==2.7.5
six==1.12.0
SQLAlchemy==1.2.8
stevedore==1.30.0
webassets==0.12.1
Werkzeug==0.14.1
WTForms==2.2.1
Can anobody helps me ?
Thanks a lot
F.
It's maybe useful to others, that my issue was fixed by desactivating the SSL support !!!, in postgresql.conf :
80 ssl = off # (change requires restart)
the log :
==> /var/log/postgresql/postgresql-9.6-main.log <==
2019-03-07 15:28:28.573 CET [5346] [unknown]#[unknown] LOG: could not accept SSL connection: EOF detected
[Fri Sep 29 14:46:35.808072 2017] [wsgi:info] [pid 35637] mod_wsgi (pid=35697): Process 'swpdoc' has died, deregister and restart it.
[Fri Sep 29 14:46:35.808113 2017] [wsgi:info] [pid 35637] mod_wsgi (pid=35697): Process 'swpdoc' terminated by signal 1
[Fri Sep 29 14:46:35.808116 2017] [wsgi:info] [pid 35637] mod_wsgi (pid=35697): Process 'swpdoc' has been deregister`enter code here`ed and will no longer be monitored.
[Fri Sep 29 14:46:35.808944 2017] [wsgi:info] [pid 35699] mod_wsgi (pid=35699): Starting process 'swpdoc' with uid=48, gid=48 and threads=15.
[Fri Sep 29 14:46:35.809868 2017] [wsgi:info] [pid 35699] mod_wsgi (pid=35699): Python home /var/www/swpdoc/venswpdoc.
[Fri Sep 29 14:46:35.809895 2017] [wsgi:info] [pid 35699] mod_wsgi (pid=35699): Initializing Python.
ImportError: No module named site
WSGIScriptAlias / /var/www/swpdoc/swpdocs/swpdoc/wsgi.py
<Directory /var/www/swpdoc/swpdocs/swpdoc>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess swpdoc python-home=/var/www/swpdoc/venswpdoc python-
path=/var/www/swpdoc/swpdocs
WSGIProcessGroup swpdoc
WSGIApplicationGroup %{GLOBAL}
[root#mrsblweb21548 modules]# ldd mod_wsgi.so
linux-vdso.so.1 => (0x00007ffdd95fe000)
libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007f1747989000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f174776d000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f1747568000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f1747365000)
libm.so.6 => /lib64/libm.so.6 (0x00007f1747063000)
libc.so.6 => /lib64/libc.so.6 (0x00007f1746ca0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1747f9d000)
If i use a project with django 1.9.5. it is working find and updating the django to newer version giving this error. Anyone help ?
Update:
Changed permission on virtual environment directory and now getting
permission errors:
[Fri Sep 29 19:12:35.371053 2017] [wsgi:warn] [pid 33023] (13)Permission
denied: mod_wsgi (pid=33023): Unable to stat Python home
/var/www/swpdoc/venswpdoc. Python interpreter may not be able to be
initialized correctly. Verify the supplied path and access
permissions for whole of the path.
Usually caused by you trying to make mod_wsgi use a Python virtual environment for a different version of Python than mod_wsgi was compiled for.
Check what version of Python mod_wsgi is compiled for.
http://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html#python-shared-library
Indicate what version of Python your virtual environment was created against.
Usually, you only need to add the root application path to the "python-path", then it can recognize all apps in your project (I assume that "site" is an app in your project). So, you need to replace this line in your config file:
WSGIDaemonProcess swpdoc python-path=/var/www/swpdoc
If you are using a virtualenv, you can add the virtualenv packages with this line:
WSGIDaemonProcess swpdoc python-path=/var/www/swpdoc:/var/www/swpdoc/env/lib/python3.4/site-packages
You just need to replace the version of the python installed in your virtualenv.
Additionally, every time you update Django, you need to take a look at the release notes https://docs.djangoproject.com/en/1.11/releases/1.11/
I am using an Ubuntu 14.10 X86_64 system with softwares in below:
python 3.4
apache2
libapache2-mod-wsgi-py3
django1.8
I created a project by django1.8 at this path:
/var/www/html/koorimeo
I've noticed that django-admin startproject will generate a wsgi.py file by default and I haven't change its content.
I configured apache2 under the official document(How to use Django with Apache and mod_wsgi) details:
I modified 000-default.conf for I don't want to setup another Virtual Host. and This is What I added:
#000-default.conf
<VirtualHost *:80>
...
<Directory /var/www/html/koorimeo/koorimeo>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
...
</VirtualHost>
After that I declare WSGIAlias and WSGIPythonPath in apache2.conf:
#apache2.conf
#I want to leave "/" for other use...
WSGIScriptAlias /koorimeo /var/www/html/koorimeo/koorimeo/wsgi.py
WSGIPythonPath /var/www/html/koorimeo/koorimeo
After finished setting files I restarted apache2 service and login into 127.0.0.1/koorimeo, it returned a 500 error message...
I looked up the error log file and get these error message:
bing#k-lab:/var/log/apache2$ tail error.log
[Sat Apr 25 14:35:31.214661 2015] [:notice] [pid 16997:tid 140004070725504] mod_python: Creating 8 session mutexes based on 6 max processes and 25 max threads.
[Sat Apr 25 14:35:31.214705 2015] [:notice] [pid 16997:tid 140004070725504] mod_python: using mutex_directory /tmp
[Sat Apr 25 14:35:31.232634 2015] [:warn] [pid 16997:tid 140004070725504] mod_wsgi: Compiled for Python/3.4.0.
[Sat Apr 25 14:35:31.232682 2015] [:warn] [pid 16997:tid 140004070725504] mod_wsgi: Runtime using Python/2.7.6.
[Sat Apr 25 14:35:31.232766 2015] [mpm_event:notice] [pid 16997:tid 140004070725504] AH00489: Apache/2.4.7 (Ubuntu) mod_python/3.3.1 Python/2.7.6 mod_wsgi/3.4 configured -- resuming normal operations
[Sat Apr 25 14:35:31.232786 2015] [core:notice] [pid 16997:tid 140004070725504] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 25 14:35:32.234958 2015] [core:notice] [pid 16997:tid 140004070725504] AH00051: child pid 18325 exit signal Aborted (6), possible coredump in /etc/apache2
[Sat Apr 25 14:35:32.235070 2015] [core:notice] [pid 16997:tid 140004070725504] AH00051: child pid 18326 exit signal Aborted (6), possible coredump in /etc/apache2
[Sat Apr 25 14:35:34.041184 2015] [:error] [pid 18599:tid 140003960342272] [client 127.0.0.1:51134] mod_wsgi (pid=18599): Target WSGI script '/var/www/html/koorimeo/koorimeo/wsgi.py' cannot be loaded as Python module., referer: http://localhost/
[Sat Apr 25 14:35:34.041279 2015] [:error] [pid 18599:tid 140003960342272] [client 127.0.0.1:51134] mod_wsgi (pid=18599): Exception occurred processing WSGI script '/var/www/html/koorimeo/koorimeo/wsgi.py'., referer: http://localhost/
According these message I found that apache2 can not find this module:
/var/www/html/koorimeo/wsgi.py
So I copy this path and try to get me clear wheather this file do exist:
bing#k-lab:/var/log/apache2$ ls /var/www/html/koorimeo/koorimeo/wsgi.py -l
and the system returned this message which told me that the file is truly exists...
-rw-rw-r-- 1 bing bing 389 4月 25 14:21 /var/www/html/koorimeo/koorimeo/wsgi.py
And I also make sure that I've installed libapache2-mod-wsgi-py3, I did find wsgi.so in proper location.
I've found wsgi.load in modes-enable and pointed the wsgi.so in right place:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
So... I am confused...
Please tell me why can't apache2 find this wsgi.py file?
Remove mod_python from Apache if you are not using it.
Your mod_wsgi module was compiled for Python 3.4.0, but mod_python was compiled for 2.7.6. Because mod_python is using a different version it is overriding what Python version is used and this will stop mod_wsgi from working.
Read the many sections in the documentation starting at:
http://code.google.com/p/modwsgi/wiki/InstallationIssues#Using_ModPython_and_ModWsgi
I have been trying to configure mod_wsgi for two days and still no luck. Here is what I did:
Create a sample django project mysite. Run python manage.py runserver and make sure it's working
Create apache directory under mysite, create apache_django_wsgi.conf, mysite.wsgi and an empty __init__.py
Content of apache_django_wsgi.conf:
WSGIPythonHome /usr/bin
WSGIRestrictStdout Off
WSGIDaemonProcess django
WSGIProcessGroup django
Alias /site_media/ "/Users/Garth/Dev/web-app/mysite/media/"
<Directory "/Users/Garth/Dev/web-app/mysite/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>
Alias /media/ "/Library/Python/2.6/site-packages/django/contrib/admin/media/"
<Directory "/Library/Python/2.6/site-packages/django/contrib/admin/media">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>
WSGIScriptAlias /mysite "/Users/Garth/Dev/web-app/mysite/apache/mysite.wsgi"
<Directory "/Users/Garth/Dev/web-app/mysite/apache">
Allow from all
</Directory>
Content of mysite.wsgi
import os
import sys
sys.path.append('/Users/Garth/Dev/web-app/mysite')
sys.path.append('/Users/Garth/Dev/web-app')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Download mod_wsgi.so (precompiled binary for Mac OS X) and put it in /usr/libexec/apache2
Edit /etc/apache2/httpd.conf,
add:
LoadModule wsgi_module libexec/apache2/mod_wsgi.so
Include /Users/Garth/Dev/web-app/mysite/apache/apache_django_wsgi.conf
Run sudo apachectl -k start
If I go to localhost, I can see the files and directories list. But if I go to localhost/mysite (which is the WSGIScriptAlias I configured), I got Internal Server Error.
The error_log of apache is:
[Fri May 13 11:10:38 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri May 13 11:10:38 2011] [notice] Digest: generating secret for digest authentication ...
[Fri May 13 11:10:38 2011] [notice] Digest: done
[Fri May 13 11:10:38 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8l DAV/2 mod_wsgi/3.3 Python/2.6.1 configured -- resuming normal operations
[Fri May 13 11:10:50 2011] [error] [client ::1] mod_wsgi (pid=10921): Target WSGI script '/Users/Garth/Dev/web-app/mysite/apache/mysite.wsgi' cannot be loaded as Python module.
[Fri May 13 11:10:50 2011] [error] [client ::1] mod_wsgi (pid=10921): Exception occurred processing WSGI script '/Users/Garth/Dev/web-app/mysite/apache/mysite.wsgi'.
[Fri May 13 11:10:50 2011] [error] Traceback (most recent call last):
[Fri May 13 11:10:50 2011] [error] File "/Users/Garth/Dev/web-app/mysite/apache/mysite.wsgi", line 1, in <module>
[Fri May 13 11:10:50 2011] [error] import os
[Fri May 13 11:10:50 2011] [error] ImportError: No module named os
Does anyone see where goes wrong? The error_log seems to tell a lot. I'm new to web development, and I might have made some obvious mistakes. Thank you very much!
Don't set WSGIPythonHome for a start it isn't needed. It should only be needed in certain situations and this isn't one of them.
In this case you have set it to a wrong value. By rights the fact it is wrong shouldn't have caused a problem as Python should have fallen back to using correct default value, but it may not do that for some reason.
You can also delete the line:
WSGIRestrictStdout Off
as that isn't needed for mod_wsgi 3.3.