|
|
0ce23f |
Using the mod_fcgid RPM Package
|
|
|
0ce23f |
===============================
|
|
|
0ce23f |
|
|
|
0ce23f |
This mod_fcgid package includes a configuration file
|
|
|
0ce23f |
/etc/httpd/conf.d/fcgid.conf that ensures that the module is loaded and
|
|
|
0ce23f |
added as the handler for .fcg, .fcgi, and .fpl applications.
|
|
|
0ce23f |
|
|
|
0ce23f |
Example: setting up moin with mod_fcgid
|
|
|
0ce23f |
=======================================
|
|
|
0ce23f |
|
|
|
0ce23f |
Setting up moin with mod_fcgid is very similar to setting it up as a regular
|
|
|
0ce23f |
CGI application.
|
|
|
0ce23f |
|
|
|
0ce23f |
* Create a directory for your wiki instance:
|
|
|
0ce23f |
|
|
|
0ce23f |
DESTDIR=/var/www/mywiki
|
|
|
0ce23f |
mkdir -p $DESTDIR/cgi-bin
|
|
|
0ce23f |
|
|
|
0ce23f |
* Copy in the wiki template data and the application itself:
|
|
|
0ce23f |
|
|
|
0ce23f |
cp -a /usr/share/moin/{data,underlay} $DESTDIR
|
|
|
0ce23f |
cp -a /usr/share/moin/server/moin.fcg $DESTDIR/cgi-bin
|
|
|
0ce23f |
cp -a /usr/share/moin/config/wikiconfig.py $DESTDIR/cgi-bin
|
|
|
0ce23f |
|
|
|
0ce23f |
* Fix the directory ownership
|
|
|
0ce23f |
|
|
|
0ce23f |
chown -R apache:apache $DESTDIR/{data,underlay}
|
|
|
0ce23f |
|
|
|
0ce23f |
* Edit $DESTDIR/cgi-bin/wikiconfig.py to suit your needs
|
|
|
0ce23f |
|
|
|
0ce23f |
* Create a httpd configuration file for the wiki, e.g.
|
|
|
0ce23f |
/etc/httpd/conf.d/mywiki.conf
|
|
|
0ce23f |
|
|
|
0ce23f |
# Wiki application data common to all wiki instances
|
|
|
0ce23f |
Alias /moin_static185 "/usr/share/moin/htdocs/"
|
|
|
0ce23f |
<Directory "/usr/share/moin/htdocs/">
|
|
|
0ce23f |
Options Indexes FollowSymLinks
|
|
|
0ce23f |
AllowOverride None
|
|
|
0ce23f |
Order allow,deny
|
|
|
0ce23f |
Allow from all
|
|
|
0ce23f |
<IfModule mod_expires.c>
|
|
|
0ce23f |
ExpiresActive On
|
|
|
0ce23f |
ExpiresDefault "access plus 1 year"
|
|
|
0ce23f |
</IfModule>
|
|
|
0ce23f |
</Directory>
|
|
|
0ce23f |
|
|
|
0ce23f |
# Wiki instance with mod_fcgid
|
|
|
0ce23f |
<IfModule mod_fcgid.c>
|
|
|
0ce23f |
ScriptAlias /mywiki "/var/www/mywiki/cgi-bin/moin.fcg"
|
|
|
0ce23f |
<Directory "/var/www/mywiki/cgi-bin/">
|
|
|
0ce23f |
Options Indexes FollowSymLinks ExecCGI
|
|
|
0ce23f |
AllowOverride None
|
|
|
0ce23f |
Order allow,deny
|
|
|
0ce23f |
Allow from all
|
|
|
0ce23f |
</Directory>
|
|
|
0ce23f |
</IfModule>
|
|
|
0ce23f |
|
|
|
0ce23f |
* Restart the web server to load the new configuration:
|
|
|
0ce23f |
|
|
|
0ce23f |
service httpd restart
|
|
|
0ce23f |
|
|
|
0ce23f |
That should do it!
|
|
|
0ce23f |
|
|
|
0ce23f |
Ruby on Rails with mod_fcgid
|
|
|
0ce23f |
============================
|
|
|
0ce23f |
|
|
|
0ce23f |
One of the differences between mod_fastcgi and mod_fcgid is that the former
|
|
|
0ce23f |
sets the SCRIPT_NAME environment variable whilst the latter does not, and it's
|
|
|
0ce23f |
reported (http://bugzilla.redhat.com/476658) that Ruby on Rails expects this
|
|
|
0ce23f |
environment variable to be present. A workaround for this is to add:
|
|
|
0ce23f |
|
|
|
0ce23f |
ActionController::AbstractRequest.relative_url_root = ""
|
|
|
0ce23f |
|
|
|
0ce23f |
to the Rails::Initializer.run segment of config/environment.rb
|
|
|
0ce23f |
|