IIS7 startup site - iis

I have a Windows 2008 Server with IIS7 on it and a web page running under the name, let's say myApplication. I have a domain name that points to the IP of my server, let's say myApplication.com.
In order to access my application I have to enter http://myApplication.com/myApplication.
If I write http://myApplication.com/ I arrive to the IIS7 start page. Is there a way (besides rewriting the iisstart.htm to make a JavaScript or meta-data redirect) to automatically open the myApplication when someone enters "http://myApplication.com/"?
What I would like is the following:
The user enters in the browser: "http://myApplication.com/"
He/she is taken to "http://myApplication.com/myApplication"
In the URL bar of the browser only "http://myApplication.com/" shows and everything inside the application is relative to this URL.

Generally when I configure IIS, I set the properties for the "default web site" to a folder that doesn't contain anything, then create individual entries within IIS for each web site. For example, you would create a new entry for "MyApplication.com" and set its home directory to the proper folder on the server that contains your root files (usually c:\inetpub\wwwroot\myapplication.com\ but it could be anywhere you like).
It sounds as if you have created a folder for your application, but do not have a specific entry in IIS configured to handle the requests and load files from the proper folder.
If you have a dedicated IP address for the application, be sure to specify that IP within the site settings for that site. If you're using a single IP for multiple sites, configure the IP AND hostnames/domains that will be used to access that site so IIS will know which site entries belong to which domains and where to route the requests.

Related

ColdFusion - Web Server - Directory Serving - IIS

Not sure if this is controlled in ColdFusion Application.cfm in root directory or through the IIS webserver.
But I am trying to setup multiple subsites off of 1 Root Website using the same ColdFusion code, then setting a distinct data source by sniffing the URL ie: www.root.com/bob and using cgi.http_host.
So I can use the same code and different URL such as:
www.root.com
www.root1.com
www.root2.com
But I need to setup a separate site each time in the webserver (that is fine and understood).
But I would like to run the same code on same root website but on a subdirectory.
So I'd like to run:
www.root.com/test
www.root.com/test2
www.root.com/test3
www.root.com/newsignup
And all these subdirectories can then run the same code, without having to setup multiple websites in IIS.
Is this easily done using ColdFusion? or is it all IIS mapping?
Your code is located somewhere like
E:\path\to\wwwroot
In IIS, you have a site setup with that folder as web root. That site has a primary domain
www.someDomain.com
Then you want to serve the same code under different domains:
www.anotherDomain.com
myCFsite.someExistingSite.com
myCFsite.anotherExistingSite.com
www.YetAnotherDomain.com
In IIS, you'll have to set these up as domain aliases for your site. Look for "Bindings" in IIS Manager. You can also do this by editing the website.config file that will be created in your web root.
If you need different settings to be loaded per domain, you'll have to update your application. I usually set up database tables that map a list of those domains to their settings. That way you can lookup by cgi.http_host to find and cache settings.
<cfif !structKeyExists(application.settings, cgi.http_host)>
<!--- Look up settings, then cache them here. --->
<cfset application.settings[cgi.http_host] = ...>
</cfif>
Now you can reference settings per domain throughout the same code base.

Why is IIS going to the wwwroot folder instead of the one I want it to?

For the default Web Site in IIS I have the following binding on the default website:
I have the following binding on the site I want to access:
When I access the site in the browser with localhost/hostname, I'm pointed to C:\inetpub\wwwroot*hostname*. I have another site set up with a hostname binding that uses the same values for Port and IP Address and it points to the right place (a different folder on my C: drive). I'm running my site locally and I have the correct hostname entry in my hosts file. I don't want to create two separate virtual directories under a single website, I want the sites to be available as separate websites. What am I missing?
When you use the hostname feature in iis, you cant use localhost to access the site any more.
Instead use http://myhostname and setup myhostname to point to 127.0.0.1 in your hosts file.
If you want to access the site via localhost, that implies you need to make a virtual directory, or "application" in iis.

How to display content from another domain by editing CNAME records?

I have a site that lets people have their own e-stores, for ex- mysite.com/clientname
What I want is, if somebody opens store.clientname.com or clientname.com/store, the content is pulled from mysite.com/clientname. [ So that their users feel that they are browsing on their site ]
I know this is possible because site'e like tumblr let you do that by changing a CNAME entry for your domain to their IP address.
I do have a dedicated IP address.
Also, can this be done by editing the .htaccess file at clientname.com, and if yes, which method is better/easy?
You'll want to solve the problem in a completely different way for http://store.clientname.com/ versus http://clientname.com/store.
In the first case, you can serve the web site as a virtual host. Just set up a virtual host called store.clientname.com and set its DocumentRoot to be the existing directory that contains the files for http://mysite.com/clientname. If you have other web server configuration directives that apply to http://mysite.com/clientname then you'll also want to apply those in the virtual host. Finally, the client can set up a CNAME record in DNS for store.clientname.com pointing to your web server.
If you are using Apache, you can also use a default virtual host and mod_rewrite to dynamically translate URLs of the form http://store.{whatever}/ to http://mysite.com/{whatever}/. However, this won't work if you are using HTTPS.
In the second case, you don't want to serve the web site at http://clientname.com/ because the client presumably is already hosting that and presumably http://clientname.com/otherstuff has to continue working and come from their server. So the second case is easier for you because all the work has to be done on the client's web server. But it's simple: they will just have to configure their web server to proxy http://clientname.com/store to http://mysite.com/clientname.

Access sites on IIS

I have inherited a system with a number of servers, but I have never worked with IIS before.
Currently there is a web server set up using IIS, it holds a number of 'test' sites and the server is called Staging. I have network access to the files on the server and I can login to the server via VNC. What I cannot do is view any of the sites in the 'webs' folder. I know they are all switched on and working as they have been used by my predecessor.
I have tried putting into the url bar the IP address, the IP address with the folder appended, the name of the server and still I cant access the sites.
I am behind a firewall so these sites should be accessible to anyone in the network, but obviously I am mising something.
Any tips, anything I can look at to try and find the site. Annoying thing I only need to look at one of the sites in the D:\webs\test site folder for about 5 seconds :(
Look in the IIS properties of the site and look at what IP address and host header values have been assigned to the site.

Sharing single application across a 2 subdomains in IIS7

I have an application that is currently deployed (ex. www.example.com ). However, now we have a "secure" subdomain, which will take all of the requests that need to be encrypted (ex. secure.example.com). The site that is at www.example.com is currently mapped to C:\inetpub\example.com\wwwroot\, and I've mapped secure.example.com to C:\inetpub\example.com\wwwroot\secure.
However, since secure.example.com was setup as a new website within the IIS Manager, when the secure site is visited, it displays an error since there is no web.config associated with this website; however, this is the way I want it since I want this to be a part of the application that is in the parent directory.
I think what you really meant to do was just right click on the web site for example.com and edit the bindings. In there you can add host names to that site.
Make sure you add them for port 443 which is SSL.
Map both the IIS virtual directories/web sites to the same directory, and check that are both using the same IIS application name.
(Not tried this, but can't recall seeing anything to say it would not work.)

Resources