I’m developing a Rails app and am trying to configure the web server it’s deployed on.
My problem is that the page doesn’t load.
In Apache’s error.log there are no errors and in my app’s log/production.log only the line(s) Connecting to database specified by database.yml appears.
I have no index.html in app’s public folder and the application works fine in the development environment.
I’m using an Amazon instance with Ubuntu 12.04 and I’ve installed ruby through RVM.
In my httpd.conf I have:
LoadModule passenger_module /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /home/ubuntu/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.17
PassengerRuby /home/ubuntu/.rvm/wrappers/ruby-1.9.3-p194/ruby
Apache starts without errors.
Below there is my sites-available/default:
# other virtualhosts
#
<VirtualHost *:80>
ServerName my_app.mydomain.com
ServerAdmin mail@mail.com
DocumentRoot /home/ubuntu/public_html/my_app/current/public
<Directory /home/ubuntu/public_html/my_app/current/public>
Allow from all
Options -MultiViews
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
</VirtualHost>
What should I do now to get passenger working?
I decided to reinstall Ruby and all the other stuff and moving to nginx.
Finally now I have all working (both in ngnix and apache).
This is what I’ve done, if someone cares:
Ruby + Rails
Install ruby + rails via RVM
Load rvm in all opened shells
Install gem
apache
Install apache and passenger module
Copy these lines to
/etc/apache2/httpd.confnginx
Install nginx and passenger module
Copy these lines to
/opt/nginx/conf/nginx.confSetup a script to allow you to control Nginx
You can now control Nginx with this script
Final setup with nodejs
One of the other things you’ll want is Node.js. This will help you do the compiling of assets on deployments