How to point a public domain on another server to your localhost on Linux?

Posted on

How to point a public domain on another server to your localhost on Linux? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, apache-2.2, , , .

This is a rather hard question to ask as I am not sure what is is called. Basically I own a license for a product, which is licensed to one of my domains (eg. www.mysite.com). The problem is I need to test things locally before I make changes on my public website but I can’t install it on my localhost because its Zend encrypted and only works on one domain name. I basically want my localhost server to believe that “www.mysite.com” is located on my localhost instead of trying to connect to it on the internet. Is this possible? I know it was with Windows, but I can’t seem to find how to do this with Linux.

Thanks!

Solution :

You could put a line in your /etc/hosts like this:

127.0.0.1 www.mysite.com

If you are using Apache, you want to make a VirtualHost called “www.mysite.com” and then add “www.mysite.com” to /etc/hosts such as

127.0.0.1 localhost www.mysite.com

Then hit http://www.mysite.com in your browser and the virual host should handle the request locally. See this Apache documentation for more details.

If I understand correctly, all you have to do is to edit /etc/hosts. You should add that line:

127.0.0.1 mysite.com www.mysite.com

Then www.mysite.com will be resolved to 127.0.0.1 which is your machine.

not sure about linux but try updating your hosts file to add 127.0.0.1 to point to Your.Public.Domain.You.Want.ToSpoof

Leave a Reply

Your email address will not be published.