I have been following the instruction in this
page<http://readthedocs.org/docs/pyramid/en/latest/tutorials/modwsgi/index.html>
.
My environment.
Server: Ubuntu 11.04
Python 2.7.1
Installed mod_wsgi with the command *sudo apt-get install
libapache2-mod-wsgi*
cd /home/hmkcreative
virtualenv --no-site-packages envy
./bin/pcreate -s starter myapp
cd myapp
../bin/python setup.py install
made pyramid.wsgi file under envp
with the following
from pyramid.paster import get_app
application = get_app(
'/home/hmkcreative/envp/myapp/production.ini', 'main')
Changed the permission on pyramid.wsgi file.
I copied the config file
sudo cp /etc/apache2/sites-available/default
/etc/apache2/sites-available/mysite
sudo a2dissite default && sudo a2ensite mysite
sudo /etc/init.d/apache2 restart
Now the problem.
I get 500 internal server error when I access http://<ip address>/myapp
Right now, I don't know how to fix it or where to turn to.
The following is more detailed information.
If you can help me, I would really appreciate it.
Thank you for your input.
Edward
Here's the error log
[Wed Feb 29 22:36:37 2012] [error] [client 192.168.0.5] mod_wsgi (pid=1823,
process='pyramid', application=''): Failed to parse WSGI script file
'/home/hmkcreative/envp/pyramid.wsgi'.
[Wed Feb 29 22:36:37 2012] [error] [client 192.168.0.5] mod_wsgi
(pid=1823): Exception occurred processing WSGI script
'/home/hmkcreative/envp/pyramid.wsgi'.
[Wed Feb 29 22:36:37 2012] [error] [client 192.168.0.5] File
"/home/hmkcreative/envp/pyramid.wsgi", line 1
[Wed Feb 29 22:36:37 2012] [error] [client 192.168.0.5] fromm
pyramid.paster import get_app
[Wed Feb 29 22:36:37 2012] [error] [client 192.168.0.5] ^
[Wed Feb 29 22:36:37 2012] [error] [client 192.168.0.5] SyntaxError:
invalid syntax
[Wed Feb 29 22:36:37 2012] [error] [client 192.168.0.5] File does not
exist: /home/hiro/envp/favicon.ico
The following is my mysite config file
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/hiro/envp
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
# Use only 1 Python sub-interpreter. Multiple sub-interpreters
# play badly with C extensions.
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess pyramid user=hiro group=staff threads=4 \
python-path=/home/hiro/envp/lib/python2.7/site-packages
WSGIScriptAlias /myapp /home/hiro/envp/pyramid.wsgi
<Directory /home/hiro/envp>
WSGIProcessGroup pyramid
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pylons-discuss/-/WO7j1odtuM4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.