I have a certificate for that is valid for *.MyCompany.com. That is fine for my dev and test servers because the first part of the URLs for those computers ends like that.
I want to test this on my computer and the certificate is incorrect because my computer defaults to the url MyComputer.MyCompany.net.
Is there a way to fake out IIS in to thinking that my computer is .MyCompany.com or am I out of luck when it comes to testing this?
Thanks,
Vaccano
you could edit your hosts file and add an entry to point http://you.yourcompany.com to your local ip or 127.0.0.1
Edit c:\Windows\System32\drivers\etc\hosts with a text editor.
save it and you should be able to hit your own IIS using the new fake name.
You should be able to edit the host header values for the IIS website to accept *.Mycompany.com. To get the DNS to resolve and work correctly, you may need to add an entry to your windows hosts file -- mycomputer.mycompany.com 127.0.0.1. that will let you test locally.
Another option would be to use a self-signed cert for local development.
Related
I developed an Application locally with Angular-7. Eventually, I deployed it to the IIS of a VPS server with IP address 20.20.20.20 (not the real IP). When I run the application as 20.20.20.20, it works perfectly.
Now I want to access the Application with customized name (ePortal). So on the IIS of the VPS server, I made the Host Name to be ePortal. When I typed http://jPortal on the browser url, I got an error that the page cannot be displayed and the url does not exist.
How do I resolve this?
If you want to see your desired name on your local computer only please go to
c:\windows\system32\drivers\etc
And open hosts file using note pad having admin privilege.
and add your IP And your desired name to file and save it.
Now you can browse your server by the name you defined.
In the office, we have already setup a redirect in the DNS to push .dev back to the localhost. The issue is when I am not in the office this does not work. I edited my host file for the websites but as I add more in the future I would prefer to not have to edit my host file.
Is there a way, within my computer, that I can force the TLD of .dev to always go back to my localhost?
I realize I may have to find a way to do this on my router so that the DNS is resolved.
Example:
- Local IIS
-- Website A (with a Host Name Binding of website-a.dev)
-- Website B (with a Host Name Binding of website-b.dev)
When I open a browser on my local box and type in website-a.dev, it should loop back to my local IIS and pull this website. Same thing for website-b.dev, of course, going to the other website. Now I know if at work we have setup the DNS to allow for this but I want to know if this can be done at home, where I do not have direct access to the DNS.
I know I can just put into my host file
127.0.0.1 website-a.dev
But I want a catch all for .Dev to go back to 127.0.0.1
Take a look at:
https://superuser.com/questions/135595/using-wildcards-in-names-in-windows-hosts-file
It explains that using Acrylic allows you to use wildcards and acts just like your host file.
I have a site on my test machine I want to bind into IIS with hosts file.
It's not that I haven't done it before, but this time the page is blank when I load it and chrome says the web page is not available.
In the dev tools Network tab I get ERR_NAME_NOT_RESOLVED and the weird part is that I've entered a domain name in hosts file associated with 127.0.0.1 address. The same site loads when I add virtual directory and access it via localhost.
UPDATE
Screenshoot of the web site, bindings and dev tools network tab.
http://oi59.tinypic.com/6zsfau.jpg
I have also tried loading with Firefox and IE, but same results.
Have no idea what might be the problem.
Here's 3 options I can think of:
Check that your binding in iis is set to "All Unassigned" for the IP address (displays in IIS as "*")
Alternatively bind to a specific ip address and use that ip address in the hosts file
Check that your hosts file encode in ANSI
hope this helps
To be more specific, I have a website called koyn. Here's the domain http://koyn.net . The website is hosted on my computer for testing purposes. I set up port forwarding and made the domain name point to my computer. Everything works fine because when I give the link out to people they can see my website fine, but here's my problem. When I visit my own visit on my computer on my network it directs me to my router settings. I have to type
http://localhost
in my address bar to access my website. I don't want to type localhost I want to access my website with koyn.net like everyone else. How can I do this? Thanks in advance :D!
If you are on windows box you need to edit the hosts file, so when ever you type koyn.net it will reroute to localhost.
I am assuming you have removed your port forwardig. Have you tried cleaning out your browser cache? Another option, assuming you are on a Windows machine is to flush your DNS with the following command:
ipconfig /flushdns
Editing Your Hosts File
Windows default location of host file: C:\Windows\System32\drivers\etc
Open it by notepad as administrator
All operating systems will have a hosts file like my example:
127.0.0.1 localhost
123.45.67.89 www.example.com
#98.76.54.32 www.anotherexample.com
More: https://www.youtube.com/watch?v=7e2MmyPvnhs
after save and flush your dns by command:
ipconfig /flushdns
This is a fairly simple question (in my opinion) but for some reason despite my Googling I cannot find a straight answer to it.
Currently I have an application running under my Default Web Site located at http://localhost/myApp. Ideally, I'd like to create a new site in IIS with a binding to 127.0.0.1:80 and a host header of http://myApp so that I can test my url rewriting rules properly (since my app will ultimately be hosted at http://www.myApp.com, not http://www.somedomain.com/myApp).
So, my question is this: will the above work? I haven't had a chance to try it yet.
If the above will not work, what are the steps to be able to access my site at http://myApp on my local network?
It should work provided you fool the OS into resolving www.myapp.com to 127.0.0.1. To do so, edit your hosts file in %systemroot%\system32\drivers\etc to contain the following:
127.0.0.1 myapp.com
I believe you could do just myapp(without the .com) as well, but that gets a bit trickier because how that is resolved depends on your node type. (hybrid, etc) To be safe, add
127.0.0.1 myapp
to BOTH the hosts and LMHosts files in the same directory. By default the lmhosts is non-existent and there is a lmhosts.sam there. You'll have to rename that to just lmhosts or create a new one.
Then create the binding as per usual in IIS7/7.5 (I assume it's 7... Site->Actions->Bindings->Add or Edit->Populate hostname accordingly).. IIS6 will work too but it's alot harder to get https working should you need it.