0

Ok so what i'm trying to do is deploy my first rails project. I've asked this question and i think i figured out that you can't configure apache to work using an ip and you have to have a domain name.

The reason i can't use the domain name yet is because i'm recreating a site for someone and they don't want it to be down in between switching the domain from their current site to their new rails site.

I'd like to get my rails app running on a server so I can test it out and then once it's ready, switch the domain name.

How can i setup a server to run a rails project without using the domain name?

Community
  • 1
  • 1
Catfish
  • 18,876
  • 54
  • 209
  • 353

1 Answers1

1

If you want to run the rails project locally in development mode, then just run the command rails s from the root of your project.

It is possible to deploy two apps to the same server, or two versions of the same app, I typically use sub-domains for this, website.com and then testing.website.com.

You will just need to have seperate databases and seperate virtualhost files.

You could also try to access the apache machine by it's IP address if it is on the local network.

OpenCoderX
  • 6,180
  • 7
  • 34
  • 61
  • So if i wanted it on the internet, i'd at least have to have 1 `website.com` setup for rails in order to use `testing.website.com` correct? Like i can't have a php project at `website.com` and then have a rails project at `testing.website.com`? – Catfish Jun 26 '12 at 20:23
  • You could do that just fine, the details are in the apache virtual host files located in: /etc/apache2/sites-available. Yes you need at least one website to support subdomains. You can get to a server by IP, but putting it behind a domain is part of the final recipe, so why not bake that in from the beginning. Having the entire deploy process worked out has helped me feel better about writing code, I know i can deploy it with a simple 'cap deploy' at a moments notice. Adding new subdomains is a simple as adding an 'A' DNS Record and adding a new virtual host in sites-available. – OpenCoderX Jun 26 '12 at 20:51