Rails – Apache 2.0x – Proxy – Mongrel – Ubuntu

Ruby on Rails приложение/сайт – Apache сървър за статично съдържание и mongrel за обслужване на rails приложението/сайта. Заявките към mongrel се пренасочват през Apache Proxy.

Виртуален хост конфигурация:

<VirtualHost IP:80> ServerName app.server.com ServerAlias app.server.com DocumentRoot /www/rails/public ErrorLog /www/rails/log/server.log

<Directory /www/rails/public/> Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny </Directory> <Proxy http://IP:3000> Order deny,allow Deny from all Allow from all </Proxy> ProxyPass / http://IP:3000/ ProxyPassReverse / http://IP:3000 ProxyPreserveHost on ProxyPass /images ! ProxyPass /javascripts ! ProxyPass /stylesheets ! </VirtualHost>

 

Пускане на mongrel:

/usr/bin/ruby /usr/bin/mongrel_rails start -d -e production -p 3000 -l /www/rails/log/mongrel.log -P /www/rails/log/mongrel.3000.pid -c /www/rails

Mongrel Server – На сайта на mongrel може да намерите повече информация за конфигурирането му, пусканете на клъстер от mongrel сървъри и т.н.

Tags: ,

Leave a comment

Get Adobe Flash playerPlugin by wpburn.com wordpress themes