Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
OK, that's kinda what I was thinking you'd say. Thanks –  Slinky May 1 '13 at 11:54
add comment

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>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.