Return full domain name?
Posted by: aburns (---.hsd1.ms.comcast.net)
Date: September 11, 2017 04:37PM

Hello all. New here, got a question.

I've installed WAMP Server on my Windows 10 box to test beta versions of my web site so that I don't have to experiment on the live site. I've got everything working great, except that the PHP script that powers the site uses a license code that is some type of encrypted version of the domain name. It won't load on anything except that domain. Of course, I have a license for the live site, but when I try to load the script on localhost with that license it chokes on the key. I reached out to the vendor for help, and they said they can't provide a key for localhost because that would basically be a crack of the software if it ever got out. I completely get that.

Sooooo...... I need to fool the script into thinking it's running on mydomain.com and not localhost/mydomain. Is there a way to set this up in my virtual host?



Edited 1 time(s). Last edit at 09/11/2017 04:39PM by aburns.

Options: ReplyQuote
Re: Return full domain name?
Posted by: Otomatic (Moderator)
Date: September 11, 2017 05:39PM

Hi,

To use domain names, you need to create local sites as VirtualHost, see: The need for Virtual Host

It is not a good idea to use a ServerName or ServerAlias that is the same as your live domain name, as if we had used example.com as the ServerName it would mean we could no longer get to the real live site from this PC as it would direct example.com to 127.0.0.1 i.e. this PC and not out onto the internet.

But you can use a subdomain, for example dev.mydomain.com. as ServerName in the VirtualHost.

Just ask your vendor to provide a key that is valide for subdomains. This works perfectly, this is what I use for some applications in my sites that need activation keys.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.27 - PHP 7.1.9/7.0.23/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
Wampserver 3.1.0 64 bit - Apache 2.4.27 - PHP 7.1.9/7.0.23/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.