Is it good practice to delete Default Web Site in IIS? - iis

I can't found nothing recent on the web about if deleting Default Web Site in IIS is a good practice, i'm using IIS v10 and as in wwwroot i have each website inside it's own folder in IIS i've just created a website for each of them..
So i'm just not using the Default Web Site and i was wondering if will it cause any problem if i will delete it (for now i've just disabled it but seeing it in the list is a bit triggering), about deleting or keeping the Default Web Site i just found an article from 2001 so i would know something more recent about it.

Yes, you can safely delete the Default Web Site in IIS Manager, even though delete the files under the wwwroot. And it should be a good practice to do that to avoid some unexpected web accesses or attack.
And the Default Web Site in IIS Manager, even though the files under the wwwroot, is used for the first validation of IIS installation.
More, the Default Web Site will take the default port 80 if not disabled/deleted.
So, please go ahead to delete it.

Related

How to set up IIS 10 for MVC 5?

The title is purposely generic as I have no clue to formulate my question in any different way.
I have made an MVC 5 project using .NET 4.7.
My goal is to use IIS 10 to point to a domain so I can use that as a testing ground.
I have already edited my host-file to point my localhost ip to the domain I have in mind.
After that I have followed every step mentioned in the video below meticulously.
However I keep ending up on the 403.14 error page.
I have adjusted security to no avail, checked the app-pool to use the correct .net version... I'm all out off ideas.
https://www.youtube.com/watch?v=IwbKquNBNgQ
I hope someone here has some idea of things I have not thought of myself, so feel free to ask anything you think might make the change I need to make this work. I will edit this message (and title) as much as needed to keep up to date as possible.
EDIT: I have followed the full guide that I have marked as an answer. I had 3 differences.
Difference 1 was in Windows Features. I think I just plain didn't correctly mark all the needed features..
Difference 2 was in Security. I did not have IIS_IUSRS added, only IUSR
Difference 3 is one I have purposely keep a difference and that is Directory Browsing. Without this being enabled, it works for me.
I hope that if anyone ends up on this page in the future, the answer provided below will be as helpful as it has been to me.
make sure you enabled below iis features:
please follow the below steps to publish your MVC project in iis.
1)open the visual studio. Select your site and right-click on that-> Click publish.
2)in pick up publish target Select folder option and create choose destination where you want to publish the site. (make a new folder and publish a site in that folder) and then select publish.
3)open IIS manager.
4)expand the server name and right-click on sites and select add a new site.
5)enter the site name, physical path, and site binding details.
ip address: select your machine ip address.
port: 80
domain name: your domain name
6)make sure you enabled directory browsing in iis.
7) The application pool is running under application pool identity, a version is correct and using the integrated pipeline.
8)anonymous authentication is enabled.
9)iis_iusrs and iusr have full permission to access the site folder.
host file enry:
bind your machine IP dress with a hostname of the site.
after doing all the changes refresh the site in iis and browse.

IIS 8.5 is not serving JS, CSS, and Image files (static content)

The problem
We're running IIS on Windows 8.1 with Update. We're at the Orchard CMS first time setup screen, and IIS is giving 401s for all static content. We have read the following to no avail:
IIS 7.5 no images css js showing
IIS 7.5 no images css js showing
The official Orchard deployment documentation
Based on those, this is what I have tried that doesn't work.
Turn on the IIS feature to Serve Static Content.
Give IIS_IUSRS permission to Read, write & execute.
Give the site's application pool permission to Read, write & execute.
What does work though is the nuclear option: to give Everyone the Read permission (unless we want to proceed with the Orchard setup; then we need to give Everyone even more permissions.) That leads me to believe that I must give permission to some principle with less scope than Everyone but more scope than both IIS_IUSRS and the application pool combined.
Who/what is that principle?
Pictures to show the problem
We receive a 401 on ..\Themes\SafeMode\Styles\site.css
The task manager confirms that the site is running as the orchard user.
The security properties of the ..\Themes\SafeMode\Styles\ directory gives Read permission to orchard.
Why does it only work when we give Read permission to Everyone?
I had a similar problem. Under authentication, I right clicked "Anonymous Authentication" and clicked "Edit". That shows a dialog giving you the ability to set the identity of the anonymous user. I set it to "Application pool identity" and that fixed the problem for me.
.
This may not be the most secure configuration though, but I'm on a dev server so I don't care.
Try turn on the Static Content and Directory Browsing features under Internet Information Services->World Wide Web Services->Common HTTP Features node.
In my case I had to set Read permission for IUSR user for the web site folder.
So, what I had to do to fix this problem was the following:
(and please understand, that this is not ASP or PHP script related, the server wouldn't even show basic simple .html files, yet would serve out PHP results all day long!)
Two fold…
Had to set the application pool for each site, under advanced settings, to use LocalSystem for it’s process
Under site, advanced settings, security, add the IUSR account to have read & list contents access, for the site… :-)
See any problems with doing that?
'cuz it's working....
Updating windows feature for WWW services/Common Http Features/static content by selecting Static Content checkbox fixed my IIS not service static content issue.
Open IIS -> go to advanced settings of selected website and open Physical Path Credentials -> Select specific user and enter your local user credentials. Open below screenshot for further visualising the things:
IIS Settings

