• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Rails with Mongrel

D

dradx

Guest
I'm trying to setup my Rails application to use Mongrel. Does anybody have any experience getting this to work under Plesk?
Mongrel documentation specifies that a VirtualHost section should be defined in the Apache configuration. However that is already defined in httpd.include file written by Plesk, which shouldn't be changed.
Does anybody have an example of vhost.conf file that specifies proxy pass.

Thanks.
 
Since FastCGI is supported by PSA 8.1.1 and since Mongrel is essentially an alternative to FastCGI, why fight it? Why not just run with FastCGI?
 
Because you have to kill stale fcgi processes all the time, outages without a reason and a (well setup) mongrel cluster outperforms fcgi considerably. Mongrel is simply a lot more reliable than fcgi, both in terms of reliability and speed.

The question I posted in another thread has everything to do with this. We have a dedicated ubuntu dapper drake server without plesk and easily upgraded apache to 2.2 (it has load balancing), which is a must if you don't a half-way-there solution like poor man's balancing (where apache forwards to a random cluster port).

Plesk seems to be preventing the upgrade from Apache 2.0 to 2.2 using ubuntu's apt-get, although the FAQs clearly say you should be able to upgrade Apache without breaking Plesk.

I'll answer the question of the original poster in a new reply, now if only someone could answer mine :)
 
This is an example vhost.conf you can use, you can choose the number of ports to host a mongrel server on. It also includes the necessary rewrites to be able to access plesk-stats as well as gzip deflating of your pages.

Code:
# 
# Poor man's balancing on Apache 2.0

  <Proxy *>
    Allow from all
  </Proxy>
  ServerAlias  [url]www.mysite.com[/url]
  DocumentRoot /path/to/your/rails-app/public
  <Directory "/path/to/your/rails-app/public"> 
    Options FollowSymLinks 
    AllowOverride None 
    Order allow,deny 
    Allow from all 
  </Directory> 
  <Location  /plesk-stat>
    Options +Indexes
  </Location>
  ProxyRequests Off
  ProxyPassReverse / [url]http://localhost:3010/[/url]
  ProxyPassReverse / [url]http://localhost:3011/[/url]
  ProxyPassReverse / [url]http://localhost:3012/[/url]
  ProxyPassReverse / [url]http://localhost:3013/[/url]
  ProxyPassReverse / [url]http://localhost:3014/[/url]
  ProxyPreserveHost On
  RewriteEngine On
  RewriteRule ^/error/.* /usr/share/apache2/$0 [L]
  RewriteRule ^/plesk-stat/?(.*) /var/www/vhosts/mysite.com/statistics/$1 [L]
  RewriteRule ^/(webstat|webstat-ssl|ftpstat|anon_ftpstat)/?.*$ /var/www/vhosts/mysite.com/statistics$0 [L]
  RewriteRule ^/awstats-icon/(.*) /usr/share/awstats/icon/$1 [L]
  RewriteMap  servers rnd:/etc/apache2/mongrel-ports-map-myapp.txt
  RewriteRule ^/(images|stylesheets|javascripts|system)/?(.*) $0 [L]
  RewriteRule ^/(.*)$ [url]http://localhost:[/url]${servers:ports}/$1 [P,L]
  # Rewrite index to check for static 
  RewriteRule ^/$ /index.html [QSA] 
  # Rewrite to check for Rails cached page 
  RewriteRule ^([^.]+)$ $1.html [QSA] 
  # Redirect all non-static requests to cluster 
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f


  # Deflate
  AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript
  # ... text/xml application/xml application/xhtml+xml text/javascript 
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

You then have to create a text file "mongrel-ports-map-myapp.txt" in /etc/apache2/ (or whereever you want), containing:
Code:
ports 3010|3011|3012|3013|3014
 
Back
Top