Question

How do I get my actual rails website to run instead of the index / of directory listing?

I been working on this problem for a while and so far haven’t been able to solve this. Everything appears to have installed correctly and I double checked everything. Even going so far as to create a detailed Rails deployment plan. So far everything has installed successfully but I can’t seem to get my rails website to actually do what it is supposed to do.

Any help would be greatly appreciated. I really want this website to work so badly and it is frustrating to me that the deployment process is hitting a wall. I might be missing something but I believe this is a complete list of tasks that I ran.

This is my website that should be displaying the homepage with a bat on it but isn’t http://162.243.59.103/

Here are the tasks I ran to get rails ready. PS: yes Rails is installed. Step 1 Rails ready

wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh

RVM install(option 2)

Step 2 Install Ruby

rvm install 1.9.3

rvm use --default 1.9.3

Step 3 Install Rails

gem install rails -v=3.2.14

Step 4 Install git

apt-get install git

Step 5 Install Rails/Ruby Packages

apt-get install nodejs

gem install execjs

Step 6 Install prequisites for passenger

apt-get install libcurl4-openssl-dev

apt-get install apache2-threaded-dev

Steps 7 setup passenger

gem install passenger

apt-get install libapache2-mod-passenger

passenger-install-apache2-module

Step 8 expand swap space

sudo dd if=/dev/zero of=/swap bs=1M count=1024

sudo mkswap /swap

sudo swapon /swap

Step 9 rerun passenger install command

passenger-install-apache2-module

Step 10 Apache config

sudo nano /etc/apache2/apache2.conf LoadModule passenger_module /home/username/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/ext/apache2/mod_passenger.so PassengerRoot /home/username/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12 PassengerRuby /home/username/.rvm/wrappers/ruby-1.9.3-p194/ruby

Step 11 Restart Apache

sudo service apache2 restart

–Fails here—

Step 12 Create enable site cd /etc/apache2/sites-enabled/

cp 000-default duelingpets.net

sudo nano duelingpets.net

<VirtualHost *:80> PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.3-p484/ruby ServerAdmin webmaster@duelingpets.net ServerName duelingpets.net DocumentRoot /var/www/duelingpets.net/public <Directory /var/www/duelingpets.net> AllowOverride None Options -MultiViews </Directory> </VirtualHost>

Step 13 Restart Apache again

sudo service apache2 restart

---------Fails again----

Step 14 Removed default ruby from config

mkdir /var/www/duelingpets.net

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p484/gems/passenger-$ <IfModule mod_passenger.c> PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p484/gems/passenger-4.0.36

PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-1.9.3-p484/ruby

</IfModule>

Step 15 Restart apache again

sudo service apache2 restart

Step 16 Configure sites-available for duelingpets.net

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/duelingpets.net

cd /etc/apache2/sites-available/

nano duelingpets.net

<VirtualHost *:80> ServerAdmin webmaster@duelingpets.net ServerName duelingpets.net ServerAlias www.duelingpets.net DocumentRoot /var/www/duelingpets.net/public

or

ServerName www.yourhost.com

!!! Be sure to point DocumentRoot to ‘public’!

DocumentRoot /somewhere/public <Directory /somewhere/public>

This relaxes Apache security settings.

AllowOverride all

MultiViews must be turned off.

Options -MultiViews </Directory> </VirtualHost>

Step 17 Restart Apache

sudo service apache2 restart

Step 18 Enable site

sudo a2ensite your_app_name

sudo a2ensite duelingpets.net

----Fails----

Step 19 Remove file from site-enabled

cd /etc/apache2/sites-enabled

rm duelingpets.net

Step 20 Enable site trial 2

sudo a2ensite duelingpets.net

Step 21 Reload Apache

service apache2 reload

Step 22 Turn on passenger

sudo a2enmod passenger

Step 23 Reload Apache 2

service apache2 reload


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

What’s the output of <pre>ls /etc/apache2/sites-enabled</pre>? You might want to replace <code>ServerAlias www.duelingpets.net</code> with <code>ServerAlias www.duelingpets.net 162.243.59.103</code>.