I've got an FTP site on a server with IIS 6, and I need to set up a second server (this one with IIS 7) to have the same FTP setup.
I've done the following:
appcmd list site /config /xml > SomeFile.xml [on the first server]
appcmd add site /in < SomeFile.xml [on the second server]
... which works out fine. Only problem: I'm missing my authorization rules, not just for the base FTP site, but all the individual virtual folders as well.
Is there any way to extract the authorization rules from the site (and all its virtual folders) and then inject them into another site? Or is there a better way of tackling the problem?
Related
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.
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.
On an IIS server with Application Request Routing, new server farms to be routed to can be added by right-clicking Server Farms -> Create Server Farm.
This will pop up a dialog where the settings for the server farm can be entered. I did not manage to find a way to edit or view these settings after they are accepted in the Create-Serverfarms-dialog.
My question is therefore: How can I edit the target-url, http-port and https-port settings of a server farm outside of the create-serverfarm dialog?
You could use the command line to do so.
For example, lets say we have a Server Farm called test with one application server www.example.com in it:
All the following commands need to be run in the %windir%\system32\inetsrv directory unless you have it in your PATH.
To change the target-url of the application server to www.google.com, use:
appcmd.exe set config /section:webFarms /"[name='test'].[address='www.example.com']".address:www.google.com
You can change any parameters the way you would do it with the dialog (and even more).
To get the list of parameters you can use with the command line:
appcmd.exe set config -section:webFarms -?
And particularly the section you seem to be interested by:
And finally, to view the current config of your server farm:
appcmd.exe list config /section:webFarms
Should get you something like:
References:
http://www.iis.net/learn/get-started/getting-started-with-iis/getting-started-with-appcmdexe
http://www.iis.net/learn/extensions/configuring-application-request-routing-(arr)/define-and-configure-an-application-request-routing-server-farm
Update:
You may generate PowerShell script from IIS Manager.
Web Server (IIS) Administration Cmdlets in Windows PowerShell
Also, you may edit C:\Windows\System32\inetsrv\config\applicationHost.config file manually.
I am in the process of migrating an existing webserver running IIS 6 to IIS 7. I have setup the new websites on the new server but cant seem to test them as once I have entered the domain name when I selec t "browse" from within IIS 7 I get the site on my original server. How can I test the configuration of my new sites on my new server before migrating the domain names (eg updating the DNS records etc.)?
Any help much appreciated.
On the server, edit the hosts file to force the server into thinking the website is located on its self, instead of the IIS6 server.
The hosts file is located at C:\WINDOWS\system32\drivers\etc\hosts.
Just add a line in like:
192.168.0.1 www.mywebsite.com
where 192.168.0.1 is the IP address of the IIS7 server, and www.mywebsite.com is the website address to test.
Then restart Internet Explorer and enter www.mywebsite.com (or browse from within iisadmin) again, and it should give you the IIS7 site.
You could also do this on your PC and leave the server alone.
Don't forget to remove the line from your hosts file when you're done!
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.