Applying SSL on the localhost - asp.net

I am applying SSL in my sample web application using self signed certificate. The purpose is to test the session availability when I go from http to https or the other way round.
My localhost address is localhost:5366. I have done these as follows:
I have added a website in IIS. But confused that when binding using http, I give port 5366. I works fine but when I remove it and apply https, port 5366. The page doesnot load.
So, what should I do to accomplish this?

Its a bit confusing, but if i can bet, you are interchanging the debug mode from VS and the published site, correct me if am wrong.
I configured my https site in this way:
Configure your IIS to accept https through port 443.
Set the website file system place to a certain folder
Publish your website with VS to this folder
Reach it through https://localhost
Hope it works!

My project was not residing in the iis physical path. Therefore, it was not loading my desired pages. Thank you guys.

Related

Host ASP.Net MVC Site

I've created a site using ASP.Net MVC that is meant to be stored on a local machine at my place of work. The intention is to have the site stored on this machine, but then accessible by all the other machines within this building.
I've followed Microsoft's tutorial as well as Code Project's tutorial, but I am not having very much luck. The binding is just the localhost, port 80, with * for the IP address. The URL is localhost/GrantTracker.
I've opened the ports within the firewall, checked the permissions on the directory (which is just within wwwroot), tried having the site take the place of the default IIS site (as Microsoft tutorial has you do) and tried having the site stand on its own with its own port (per Code Projects tutorial).
On the host machine I am receiving the standard "This site can't be reached, localhost refused to connect" which feels like either a port or permissions problem. I must be missing a step, but I can't seem to find what it would be. I am new to hosting sites through IIS so forgive me if I am just missing something basic.
I find it a bit strange too because my project uses Windows Authentication and when the site is first visited it performs that initial check with the user, authenticates, but then throws me the error.
Anyone have any ideas? Thanks in advance.
start simple,
create a simple html page, create an IIS application for it, on port 80.
Check and make sure you can see that page from another computer using the internal IP address of the the host machine so something like:
http:\\192.168.0.3\hostapp\test.html .
You can see the proper URL by running it from IIS, this will give you the entire URL you need, with localhost then just replace localhost with the IP address of the host machine to see it on other machines.
Do this in the original IIS folder so you don't encounter any folder permission issues. If you choose another folder you'll have to give access to the Network Service user ( i think, can't remember now, but there is a specific user that needs access to the folder where the website is deployed )
if you can see the page then deploy a proper website and do the same thing. Make sure the app pool is created correctly and it's up and running, then access it again on other computers and it should work.
Port 80 should be open by default so that should not be an issue.

Will my SSL certificate work for new Wordpress website on IIS?

I have an IIS running on the server and a website (.net) running perfectly on http (80) and https (443). And i have a new Wordpress website. I wanna publish the wordpress site on the same domain. In order to do it i will remove the files of the present website and place the new site's files and in theory,i expect IIS will start to show this new site. And all the bindings and everything s set on IIS for this SSL certificate for the same domain. So my question is , can i expect that new site will run perfectly on http (80) and https (443)? Or will https fail?
Yes, in theory it should work but as you know with IIS, what is true in theory may not always be true in practice.
What you will find tricky is that Wordpress is heavily reliant on URLs and it may be tricky to run both options, ideally you should force one or the other but there are techniques that allow you to run both.
I can't speak for the effectivity or efficiency of this but here's a link: https://blog.rabin.io/sysadmin/make-wordpress-site-work-both-http-https
Well in theory it supposed to work but it didn t. Eventually i figured that SSL certificate was revoked.

Deploy web site without using a domain

I am new to the web world, so I apologize if this question is silly.
I have an ASP.NET web site I wish to deploy.
The server has IIS 7 deployed on it, and I've added the site
to that IIS server as a web site.
For the time being I don't have a domain mapped to the site,
I would like the users to browse for the site directly by using the server's IP.
Is that even possible? because I failed to do it.
The only option that worked so far is using the hosts file to declare
a fake domain.
It would be nice if someone could clarify that issue for me.
Thanks a lot,
Omer
If you set the site bindings to IP address: All Unassigned on port 80, and do not provide a host name, then any request that makes it through to IIS should be served by that site. Make sure you stop any other sites that might have that binding (e.g., "Default Web Site" is normally bound to this).
In order to access the site by IP, you can't have the host name populated in IIS. Your best bet would be to use the "Default Web Site" that's already in IIS, and point that to your application.
Using IP is possible, but you need to make sure your users can see this ip from their machines.

Unable to access my published web page from other computers

I have published ASP.NET web site, using IIS7 on Win7. I can access this web site on my localhost, but it is inaccessable from other computers via internet. I have tried to disable firewall and anti-virus program, but with no success.
Does anyone know what may be causing this problem?
It works fine if I publish it on winXP.
Try checking out your router settings for port 80 forwarding;
Check out information about your internet provider as well;
There are providers that block port 80 outgoing traffic.
Try checking to see if the website is actually bound to 127.0.0.1. If it is, it would work for you but no one else.
Try to hit the website from a different computer on the internal network. If you can't hit it internally, then it is an issue with the local configuration on the webserver. If you can hit it internally, but can't hit it externally, then there is some kind of routing issue from the outside.
Its likely a routing issue from the outside, so think about these steps:
External DNS
Proper NAT/Firewall settings
Try using telnet to connect to the website and see if you get a response
Use tracert from the outside to see where the traffic is failing (if its failing)
Check the security settings on the deployed folder and check "Everyone" has read access. If you've not deployed under wwwroot they may not

Local testing for sub-domains using Url rewriter, Asp.Net 2

I am using UrlRewriting.Net for url rewriting in Asp.Net 2 and IIS 5.1 (offline) and IIS 6 (online)
The application performs the following:
A url of the following nature: http://username.site.com is re-written as
http://site.com/Default.aspx?user=username
This works perfectly online. However, I would like to know how we could test this offline.
I have tried pointing the application to 127.0.0.1 via IIS and then putting username.site.com in the hosts file to point to 127.0.0.1 - but it does not work out.
The website loads up - but the querystring is not generated.
Also tried putting just site.com -> 127.0.0.1 in the hosts file and accessing username.site.com. But in this case, the website does not load (site not found)
Any ideas?
easy way to test this will be to edit your hosts file so that username.site.com points to 127.0.0.1, but you will have to do this for each user you want to test on each PC...
Okay.
I managed to get this working. Its simple if you think about it.
I got myself a DNS server, installed it on my system and configured it to serve me pages from 127.0.0.1 for site.com
If you are wondering, I used a DNS server called SimpleDNS from http://www.simpledns.com/
There is also a free BIND DNS server available from:
http://oldwww.isc.org/sw/bind/view/?release=9.6.1b1&noframes=1
But that was too much for me to configure at this point of time.

Resources