web services on a dedicated port within an ASP.net web site - asp.net

Is it possible to have a web service within an ASP.NET forms web site run on a different port, sort of like how SSL has a dedicated port?
The service needs to see the app_code folder in the existing site and of course app_data.
Any links to articles or tutorials would be greatly appreciated.

You can have several different ports bound to a website in IIS, however if you bind that port, it will work on the whole website. You can't bind a port specifically to a directory within a site.
So you can have a secondary port (ex: 8080) added along with a hostname through the website bindings in IIS.
If you don't want to have the rest of the site (that's not the web service) to respond to the secondary port, you would have to do it through either code, or configuration.

Related

Multiple websites under a folder in IIS

I have a problem with websites in IIS.
The first thing that I did was that I set basic .html website in IIS under Default website (port 80). I moved the code in C:\inetpub\wwwroot\Test and it works.
When I type in the browser localhost/Test, it works but I have an ASP.NET Core web app and I want to open it using localhost/MyAspNetSite in the browser. Is this possible???
I'm asking that because when I right click on the Default website I have no possibility to add new website, only virtual directory or application. In my case, I put my .net code in C:\inetpub\wwwroot\New and in I added the new website on port 5000 and it works like localhost:5000 but not like localhost/New. I hope that you understand me.
Is it possible to have two websites on the same port or to connect two websites or something like that?
I am sending image about this problem. Thank you
You can host multiple sites under the same IP Address. In this case, the IP Address is called "Shared IP Address". This concept is used by all the shared host providers in this world.
That you basically need to do is to go to your IIS -> click your domain -> Bindings -> and add "www.yourDomain.com" and "YourDomain.com" to the IP. If you have a second site, you just have to do exactly the same thing, you can check this blog post it can help u to understand all that things
http://woshub.com/run-multiple-websites-on-the-same-port-and-ip-address-on-iis/

How do I get IIS to direct traffic to other binded directory

I have two sites configured on my IIS 7 server. One is the default web site and the other we will call www.othersite.com. The default web site runs a few different Applications running ASP.NET and the other site is a ColdFusion 8 web site.
The default site is configured to pull from the default web location at C:\inetpub\wwwroot while the other is set to pull from C:\sites\othersite.
The bindings are set to send all unassigned traffic to the Default Web Site, but www.othersite.com is set to a specific IP address. This is the same as I have it on other servers, which work perfectly well, but for some reason when I load www.othersite.com it is looking for its files in C:\inetpub\wwwroot instead of C:\sites\othersite even though the physical path is clearly defined in the basic settings.
Anyone have any idea why this might be and how I can get it to point to the proper directory?
Under IIS >> Bindings, you can see a place to put in "Host name". Leaving blank will result in all traffic to IP or host, but by specifying a host name (www.othersite.com) will direct traffic to that dir/site.

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.

Classic ASP and ASP.NET sites on the same IIS

I have to set two web sites on the same IIS 7.5.
One of them is Classic ASP with MSAccess Database. The other one is ASP.NET. Meaning they will use different Application Pools.
I only have one port open : 80.
How can this be configured?
Thanks.
You can create 2 applications under the same website using the same port (80).
Each one can have different Application Pool.
This way, to browse applications, you will type
http://mywebsite/app1
http://mywebsite/app2
Otherwise you can have 2 different websites using the same port, but this involves configuring host header bindings over IIS and creating C-NAME record in your DNS
This way, to browse applications, you will type
http://app1.mydomain.com
http://app2.mydomain.com
You need to configure host headers ("Bindings") in IIS for your first site before you can open the second. In other words you have to tell IIS which hostname leads to the first website, cause you can't run 2 websites as "default" hostname.

Is it possible to run ASP.NET in IIS 7.5 without creating Virtual Directories or Applications?

I have a Continuous Integration server with dozens of ASP.NET applications hosted on IIS. Everytime I want to deploy a new application, I have to create a new Website or virtual Directory and configure it as an application in IIS.
I would really love to have only one website listening in a specific port (say, 80) serving multiple ASP.NET sites according to wildcard host headers.
For instance:
*.dev.mydomain.int -> my server's ip address (eg: 192.168.1.32)
IIS web site reads the host header and try to find a local folder with the same name. Ex: when a request uses the host header "helloworld.dev.mydomain.int" IIS tries to open a preconfigured folder appending the host header site name (e.g: D:\dev\helloworld)
IIS serves the contents of the folder as an ASP.NET application, using preset configurations (Application Pool, ASP.NET version, and so on).
My goal here is not to create a web site or virtual directory for each and every project in our CI server. I know I can create them programmatically, but I'd prefer a more dynamic solution.
Thanks in advance
You can use MSBuild tasks to create Virtual Directories / Web sites automatically.
http://fczaja.blogspot.com/2009/02/automatic-deployment-of-webapp-on-iis.html
I had it working on a large application with many branches (we had an environment for each branch) and I didn't have to open IIS settings at all. Just pure hands-off process.

Resources