Change Default Locale in IIS 6.0 - iis

I've got a hosted VPS hosted by a UK hosting company that for some reason is set to US settings. In fact, until recently, the regional settings were 'English - United States'. I've corrected the regional settings, but my application is still working with the wrong date format. See:
http://www.albaassoc.com/events/listevents.aspx
The default dates are supposed to be the current date to the date + 3 months, but as you can see, the dd and MM fields are swapped. Note: the AJAX calendar extender is manually set to dd/MM/yyyy so that is why the calendar pop thinks we are interested in June/July rather than January!
I know there are various ways to set a page or an application to use a particular locale, but I'd rather go for a global approach.
Is it possible to re-configure IIS to work in a different locale, or if not, can I tweak machine.config so that it is a once-only change?
I've got a ticket open with the host but I'm not going to hold my breath - they aren't going to want to reinstall IIS...
Thanks in advance.

Via the globalization element, you can set the culture and uiculture for a site (via web.config) or the entire machine (via machine.config).

I just got a similar issue (Windows Server 2008, IIS 7). I was able to fix it by editing the web config file, but like you I wanted a global fix.
The solution is in the config panel, regional settings. I don't know for you (what's your OS), but under WS2008, there is an administrative tab under regional settings. It allows you to copy the settings of your logged in user (you) to the administrative accounts (network services in this case). Rebooted and got it right.

The problem is often that the user running either IIS or the application pool your app belongs to is a system account which was created when the server was installed. They therefore inherited whatever the default locale was at the time.
If you can't fix it in regional and language options you can always try editing in the registry directly (with the usual proviso that messing around with the registry can seriously muck up Windows). The regional settings are all under HKEY_USERS\{userid}\Control Panel\International - if you compare what's there for each user with what you have under HKEY_CURRENT_USER\Control Panel\International it should be fairly obvious what to change. I've done this a few times on Windows 2000 servers and it's worked OK.
The other option is just to create a new user on the machine with the correct locale and then set both IIS and the application pool to run with that identity.

Bit of an old thread, but I still look after some legacy Classic ASP sites written by the now defunct Aztec civilisation in praise of their feathered gods.
A server move prevented all the date code from working and sacrificing a chicken was no help, so here is the very easy solution in IIS 7 that has not been mentioned, possibly because no-one else is suffering like me.
Go to IIS Manager.
Select either the root server node to apply to all sites, or select the site node you are having problems with if you want to leave the server default alone.
In IIS section, double click ASP icon.
Set Locale ID to your desired locale (2057 for UK).
This should take effect immediately.
Alternatively you could go buy a DeLorean, go back in time and kill the programmer who decided FormateDateTime(d, vbLongDate) was the best way of generating a date to be used in the database. Or persuade the client to give me a lot of money to replace the whole thing. Either's good.

I had a problem, with having the the date formatted mm/dd/yyyy when I wanted it to be dd/mm/yyyy.
I am using windows server 2003 and IIS 6
The solution was to add the following to any web config file, then reboot your server and it should work just fine.
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" />

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.

Installed IIS but get blank page and it doesn't show up in Windows services list

