Mobile app version of vmapp.org
Login or Join
Goswami781

: New site created in subdomain, how to move it as a production site and not a subdomain anymore We have a site www.site.com using ip 123.456.789 and we have a newly design website running from

@Goswami781

Posted in: #Dns #Subdomain

We have a site site.com using ip 123.456.789 and we have a newly design website running from a test run subdomain testrun.site.com using ip 987.654.321.

Now the newly designed website is done. It has the same directory structure, we keep the URL intact, same location of images , but different design overall.

Question: if I change the DNS "A" record of site.com website to use
the ip of testrun.site.com 987.654.321 will my site.com use the new design from the testrun subdomain testrun.site.com?

Is this possible?

NOTE:


Site is hosted in apache
The testrun.site.com and site.com is hosted from the same dedicated server.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Goswami781

2 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

I am not sure this will work the way you imagine. I could be wrong.

I am assuming that both sites are on the same Apache server. I am also assuming that your sites are set up as site.com and not site.com and testrun.site.com. Most of the time, a site on Apache would set up as site.com and site.com would have an IP address assigned in the DNS. site.com would be a CNAME that points to site.com. I am working on this premise.

Generally Apache is assigned IP addresses and ports to listen to in the ports.conf file. Websites within Apache are not normally assigned IP addresses. You will have to check your configuration files. If this is the case, then Apache will take any packet in regardless of the IP address and process them the same.

Apache will take the request packet, examine the to address and try and match it to a website. It may still try and match any request sent to site.com or site.com to site.com and not to testrun.site.com. This is because the request packet will not be addressed to testrun.site.com.

Check your configuration files.

Your can find your Apache configuration files in /etc/apache2/ or /etc/local/apache2/. Check the ports.conf file and you should see both IP addresses. You will find your site specific configuration files in /sites-available/. The file name format would be domainname.tld.conf and sub-domain.domainname.tld.conf. Check both files for the existence of your IP addresses.

If you do not see the IP addresses in the site configuration files, then I would say that I do not believe your idea will work. If you do, then I would say perhaps- try it.

If you can afford a short period of downtime, then you can experiment and try this scenario easily. Otherwise, if up time is critical, I would not mess around and simply deploy your new site over your old site only after two complete backups are completed that you are sure you can use to restore the site.

In fact, the other answer to change the directory should also work and could easily be backed out if you change your mind.

10% popularity Vote Up Vote Down


 

@Nickens628

If that's on the exact same server, the IP should not matter. What will matter is the Apache setup. You probably only have to change the DocumentRoot directive of the site.com entry to use the same directory as the new website.

DocumentRoot /var/www/look-here-now

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme