0

I have a small Rails app currently being served (dev and production) by Thin server on port 3000, on a Debian box that also has apache2 running, serving PHP applications.

I am not certain if this is even possible given the current setup but is there a way to remove the port number from the rails app url but still have Thin listening from the same port so not to bump into apache?

Current

https://my-rails-site:3000/

Proposed

https://my-rails-site/

Or should I just use something like Passenger?

2 Answers 2

1

No, this is not possible. Either run it from inside Apache (e.g. with passenger) or use Apache as a proxy to route it to another port.

However, if you don't use SSL at all on Apache (and that port is unused), you can run your app on port 443 if it also does the SSL, as port 443 is assumed if you give an HTTPS URL.

1
  • OK, that's kinda what I was thinking you'd say. Thanks
    – Slinky
    May 1, 2013 at 11:54
1

If you are using passenger here is what I had to use to get it working on www.mysite.com without using www.mysite.com:80 on a centos server:

In etc/httpd/conf the key was to uncomment the NameVirtualHost *:80 and change the * to my server's IP address. Make sure Listen 80 is uncommented. Also add your ip to the VirtualHost tag. It must be running on port 80, not 8080 or something of your choosing.

NameVirtualHost xx.xx.xx.xx:80  

Listen 80  

<VirtualHost xx.xx.xx.xx:80>
    ServerName www.mysite.com
    # !!! Be sure to point DocumentRoot to 'public'!
    DocumentRoot /var/www/vhosts/mysite.com/httpdocs/public/
    <Directory /var/www/vhosts/mysite.com/httpdocs/public/>
       # This relaxes Apache security settings.
       AllowOverride all
       # MultiViews must be turned off.
       Options -MultiViews
    </Directory>
</VirtualHost>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .