rails project -d mysql
defaults: &defaults adapter: mysql encoding: utf8 username: root password: 'pass' socket: /tmp/mysql.sock development: database: xx_development <<: *defaults test: database: xx_test <<: *defaults production: database: xx_production <<: *defaults
/Applications/MAMP/tmp/mysql/mysql.sock
mongrel_rails cluster::configure -e production -p 8000 -N 3 -c /var/www/vhost/railsproject --user apache --group apache
mongrel_rails cluster::configure -e production -p 8000 -N 3 -c /var/www/apps/project --user mongrel --group mongrel
mongrel_rails cluster::start
<VirtualHost *:80>
ServerName some.site.com
DocumentRoot /var/www/vhost/project/public
<Directory "/var/www/vhost/project/public">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Proxy balancer://xxx_cluster>
Order allow,deny
Allow from all
BalancerMember http://127.0.0.1:8000
BalancerMember http://127.0.0.1:8001
BalancerMember http://127.0.0.1:8002
</Proxy>
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://xxx_cluster%{REQUEST_URI} [P,QSA,L]
</VirtualHost>
.gitignore:
log/*.log tmp/**/* .DS_Store doc/api doc/app config/database.yml db/schema.rb
$ cp config/database.yml config/database.yml.example $ touch log/.gitignore $ touch tmp/.gitignore $ git add . $ git commit -m "Initial commit"