chef iis cookbook does change site settings - iis

I can do this to create a new site that didn't exist before:
iis_site MySite do
site_name MySite
application_pool MySite
protocol :https
port 443
path "C:/inetpub/MySite"
log_directory "C:/inetpub/mylogfolder"
log_truncsize 52428800
action [:add,:start]
end
That will create a new site with those settings BUT if the site already exists it will not change any of those settings.
So lets say I ran it once and it created a site with the above settings. If I edit the recipe to do this:
iis_site MySite do
site_name MySite
application_pool MySite
protocol :http
port 80
path "C:/inetpub/MySite"
log_directory "C:/inetpub/MySite/different/folder/path"
log_truncsize 52428800
action [:add,:start]
end
It makes no changes to the current site. Is this by design for this cookbook? Seems like its only useful for deploying new sites and little else.

I know little of IIS but you can find the relevant code here https://github.com/chef-cookbooks/iis/blob/master/providers/site.rb#L131-L226
It definitely seems like it is trying to idempotently apply changes to log_directory but it is possible there is a flaw in the logic or in the commands it uses to get/set site data.

Related

IIS: add binding to Default Web Site

I just started looking at IIS on Windows10.
I have a stupid question. I added a binding to Default Web Site ("www.test.com") in IIS Manager.
I was expecting to see the default page when browsing to this url, but it took me instead to an actual existing page.
Can anyone explain me why?
If you've added www.test.com to your bindings, clients (like your web browser on the same system) still don't know that IIS hosts the site.
see this: Setting up a Host File - Faking URLs
This is useful when dealing with multiple sites:
Site 1:
test.com
www.test.com
www2.test.com
Site 2:
another.url.com
with just listening to a single IP, you cannot control which request ends up at which site, this is what the binding solves

Create user friendly alias for a sharepoint site

I have a test Sharepoint server running on a Windows 7 machine. The url is http://liu-t500-01 and i want to create a user friendly alias http://temp for it. i have added
127.0.0.1 temp
to my hosts file (an A/host entry) and i have also created an alternate access mapping in Central Administration
http://liu-t500-01 Default http://liu-t500-01
http://temp Intranet http://temp
However when i try http://temp in the browser the sharepoint site does not come up. This is probably a simple problem but has me scratching my head...what did i do wrong?
Changing the IIS binding only will cause errors. You need to modify the alternate access mappings in SharePoint. There are tons of good articles our there that tell what to do in detail.
Here is just one: http://technet.microsoft.com/en-us/sharepoint/Video/ff679917
Try adding a host header in IIS
In IIS click on your site
choose the Bindings action
Click Add
In the Host Name field enter "temp"
click OK

IIS: Can I create a host header for an intranet site?

This is a fairly simple question (in my opinion) but for some reason despite my Googling I cannot find a straight answer to it.
Currently I have an application running under my Default Web Site located at http://localhost/myApp. Ideally, I'd like to create a new site in IIS with a binding to 127.0.0.1:80 and a host header of http://myApp so that I can test my url rewriting rules properly (since my app will ultimately be hosted at http://www.myApp.com, not http://www.somedomain.com/myApp).
So, my question is this: will the above work? I haven't had a chance to try it yet.
If the above will not work, what are the steps to be able to access my site at http://myApp on my local network?
It should work provided you fool the OS into resolving www.myapp.com to 127.0.0.1. To do so, edit your hosts file in %systemroot%\system32\drivers\etc to contain the following:
127.0.0.1 myapp.com
I believe you could do just myapp(without the .com) as well, but that gets a bit trickier because how that is resolved depends on your node type. (hybrid, etc) To be safe, add
127.0.0.1 myapp
to BOTH the hosts and LMHosts files in the same directory. By default the lmhosts is non-existent and there is a lmhosts.sam there. You'll have to rename that to just lmhosts or create a new one.
Then create the binding as per usual in IIS7/7.5 (I assume it's 7... Site->Actions->Bindings->Add or Edit->Populate hostname accordingly).. IIS6 will work too but it's alot harder to get https working should you need it.

Extending ssl sharepoint site with extranet

So I have this project I took over from another guy - whom I can't consult with unfortunately. And I have no experience in SSL.
Basically there's this sharepoint web-app which has been setup to use SSL - and everything's working great. I see in the central admin page, that there are two zones to the web-app (standard and internet). In IIS there are 2 web sites containing to this sharepoint site.
One has the port value TCP 0 and SSL port 443, the other a TCP 80 with a redirect to the SSL website. So far so good.
Now I need to extend this website with a forms-authenticated extranet. How do I go about this?
I did, what I would do with a normal sharepoint website, and first extended the web-app from central admin, remembered to set the zone to extranet, and checked "use SSL". (port 1580)
I went into the web-config file in the virtual directory, and set up the forms-stuff (connection string, providers, etc.).
But then I was stumped as to how to actually access this extranet. I couldn't access it by doing:
http://site.com:1580
or
https://site.com:1580
And I tried just changing the existing redirect to the virtual directory of the extranet - no dice. I know this is simple, so there must be someone who can explain it to me, as if I was a child :D
My guess is that IIS does not know about your 1580 port.
Go into IIS manager, into the new extended web site, and check that the 1580 port has been mapped to it. Check that the SSL port has been mapped too. And don't forget to add the certificate.

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