1

This is a very basic question. I'm running a VPS, and I can run web apps on the server to any local ip/port as I choose. How do I actually get these local ips/ports mapped to live domains registered on the server to make my site accessible?

It's a ruby on rails application, running on a cPanel VPS. I'm starting the ruby on rails server simply by typing rails server, using the simple default WEBrick server ( I don't need anything more complex right now ). By default the app starts on port 3000, but I can customize that to any port I want.

(NOTE: cPanel does not support Rails 3 because mongrel has issues with it. I am not using mongrel, just the default WEBrick server, so this should not be an issue. )

Ankit Soni
  • 123
  • 6
  • what you meant by local Ip.? You don't have public IP assigned to your server ? – SparX Oct 03 '11 at 20:26
  • I'm running an application, and it starts the application on 0.0.0.0:3000. I just need to host that on a real domain now – Ankit Soni Oct 03 '11 at 22:01
  • 2
    well, 0.0.0.0 means all interfaces and you can simply access the application using your-public-ip:3000 – SparX Oct 03 '11 at 22:18
  • @SparX OK, thanks. Now, how can I host the web app on a specific URL on the server only? (since the server hosts multiple apps on multiple domains) – Ankit Soni Oct 03 '11 at 22:29
  • What kind of application you are trying to deploy? Please add more details in your question. Normally, you can point the domain to your server IP and then can use ProxyPass in apache conf to redirect the traffic to that domain to your internal app running in 0.0.0.0:3000 – SparX Oct 03 '11 at 23:16
  • @SparX I added in the details, I hope thats enough. I really appreciate all the help so far, I'm just very new to this and google isn't helping much. Feel free to post your response as an answer, I will accept it. – Ankit Soni Oct 04 '11 at 02:26
  • This question appears to be off-topic because it is about [`working with a service provider's management interface, such as cPanel`](http://serverfault.com/help/on-topic). – HopelessN00b Jan 13 '15 at 22:09

1 Answers1

0

What you need to do is,

  1. Create the domain through WHM
  2. Start your web application on the desired port(eg: 3000) and bind to localhost (since public access via port 3000 is not necessary).
  3. Setup ProxyPass and ProxyPassReverse in apache conf.

ProxyPass / http://127.0.0.1:3000/

ProxyPassReverse / http://127.0.0.1:3000/

Now all the requests to domain.com will be forwarded to your rails app running on port 3000 and vice versa.

SparX
  • 1,924
  • 12
  • 10