NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: rjolda on February 20, 2018, 02:34:01 PM
-
Hi All,
Have a web app NT 10.15 , C8.0.9661.
I have a secure server on the web running my app in SSL with certificates.
PROBLEM: I need to run the app locally on my dev. machine for testing in local mode - eg port 90.
I have the following embeds in webServer.Init:
set:Domains = 'www.MyDomain.com'
set:SecurePort= 443
set:InsecurePort = 90
Runs great on my server.
However, to test locally, if I comment out:
!set:Domains = 'www.MyDomain.com'
! set:SecurePort= 443
set:InsecurePort = 90
It still runs on port 443 and I can't run it locally.....
How do folks get around this???
TIA,
Ron Jolda
-
Hi Ron,
I edit my hosts file (located usually at C:\Windows\System32\drivers\etc\hosts).
The host file has no extension and will likely require local administrator access on your computer to edit.
I then place at the bottom
127.0.0.1 mydomainname.com
This will locally redirect any application on your computer trying to access mydomainname.com to the IP 127.0.0.1 (you can redirect it to other IP address if your computer has multiple IPs).
This means 1. your SSL certificate will work normally and 2. you wont be able to access that URL externally while the hosts file is changed - but just edit it back when you need to go to the real domain).
Once you save the hosts file it takes effect immediately, no reboot required.
Regards
Bill
-
Hi Ron,
This answer will be in multiple parts, because I believe your "problem" is that you are assuming something which is not fact. So this answer will take the form of a number of questions which will lead us to the incorrect assumption.
a) >> PROBLEM: I need to run the app locally on my dev. machine for testing in local mode
So, just to be clear, you have a server out there on the web with a dns name and a certificate, but of course you are developing locally on your machine. So you run locally, then deploy to the server once you are ready?
b) what URL do you use for your main server, and what URL for your local machine?
I presume you are using the Settings Control template on the WebServer window. Are you?
Cheers
Bruce
-
Hi Bill,
here's a slight modification to the way you do it.
a) say you have www.bill.com then add a DNS entry for local.bill.com and point it to the same IP address.
b) On the server set the domains list to www.bill.com, local.bill.com and Get Certificates.
c) copy the whole certificates folder to your local dev machine.
d) Edit LocalHosts to point local.bill.com at 127.0.0.1
Now every 3 months or so you'll need to copy a new set of certificates from www to your local machine. But you can access either site at any time (or the same time) without the need to further edit the localhost file.
Cheers
Bruce
-
Hi Bruce,
Yeah I sort of do it like that, myself.
My dev boxes will have a url like:
p7720.bill.com (p7720 being my machine name - and only setup via hosts file).
bill.com will be the production box main url.
So that way I don't have to edit my hosts file.
I also have QA servers and more than one dev box so it allows me lots of flexibility.
I was just keeping my example simple.
Regards
Bill
-
HI Bruce,
I have Certificate for my domain www.mydomain.com which is hosted on a remote server at a fixed IP address. https://www.mydomain.com to reach app running on port 447.
Locally, I am tesing the development app at 127.0.0.1:90. (or trying to...).
Using the Server setup parameters at Server.Init as noted in first posting.
Thanks,
ROn
-
Hi Ron,
don't test locally in insecure more, test locally in secure mode.
cheers
Bruce