We have a production website that is located at domain.com.
I would like it to be staging.domain.com.
The website is written in Ruby on Rails, and it uses apache and passenger to deploy.
I have edited our etc/hots file to say
(ip address) staging.domain.com
I have also edited the staging.domain.conf file in etc/apache2/sites-available and added it to sites-enabled.
I edited the .conf file to say the following in both http and https:
ServerName staging.domain.com
ServerAlias staging.domain.com
I also updated the DNS records locally, and globally.
However, when I go to staging.domain.com it redirects me to domain.com.
Domain.com is hosted by another server and it reroutes me to this other server.
If I ping staging.domain.com I get the staging server.
And when I go to ipaddress in a url it gives me the apache2 default page.
What else do I need to change for staging.domain.com to be the default url for this server?
Please forgive my ignorance here as I've never looked at Ruby on Rails before.
This was actually a DNS problem, that it wasn't taking me to staging.domain.com. I was able to resolve this by updating my local DNS.