I have a little problem. I know that its possible to configure sub domains on my local Machine using host file settings and creating new WEBSITE within iis 7.
Let's say I have an IIS web site. And within it I have another web application defined as application folder not just as a virtual folder (which runs it under same process).
Basically I can access my apps like
Example
http://mydomain.com/app1
http://mydomain.com/app2
i want it to be
http://app1.mydomain.com
http://app2.mydomain.com
Looks like there is an answer at Server Fault.
Basically, create two web sites and set the host header on each to app*.mydomain.com.
But you could also use the IIS7 URL Rewriting Module, and there is an example of use, again at Server Fault
Create new websites with that hostheader and set the directory to that on the local file system of
http://mydomain.com/app1
i.e.
C:\inetpub\wwwroot\app1
Please refer to my other question for the answer to this question. Sorry for the repetition
Related
Context
I have an Asp.Net MVC application. I would like to deploy it to an IIS (Windows Server 2016). I do not care which will be physical path, but I would like to access to the application in the virtual path '/'
(I am using Package web publish method, because no online access to the server, but I think this question is on IIS/ASP and not about publishing. I clearly miss some basic concept about IIS/ASP.)
What I've tried
1) When I try to create an Application in IIS then the dialog forces me to add an application Alias, which becomes the part of the virtual path. So regardless the physical path now the the url will be
myserver/myapp/mypage instead of myserver/mypage
which is not what I want. I would like to access to the page as myserver/mypage
2) If I simply deploy the app under wwwroot then it will appear as myserver/mypage it seems to be working, but where is the "Application" this case? (see picture).
Question
Maybe I missing something: Is this the Default Web Site is an "Application" in its own right? How to configure then its Application settings? If not, then how can I create an Application which's virtual path is '/'?
If I have understood your question correctly, you want to access the application as servername/pagename. In order to do so, do not create an "application" or "virtual directory" under a "website". Instead, directly host the content under Default website. You can change its path under "Basic Settings" and point it to your content folder.
You can also create another website at port 80 and point it to the location where your content is present. However, you will not be allowed to create 2 website with the same IP-port-hostname combination. You can solve this problem further in 3 ways.
If Default web site is not in use, then instead of creating another website, click on Default website, select basic setting from right hand panel and change the path to application content folder.
If Default website is in use, then create another another website at port 80 with a hostname.
If you do not have a hostname and are accessing the application using server-name, then you will have to modify the port to 8080 or something like that.
Refer my blog - https://blogs.msdn.microsoft.com/parvez/2016/07/27/iis-bindings/ for more information about IIS bindings
I am creating a website in asp.net MVC 4 and am wondering the best way to set up a test server?
I am doing this from home and would like a way for my friend to test my code from a different location (his home). What would the best way to go about this? Build a local server that he only has access to? VMWare? Online web hosting?
One solution would be to use a VM and set up a server.
NOTE! that this would require your friend to redirect your IP Adress to the host name you will set for your website on the IIS of your VM.
He can easily do that by changing his Hosts at C:\Windows\System32\drivers\etc
Another option would be actually to purchase a domain (that you will need anyway eventually)
The purchase a hosting package (that you will also need anyway eventually).
Then setup your website on a sub domain in that hosting server e.g. dev.myDomain.com
my friend have a site whole written in aspx (i dont know much about it).
we are trying to switch his web-hoster. we opened a new account (in a web-host site that supports everything we need) and moved all the files AS IS to the new web hoster.
now we get a:
Directory Listing Denied
This Virtual Directory does not allow contents to be listed.
what where we doing wrong? is there anything we need to concider besides putting the files in the new web-hoster...?
thanks.
Try http://yourwebsite.com/yourwebpage.aspx if this works then your deployment is correct. Now what you want is set the default page to "yourwebpage.aspx" as already commented by Brandon. Different host service provide different ways to do this. First let us know if http://yourwebsite.com/yourwebpage.aspx works. Also provide your host service provider name will look into their documentation and tell how to setup default page
It sounds like the website could have been running a url rewrite module which would require the server to pass all requests via asp.net using wildmapping.
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx?mfr=true
There are different ways this is handled depending on the version of IIS you are using. There is also limitations on this depending on your hosting environment.
A couple of questions that might help identity the issue
Was the previous hosting environment shared or dedicated/virtual
Was the previous hosting environment Windows 2003/IIS 6 or windows 2008/IIS 7
Is the new hosting environment shared or dedicated/virtual
Is the new hosting environment Windows 2003/IIS 6 or windows 2008/IIS 7
Before and application can run, you need to specify that the folder is an asp.net application. There should be a way to do this through your control panel, if not contact the vendor
I don't want to pay for a domain, but simulate a url exists, something like 'www.myapplication.app'. Is this possible?
I'm guessing I need to configure some thing with IIS7 or something right?
This is for a college course and instead of just doing the bare minimum I'd like to make something very nice to show.
I realize this question might be broad but any links would be great. :) Especially if it starts from the beginning of IIS configuration.
My ultimate plan is to have a Windows Server 2008 on a Virtual Machine and publish it there, is it possible?
c:\windows\system32\drivers\etc\hosts
In this file you can mimic domains, for example you would put:
127.0.0.1 www.myapplication.com
Where 127.0.0.1 is always referring to you locally (== localhost)
Added obvious step:
You then create an application in IIS where you use this domain in the HostName of the application. You then can acccess your own domain from your browser.
ASP.NET - IIS 6 - we currently have a public-facing site that has a domain mapped against it. We are going to add a new web site in IIS 6, with its own IP, its own SSL cert, and its own domain name on the same server as the original web site/domain.
Let's say I want c:\inetpub\wwwroot\example to be be served up to the two different sites, where each of the following URLs would load the same .NET code.
https://www.domainA.com/example
https://www.domainB.com
...I'm trying to not splinter my code, but I'm not sure if there are pitfalls with the above approach. Will that work?
Yes. I have had two separate sites / virtual directories pointing to the same physical directory on the server with one set of code.