I am trying to install IIS on my Windows 8.1 laptop and followed the directions at Microsoft for installing IIS. But when I type localhost, instead of getting the IIS start page, I get a blank page.
When I do Windows + R and type services.msc, the resulting list of services is long but does not include Internet Information Services.
When I look at the Windows filesystem, I do find the inetpub folder with four subfolders, including wwwroot. In the wwwroot folder is the iisstart.htm file that is supposed to display when I type localhost into my browser.
I have read that one possible problem is that both Skype and IIS want to use Port 80 and there is a conflict. So I decided to try to change the default port for IIS, but I found that I don't appear to have the IIS Manager on my system. When I go to Administrative Tools, Internet Information Services Manager is not on the list of administrative tools.
I added both the HTTP Redirection module as well as the IIS Management Service on top of the initial basic installation that Microsoft described. Still no luck getting IIS working or IIS Manager to appear.
I have tried to research this problem of getting IIS to work on Windows 8.1 with no success and am at a loss. Suggestions welcome!
In Control Panel --> Programs --> Programs And Features --> Turn Windows features on or off -> Internet Information Services -> World Wide Web Services -> Common HTTP Features -> Static Content.
Also make sure .NET Extensibility 3.5 and .NET Extensibility 4.5 are checked.
Major fail by Microsoft. Why the hell would they turn off the most basic features by default. Go to Turn Windows features on or off (just search "features"). Look in IIS, WWW, Common HTTP Features. See attached image.screenshot
I have solved a couple of my problems.
I installed several more IIS modules: Static Content, IIS Management Console, and HTTP Errors.
I am now am able to find the IIS Manager in the Administrative Tools list and can use the IIS Manager.
Also, when I pressed Windows key + R and typed in services.msc, I still don't see Internet Information Services in the list. However, I do see "World Wide Web Publishing Service" in the list and it is shown as running. A page at Microsoft's Technet site indicates that it is related to IIS.
The HTTP Errors module gave me an error page rather than a blank page when I typed in localhost and also when I typed localhost/filename. This proved a HUGE help, because the error page identified the problem as a permissions issue. I thought I had dealt with the permissions issues, but this error page made it apparent that I had not.
When I typed in localhost, I got the permissions error. When I typed in localhost/iisstart.htm, I got the proper display of the file. When I created a simple .htm file, statictest.htm, and placed it in the wwwroot folder along with iisstart.htm, and typed localhost/statictest.htm, I got the permissions error.
So since one of the files was working and one wasn't, I decided to compare their permissions. (You do this using the File Explorer. Right click on the file, click on Properties, click on Security Tab. To make changes, click on Edit.) I saw that the successful one had a user listed that the unsuccessful one did not. So I added a user for the statictest.htm file to the permissions list with full control. That solved the issue for that file and it displayed normally.
I now am back to getting a blank page when I type in localhost. It must not be a permissions issue, because otherwise I'd get the permissions error page. I'm not sure what the cause of the blank page is. But as long as I can get files to display when I give their name, I am happy enough.
I am happy to report that my PHP installation is also working, at least as judged by the fact that the phpinfo() function displays properly.
So to sum up: if you are having problems getting IIS to work on Windows 8.1, try adding more IIS modules and make sure your permissions are in order. I think the most important ones to add are Static Content and HTTP Errors. Also, of course, CGI if you are going to use PHP.
I know this is an older post, but in case anyone, like me, already had "static content" enabled, there was one other thing that needed to be done to resolve this issue.
Under "Programs and Features" -> "Turn Windows features on or off"
Expand "Internet Information Services" -> "World Wide Web Services" -> "Application Development Features"
Make sure that "ASP.NET 4.5" (and if needed/installed 3.5) are selected. This should automatically check ".Net Extensibility" for the selected version, and it should also enable ISAPI filters and Extensions.
By default (for me at least) these options were not turned on when I enabled IIS. I was getting a 500 error in IE if I had "Show Friendly Error Messages" turned on in IE, but if I turned that option off, I would get a completely blank page.
For me, the reason was that I had two different HTTP handlers in the config with the same name. I didn't get any errors, just blank response.
I'm guessing that some other parts of the configuration may result in a similar behavior. Try commenting out some parts of Web.config file in case you cannot figure the problem out.
Same issue.
Win 10 upgraded from 7. Default documents server blank and without error.
Static Content and Default Document features already enabled.
I resolved by disabling both features, rebooted and tried(received error 404), enabled both features, rebooted, pages served properly.
For me, I was using Windows Server 2008 on an Azure machine, it was missing some packages which can be installed using "Web Platform Installer", and then search for "recommended server configuration for web hosting providers"
I encountered the blank page problem as well on IIS 8.5 on Windows Server 2012 R2.
I had StaticContent installed as Windows feature.
What finally fixed it for me was changing the Path Type of the StaticFile Handler under [IIS Manager -> Server on left pane -> Handler Mappings -> StaticFile] from "Unspecified" to "File or Folder".
You can also change this on a per web site basis instead of the entire server (but I don't really see a reason why to do so, as it breaks pretty much any page). Make sure, however, that the site does not have an overriding setting for the StaticFile handler, as the site scoped one is preferred over the global one.

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...

SharePoint development nightmares

I thought I'd give SharePoint development a go, to broaden my understanding of Microsoft technologies and ran into a situation I refuse to understand.
I have a new web application created: http://localhost:11523 and set up the site collection as required. I can browse to the web site fine, without any issues, but now I want to start developing against this, using the object model.
Right, so after I struggled with SPSite site = new SPSite("http://localhost:11523"); I figured that I'm not running VS2008 in elevated permissions, so restarting VS I finally got one step further.
Whenever I step into my code, I get:
The Web application at
http://localhost:11523/ could not be
found.
I've Googled this without luck. The application is most definitely there, I can browse it, add web parts and go mad. I just can't seem to connect to it via Visual Studio.
Any ideas would be great.
EDIT
I thought I'd isolate my method, called "GetListFromSharePoint(string name)" into a test method (nUnit Framework) and to my surprise returned 9 entries from the list, as expected. When I dumped the method back into my web application (not SharePoint, trying to test the Composite Control through a normal Web site), and run into the mentioned problem.
This is in SharePoint 2007, and I'm developing on the same machine onto which SharePoint 2007 is installed.
This approach used to work, for some reason, I just can't get it to recognize SharePoint. The test stubs work find, just not the web application.
Edit 2
So there where a couple of things I "missed", which kind of solved the problem by itself.
Firstly, I was developing on a x64 Windows 2008 box, thus SharePoint 2007 was running in x64 mode. Cassini, turns out, is 32bit regardless of the platform you run it on, which caused some compiler bugs (I did not have IA64 compilers installed). After installing this, I figured out that the default web site (localhost:80) had been disabled by SharePoint.
Renabling the default web site, allowed me to create my web application as a virtual directory against it, which allowed my debugger compiler to run in x64.
My next challenge was access permissions. Because any new virtual directory on port 80 is assigned to the default application pool, is it assumed that the user does not have the right permissions, so I had to change my web application to run under my SharePoint web application's application pool.
The last thing I had to do was run my SharePoint code with elevated permissions.
Working like a charm :D
Note! Enable debug on your SharePoint web application....
Thanks,
Eric
(You have not specified version - assuming SharePoint 2010).
You need to decide what object model you want to use:
client (to be able to access the server from any other machine)
server (the one that you are trying now, can only be run locally).
Most likley reasons your code not work:
using "localhost" instead of ""computer name" in the Url. (I believe it is the reason.)
you are running your code not on the same machine as the SharePoint
you are running code under non-admin account
Check out how sites collections are configured in "Central Administration" site - urls associated with each site collection are listed there - make sure you are using correct one.
You can also try enumerating all site collections in SPWebApplication (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebapplication.sites.aspx) to start expiriments.
I dont think the SPSite connect through the IIS, and if SharePoint isn't set up to respond to localhost (done in the Central Administration) you wont be able to connect to that url. IIS works a bit different here since it relays the signals to "localhost" to the "web application instance".
Start by checking in your SharePoint Central Administration. Go to "Configure alternate access mappings" in the "System Settings" section. Here you have your SharePoint instances, there are three properties which you can see directly in the list; 'Internal URL', 'Zone' and 'Public URL for Zone'.
If the Internal URL isn't set to Localhost you wont be able to use that connection you suggested. It bay be improper to change this to another url as well, so simply try to set your SPSite site = new SPSite("http://yourinternalurl:11523"); to whatever's in that box! :)
Cheers

