netsh http add urlacl work like a local DNS? - http

I'm using netsh http add urlacl url=http://devsite1:80/ user=everyone as mentioned at http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx to work with 80 and 443 SSL port, but web browser can't bind my http://devsite1 local address and them, nothing work.
Should be really have set line as 127.0.0.1 devsite1 at hosts file in Windows drive etc folder?

In this link above he said:
My machine is called HANSELMAN-W500, so I'll use that name. You could update your hosts file and use a friendly name. To start, use your computer name. if you don't know the name of your computer, you're silly. Go to the command prompt and type "HOSTNAME" to find out.

Related

forward localhost to ipadress on local netwerk

I have a domain name registered and i made an A record on it that points to 127.0.0.1 (aka localhost). I want to be able to work on websites in this case from machines that are in the same network as the server its running on but those servers are not open to the public internet. I still want to use my test subdomain to access this website but that would point to the machine im working on at that time so it must forward the requests to an 192.168.. ip adress I have set entered on the machine. Is there a windows command i could use that forwards localhost to a specific ipadress, like linux has 'iptables'? Or a program that could do this? Preferably for free.
I dont want to add my internal ipadress to a dns record because that would be sensitive information.
What about adding an entry to /etc/hosts (linux) or c:\Windows\System32\Drivers\etc\hosts (windows) ?
The format is: <ip address> <servernname>, e.g.: 192.168.10.12 www.stackoverflow.com.
Once you did that, accessing http://www.stackoverflow.com from the machine where the hosts file has been edited will end up being served by the server running on 192.168.10.12.

IIS 7.0 - Default Web Site is not working

