0

I'm quite new, so this is what I've done:

I worked on my Rails app, which works fine if I run it with rails s command, but I want to access to my app from other devices in my Lan (or even when I'm outside my home), the apache server is """running""" using an old Notebook that I have running 24/7 which I already use as a ssh server, so I followed this guide: http://www.rabblemedia.net/blog/installing-rvm-ruby-on-rails-and-passenger-on-centos-6/

I don't know if I've done something wrong, according to me I just did the same as what's in the guide, but when I try to access to my web app from another device trough the IP of my CentOS I only get Err_Connection_Timed_Out, I don't know what info should I put so I will put what I think is important:

  • The local IP of my CentOS is 192.168.0.53

  • The hostname is: vmcentos

  • The route to my app is /var/www/calendar

  • service httpd status returns: httpd (pid 1196) is running...

Apart from that:

The /etc/httpd/conf.d/passenger.conf file has this content:

 PassengerRoot /home/patricio/.rvm/gems/ruby-2.3.3@calendar/gems/passenger-5.0.30 PassengerDefaultRuby /home/patricio/.rvm/gems/ruby-2.3.3@calendar/wrappers/ruby </IfModule> ### End automatically installed Phusion Passenger config snippet ### # Deploying a web application: an example # Suppose you have a web application in /somewhere. Add a virtual host to # your Apache configuration file and set its DocumentRoot to /somewhere/public: # # <VirtualHost *:80> # ServerName www.yourhost.com # # Be sure to point to 'public'! # DocumentRoot /somewhere/public # <Directory /somewhere/public> # # Relax Apache security settings # AllowOverride all # # MultiViews must be turned off # Options -MultiViews # </Directory> # </VirtualHost> 

The configuration file for my project is in this route and file /etc/httpd/sites-enabled/calendar.conf and has this content:

<VirtualHost *:80> ServerName vmcentos DocumentRoot /var/www/calendar/public ErrorLog /var/log/httpd/calendar/error.log CustomLog /var/log/httpd/calendar/access.log common <Directory /var/www/calendar/public> AllowOverride all Options -MultiViews Require all granted </Directory> </VirtualHost> 

At the end of /etc/httpd/conf/httpd.conf I added:

Include sites-enabled/*.conf 
  • netstat -tulpn | less returns:

enter image description here

  • passenger-status returns:

enter image description here

I'm not sure what could be the problem, but my app is not being loaded, any kind of help or commentary is welcome!!!

1 Answer 1

0

sorry for being not fully into this, i started learning ruby recently. but shouldn't the document root be the root of the project, and the directory point to the public? like

 DocumentRoot /var/www/calendar/ <Directory /var/www/calendar/public> AllowOverride all Options -MultiViews Require all granted </Directory> 

i found this config on another website, using passenger and apache2 on ubuntu/debian systems

<VirtualHost *:80> ServerName example.com ServerAlias www.example.com ServerAdmin webmaster@localhost DocumentRoot /home/rails/testapp/public RailsEnv development ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory "/home/rails/testapp/public"> Options FollowSymLinks Require all granted </Directory> 

5
  • for if this answer didnt fully work, i found this website on how to set it up on centos6: digitalocean.com/community/tutorials/… Commented Dec 7, 2016 at 13:12
  • Every tutorial, website or reference I've saw show that DocumentRoot point to the public directory instead of the root of the project. You can see that in the last config you put. Commented Dec 8, 2016 at 2:47
  • Ye i know though my feeling says the document root should't be in public. Well, i hope you have found an answer or that the link had some usefull information Commented Dec 8, 2016 at 6:42
  • Yeah, I followed that tutorial (and a couple more too), but I can't make it work, thanks anyway. Commented Dec 8, 2016 at 13:17
  • Oh and about the timeout error, as you are in vm. What are the vm lan settings? Commented Dec 8, 2016 at 13:33

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.