SharePoint Installation Problem on Windows Server 2008

I have installed MOSS 2007 on Windows Server 2008.
I am facing a strange problem:
I am unable to logon to SharePoint using IE 8, but am able to using Firefox. Pl note that I have taken care of the security in IE.
After creating a web application, when I try to chage the web application for creating a Site collection..I am unable to change it (even if I select the web application it says "No Selection".
I am unable to add web parts to any of the sites created! ( Pl note that I have created the sites by using a workaround..changing the SiteId=null to site Id = Id of the Site using SharePoint Manager)
I find no entries in the logs or no error messages..
Please help me in this regard.
Grace
IE8 on Windows Server 2008 is much more stringent with its default security settings. Even disabling IE Enhanced Security Configuration does not allow all functionality. This is to discourage you from logging into the server and perhaps inadvertantly installing an IE addon that compromises security.
You really should connect to SharePoint Central Administration from your local machine. Then you won't have the security problems and also will be following Microsoft best practice.
Try adding the Site (Central Admin ) to the Trusted Site in IE and Make the Security Setting as Low. It will give all the Required stuffs like Javascript and it should solve your issue.
I have also had the same problem, not being able to select a web application. In our case we ended up reinstalling sharepoint (actually a clean install of the OS), then it worked fine.
There was probably some step in the installation that we did not do in the correct order.
Installing Sharepoint on Windows Server 2008 is not a regular install. Make sure you have the latest Cumulative update installed + SP2. Better yet, slipstream the installation.
Take note, especially when installing Language Packs attention is need when performing the install, there is a specific order in which to install the product / updates / packs.
More info Code eater blog post
You may need to disable the loop back checking if the site is using a host header name. See this article for more details.

Resources