cd /var/lib/mongodb
rm -rf mongodb.lock
rm -rf mongodb.lock
Include conf/bitnami/passenger.conf
<VirtualHost *:80>
PassengerEnabled on
RailsBaseURI /application
<Directory /installdir/apache2/htdocs/application>
Options -MultiViews
</Directory>
</VirtualHost>
sudo ln -s /installdir/apps/application/public /installdir/apache2/htdocs/application
<VirtualHost *:80>
DocumentRoot /installdir/apps/application/public
<Directory /installdir/apps/application/public/>
PassengerEnabled on
Options -MultiViews
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>
</VirtualHost>
Finally you have to enable passenger fusion in bitnami config file located in /opt/rubystack/apache2/conf/bitnami/passenger.conf
LoadModule passenger_module /opt/rubystack-1.9.3-25/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so PassengerRoot /opt/rubystack-1.9.3-25/ruby/lib/ruby/gems/1.9.1/gems/passenger-4.0.45 PassengerRuby /opt/rubystack-1.9.3-25/ruby/bin/ruby PassengerEnabled on PassengerFriendlyErrorPages off PassengerUser daemon PassengerGroup daemon
sudo /installdir/ctlscript.sh restart apache
$ cd your_project_folder $ thin -s 5 -p 3000 -e production --prefix /appname -C config/thin.yml config
$ thin -C ${rails_application_dir}/config/thin.yml start/stop/restart
$ cd your_project_folder $ thin -p 3000 -e production --prefix /appname start thin -p 3001 -e production --prefix /appname start
ProxyPass /appname balancer://appcluster ProxyPassReverse /appname balancer://appcluster <Proxy balancer://appcluster> BalancerMember http://127.0.0.1:3001/appname BalancerMember http://127.0.0.1:3002/appname ... </Proxy>
Using Apache with Passenger
Note: Before installing Apache and Passenger, make sure to disable (or remove) Nginx if you have it installed; or configure it to not to block Apache's way (i.e. port / socket collisions).Note: If your droplet has less than 1 GB of RAM, you will need to perform the below simple procedure to prepare a SWAP disk space to be used as a temporary data holder (i.e. RAM substitute) for Passenger. Since DigitalOcean virtual servers come with fast SSD disks, this does not really constitute an issue whilst performing the server application installation tasks.
# Create a 1024 MB SWAP space # The process should complete within less than a minute sudo dd if=/dev/zero of=/swap bs=1M count=1024 sudo mkswap /swap sudo swapon /swapPassenger is only available for OS X and Linux. To use this method, you just need to include a virtual host which DocumentRoot points to 'public' directory in Rails application.<VirtualHost *:80> ServerName myapplication.com DocumentRoot your_project_folder/public <Directory your_project_folder/public> Options -MultiViews <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> </Directory> </VirtualHost>