Just now I added IIS in my system. And I try to start Default Web Site in IIS. But it will throwing following error,
The format of the specified network name is invalid (Exception from HRESULT:0x800704BE)
Here my Screen-shot,
So, I don't know what i did..? Then I fail to see how can I solve this problem.
How should I solve this exception?
It may be because the IP 127.0.0.1 - localhost may not listen by computer
Check with below command in command prompt:
netsh http show iplisten
It should return the 127.0.0.1.
If it is not there then add it to using below command:
netsh http add iplisten 127.0.0.1
If the IP address is successfully added, you receive the following message:
IP address successfully added.
Please follow these steps to solve this issue:
1. Get currently listed IP:
netsh http show iplisten
(this will list just one IP of your machine)
2. Delete old IP with this command:
netsh http delete iplisten ipaddress=11.22.33.44
(where 11.22.33.44 is the IP received from #1)
3. Next, set the service UP to listen to all the IPs:
netsh http add iplisten ipaddress=0.0.0.0
(if you dont want to open for all IPs then just pass single IP)
4. To make these changes reflected, Restart IIS using:
iisreset

IIS 10 Site Bindings wildcard development machine

I have successfully setup IIS on my local development machine (dev branch - setup as localdev.me) but when I went to setup another branch (hotfix - setup as localhotfix.me) I am running into issues. The issues are due to the way the site is setup. The subdomain of the url is used to determine which Database to connect to. So going to host.localdev.me will connect to the host database. So in IIS I have the following settings for the bindings of the site.
Type Host Name Port IP Address
http localdev.me 80 *
http *.localdev.me 80 *
I can ping localdev.me with any subdomain and I get the loopback address as expected. When I then setup the hotfix branch (exactly the same as the dev but with the following bindings) I get name not resolved errors.
Type Host Name Port IP Address
http localhotfix.me 80 *
http *.localhotfix.me 80 *
Is there a reason the first setup would work and not the second? What is perhaps even stranger if I tell IIS to stop I can still ping subdomains on localdev.me and get the loopback address.
I could always get it working by manually specifying the host name in my windows hosts file but I would rather not do that as I would need to go in and edit the file every time we add a new subdomain.
EDIT: These are the specific errors I am getting.
ping localhotfix.me
Ping request could not find host localhotfix.me. Please check the name and try again.
EDIT2: I have a solution that works fairly well. It requires Acrylic DNS and installation of the Microsoft Loopback Adapter. I set the loopback adapter to a valid IP Address and set the DNS server to 127.0.0.1 then edit the AcrylicHosts file to contain entries for each domain with a wildcard. Once I did all of this I was able to ping localhotfix.me along with *.localhotfix.me. I believe the reason localdev.me worked is because it is a valid domain. The name would resolve at which point I believe IIS was able to take over. But thats really just an educated guess. But kindof makes sense as to why it worked for one and not the other.
The reason *.localdev.me works without a hosts file is because the public DNS for that domain resolves to 127.0.0.1 as long as it is not localdev.me or www.localdev.me. You can check this using nslookup *.localdev.me (replace the asterisk with anything except www) while your hosts file is empty. On the other hand, *.localhotfix.me is not registered in public DNS at all, which is why you'd need a hosts file entry for those.

website cannot be started another website may be using the same port

Trying to set up a default website in IIS. When trying to start the website I get the error message: "website cannot be started another website may be using the same port."
I don't see any other bindings on port 80 in IIS. Is there a way to determine what else might be using the port on the machine?
Thanks
Ran across an issue like this when I was setting up a new web site on port 80. Of course, the Default Web Site instance is also on port 80, and conflicts. I thought I solved this by going to "Edit Bindings" and changing the "Default Web Site's" port to 81 and leaving my new site on 80. I still could not start my new site.
I had to delete and re-create my new web site, then I could start it.
It's like it still thought "Default Web Site" was on 80, even though it wasn't. Even an iisreset, a recycle of my new site's app pool and web site all did not work. Maybe if I had restarted the site/app pool of the "Default Web Site", maybe that would've worked, too, but didn't try it - just deleted/re-created my new site. But that was enough to break through the "Default Web Site" keeping a hold of that port!
I also received this error, but it was not because of multiple sites (my installation of IIS only had a single site with a single binding).
Running netstat -ano showed nothing listening on port 8624.
The problem was that a URL Reservation was generated previously for a different web server. I was able to query the URL ACLs with the following command in PowerShell as administrator:
netsh http show urlacl
To remove it, enter the following (replace the last argument with the reserved URL from the show urlacl query):
netsh http delete urlacl http://*:8624/
or more specifically, go to cmd and type in :
netstat -aon | find ":80"
Go to Cmd, then type netstat -a
Look for local address or local port for 80, or http
After reboot of a system the "Windows Sync Share" service was occupying port 80 and 443. This service needed to be stopped allowing the default website on 80 to start. Changing the "Windows Sync Share" service from "automatic" to "disabled" prevented this from reoccurring.
I had the same issue. In my case there was only one site. Somehow the install of a certificate created a second https binding?! Deleting one of the bindings solved the problem.
I had the same issue. Found that I had to bind my application in https mode, a cert is installed on my PC which defaults to 443 port when binding.
You have to set an Host name on the ftp sites, even fictitious.
Than you have to use this login name notation hostname|username
Look at this:
https://forums.iis.net/t/1196572.aspx

localhost problem on windows 7

I'm using Windows 7 Pro and want to run my web project locally, but the url www.localhost.com does not work.
If use http://127.0.0.1:2710/default.aspx it works. I checked host file which in the C:\Windows\System32\Drivers\Etc\hosts folder. If I delete the rows:
# 127.0.0.1 localhost
# ::1 localhost
Nothing changes. How can I make www.localhost.com work on my machine?
Hope I understand your question correct. You want to acces your local site using www.localhost.com
Just edit the hosts file and add the following lines
127.0.0.1 www.localhost.com
I checked my Windows 7 hosts file and it has the following lines
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
Above lines are comments and deleting those lines does not do anything.
Note: If you get "Access denied" when you save the hosts file then open notepad as Administrator and then edit hosts file and save it. It should work
EDIT: The rows you deleted were just comments, so that doesn't matter.
Were you trying to enter your url just as localhost
or as http://localhost:2710/default.aspx?
The latter is probably necessary, as the 2710 is the port number, and without it will default to port 80, which probably doesn't have anything listening on it.
UPDATE: It might actually be an IPv6 thing, so try it with just this line in your hosts file:
127.0.0.1 localhost
You should not have a # at the beginning of the line, that will disable that line.
(You might need to reboot too).
You could also try pinging localhost (just type ping localhost in a command prompt window) and check that you get a reply from 127.0.0.1
Did you try:
http://localhost:2710/default.aspx ?
Okay, simply put, your web project will run on http://localhost:2710/default.aspx, once you put those lines you removed back into the hosts file (More on it here). To get to remove the port number, you need to reconfigure your web server.
Now, if you want to get a domain, that's a different thing altogether... then, you need to get a registrar and use DNS to get it to map to you. You would do this if you wanted other people to be able to use something like www.site.com to get to your site.

Resources