-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 15 Apr 2007, at 16:00, Goodrone wrote:
> Could anyone share a piece his real configuration for Apache/2.2.4
> + mod_fcgi + Pylons?
I can do that for Apache/2.0.5x. I don't believe that the relevant
directives or mod_fcgi usage are different for 2.2.x but I couldn't
be certain.
The app is called "myapp" throughout, replace as appropriate. Pylons
apps live in /var/www/pylons/. I've got some legacy non-Pylons stuff
I want to serve directly via Apache, that stuff lives in /var/www/
htdocs and is explicitly filtered out of the catch-all rewrite.
# Create and set permissions of cache directory in /tmp
% bash> sudo mkdir /tmp/fcgi_ipc
% bash> sudo chown webserver:webserver /tmp/fcgi_ipc
# Add to /etc/httpd/conf/httpd.conf
=========================
[...]
LoadModule fastcgi_module modules/mod_fastcgi.so
[...]
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
</IfModule>
FastCgiExternalServer /var/www/pylons/myapp/myapp.fcgi -socket /var/
www/pylons/myapp/myapp.socket
# Content of /etc/httpd/vhosts/myvhost.conf
========================
<VirtualHost MY.IPA.DDR.ESS:80>
ServerName myvhost.com
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /var/www/htdocs
# Log file settings, etc.
[ ... ]
RewriteEngine on
RewriteCond %{REQUEST_URI} !^favicon.ico$
RewriteCond %{REQUEST_URI} !^/robots.txt$
RewriteCond %{REQUEST_URI} !^/icons/.*
RewriteCond %{REQUEST_URI} !^/codebase/.*
RewriteCond %{REQUEST_URI} !^/graphics/.*
RewriteCond %{REQUEST_URI} !^/systems.html$
RewriteCond %{REQUEST_URI} !^/systems/.*
RewriteRule ^(.*)$ /myapp.fcgi$1 [L]
<Location />
Options +ExecCGI
AddHandler fastcgi-script .fcgi
AllowOverride All
</Location>
DirectoryIndex myapp.fcgi
</VirtualHost>
<Directory /var/www/htdocs>
order allow,deny
allow from all
Options Indexes All FollowSymLinks ExecCGI
AllowOverride All
</Directory>
# Content of /var/www/pylons/myapp/myapp.fcgi
=====================================
#!/usr/bin/env python
import logging
# Load the WSGI application from the config file
from paste.deploy import loadapp
wsgi_app = loadapp('config:/var/www/pylons/myapp/production.ini')
# Deploy it using FastCGI
if __name__ == '__main__':
from flup.server.fcgi import WSGIServer
WSGIServer(wsgi_app).run()
# Change /var/www/pylons/myapp/production.ini (read as diff)
======================================
[...]
[server:main]
- - use = egg:Paste#http
- - host = 127.0.0.1
- - port = 5000
+ use = egg:PasteScript#flup_fcgi_thread
+ socket = /var/www/pylons/myapp/myapp.socket
[...]
# Make a softlink from the fcgi script to the document root ...
% bash> sudo ln -s /var/www/pylons/myapp/myapp.fcgi /var/www/htdocs/
Some of the above may be pure superstition, it took me several hours
to get this setup working and as soon as it /was/ working, I sighed
with relief and left it alone thereafter.
Cheers,
Graham.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iQCVAgUBRiLnyFnrWVZ7aXD1AQJUygQAza+jwjAR6mWzy3cKarkXrbNRGJMG1mNC
7UoHxa4INvzGKcBsjrmkOFeol0Dew1L5UZHX824gQmwlCJSfy2AzHGlvdWYcssh6
Rp31LLnWyIRb/ezio/QiIq7Z0c9Qem6QUmUN4IHMchuFBeSnKmhJ/PN6uycM8BYD
WxJcFz7HbdQ=
=h7OX
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
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
-~----------~----~----~----~------~----~------~--~---