Add Application Error on Default Web Site (IIS 7.5, Windows server 2008R2)

I am trying to add a .net application to my Default Web Site on IIS 7.5 Windows Server 2008 R2. The Default Web Site currently serves ASP Classic pages (not sure if that is relevant) and I'm trying to setup some aspx pages. But I can't even add a new application, i keep getting an error of
"value does not fall within range"
I have no idea what this means?
Please see my screenshot for more information:
http://i.imgur.com/nsUs5.png
Thanks in advance.
Although quite tedious, you could try checking the settings in the apphost config file. You can find it at C:\Windows\System32\inetsrv\config
Look for errors in names, sometimes spaces can be replaced with %20% by Visual Studio which should be removed, also if you have deleted something manually in your file system, this will not have been updated in the applicationhost config file, so any references would need to be removed manually also.
Regards, and good luck
Well i never found a solution apart from Creating the App as ASP Classic (which would allow me too do it) and then switching the AppPool to DefaultAppPool which in turn lets me server ASPX pages.
So, Kind of solved for now...

Where does IIS intend developers to put additional websites?

On a fresh install of Windows Server 2008 R2 with IIS 7, it creates a default website in C:\inetpub\wwwroot. I'm sure there's lots of subjective opinion on where good places to store website files are, but I'm wondering if I were to create a second website, in addition to the default website, where would the IIS developers have intended I put it?
I'm thinking C:\inetpub\mysecondsite, but I can't say for sure.
You can really put your new web site's files wherever you want on the server. Most people tend to make subfolders for each individual site under the wwwroot. I usually delete the Default Web Site and start from scratch.
For example:
C:\inetpub\wwwroot\myfirstsite
C:\inetpub\wwwroot\mysecondsite

Moving sharepoint installation to a different port / URL

We've installed Windows Search Server Express on one of our servers, which apparently runs on top of sharepoint.
Sharepoint was installed on port 80, where our "normal" intranet runs. When I disable the intranet and run the sharepoint site, everything works as intended. The intranet is linked in many places it would be a pain to move it, so I'm trying to move sharepoint to another "place" (hoping this is less of a pain), either a different port or as a virtual directory under the main site.
First, when I make any of these changes, it fails to get access to the intranet root. Not sure what it is looking for there, but ok, I give "Network service" (the acocunt the "Sharepoint 80" application pool is running under) access to the intranet root. This gets me one step further, I am stumped:
When I move the Sharepoint website to another port, it complains that it can't find default.aspx (there is none, but also it doesn't need it when running on port 80)
When I move it to a sub folder of the existing site, and try to open the global.asax in the browser, ti tells me that this extension is prohibited, even though the "Application configuration" is - as far as I understand - identical to that of the Sharepoint site, and allows GET, HEAD, POST, DEBUG for .asax.
Any suggestions?
Sharepoint sites should be able to run on any port- if you go into Sharepoint Central Admin and create or delete web applications without a problem.
Is it your intention to run heterogenously with Sharepoint and your regular site both on Port 80? I know that you can create a web application on 80 and then not have a root site collection ( Sharepoint applications consist of a Web Application that runs on a certain port and any number of Site Collections within that, each of which has it's own directory path and can contain lists, libraries, other Site Collections and so on ) just creating one on a different path, but I don't know for sure how that would work alongside an existing web site on the same port- it may not play nice. Again, you can create and delete site collections from the Sharepoint Central Admin page, which is linked from your Administrative Tools list on your server.I would try this first, as if it works it's an easy solution.
Is Windows Search Server Express related to Sharepoint's own search facilities? If it is you may find that it expects to run using some of the Shared Service Provider facilities, which even Sharepoint doesn't expect to be running on the same port as the sites it's providing services for.
An even better way would be to create another alias (cname) in your DNS for your server, just set a different host header for each web site.
for example, in DNS your machine might be named 'intranet'. Create an alias for that machine named 'sharepoint'
In IIS, create a new website for sharepoint, and set the host header for that site to 'sharepoint.domain.com', where domain.com is your domain.
Do the same for the intranet website, but set the host header to 'intranet.domain.com'
That way, your users don't have to use another port in the URL.
Thank you! I found the option in the sharepoint administration website.
I add this response to detail the steps I have taken - maybe they are useful for someone else.
In the sharepoint administration website (running flawlessly on another port), I chose "create or extend web applications", then "extend existing web application".
There, from the the drop down "Web application", "change web application" opens a popup with the web applications available. Search server was installed as "Sharepoint 80", so I selected that.
Then I selected "Create new IIS website", with a new name and a new port. All the other options looked fine to me as default.
Clicking OK, this creates a new web site in IIS, which was configured correctly. it doesn't work via the IP address of the server (http://192.x.x.x:8080), only using the server name - but that's ok with me :)
I still had to make some adjustments with the access rights, but the full crawl is running and I can find a few documents already. Yay!
This is much easier when you first backup your site and then create a new site from the central admin with a new port number and then restore the backup to it(overwrite)

Resources