IISExpress writes log and configuration data to pre-determined location out of the box.
The directory is an "IISExpress" directory stored in a user's Documents directory.
In the directory is stored the following folders files underneath.
Config
Logs
TraceLogFiles
The location of my home directory is on a network share, determined by group policy
Currently we are encountering scenarios where visual studio locks up when stopping debugging Silverlight applications using IIS Express.
I was looking to change the location for the log & configuration data for IISExpress to see if this fixes the problem of visual studio locking up. Is it possible to change the default location of log & config files ?
1 . By default applicationhost.config file defines following two log file locations. Here IIS_USER_HOME would be expanded as %userprofile%\documents\IISExpress\.
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" />
</siteDefaults>
You can update above directory paths to change the log file locations.
2 . If you are running IIS Express from command line, you can use '/config' switch to provide configuration file of your choice. Following link may help you http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/
http://www.iis.net/configreference/system.applicationhost/sites/sitedefaults
<configuration>
<system.applicationHost>
<sites>
<siteDefaults>
<logFile
logFormat="W3C"
directory="%SystemDrive%\inetpub\logs\LogFiles"
enabled="true"
/>
<traceFailedRequestsLogging
enabled="true"
directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles"
maxLogFiles="20"
/>
<limits connectionTimeout="00:01:00" />
<ftpServer serverAutoStart="true" />
<bindings>
<binding
protocol="http"
bindingInformation="127.0.0.1:8080:"
/>
</bindings>
</siteDefaults>
</sites>
</system.applicationHost>
</configuration>
I find web.config documentation is a messy. It is therefore better to provide a complete parent history than a floating snippet with the expectation that the reader naturally knows where it goes.
By default it will be in:
C:\Users\ user_name \Documents\IISExpress\Logs\
Related
I can not figure out how to set and read environment variables in Microsoft Internet Information Services (IIS) version 10. I have a Fast CGI app that requires environment variables. In previous versions of IIS I just set system-wide variables in the Windows "System Properties". However in IIS 10 my FCGI app isn't reading them. So my first question is if there are steps that need to be taken so that the IIS process can read system variables?
Alternatively, how do I set environment variables within IIS 10? This Microsoft site explains it but not in enough detail for me to get it working. Specifically, in what file and in which section do you put the <environmentVariables> section? The example XML and the command line example have name="Contoso" (see below) but what is that - the name of the application pool, or my FCGI app, or something else?
<applicationPools>
<add name="Contoso" managedRuntimeVersion="v4.0" managedPipelineMode="Classic">
<environmentVariables>
<add name="foo" value="bar" />
</environmentVariables>
</add>
</applicationPools>
Edit in response to Jokies Ding:
MAP22 and PROJ_LIB are the two environment variables that I need. In C:\Windows\System32\inetsrv\Config\applicationHost.config
I have:
<applicationPools>
<add name="DefaultAppPool" />
<add name=".NET v4.5 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
<add name=".NET v4.5" managedRuntimeVersion="v4.0" />
<add name="ASP.NET v4.0" autoStart="true" managedRuntimeVersion="v4.0" />
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity" />
<environmentVariables>
<add name="PROJ_LIB" value="/gdal/bin/proj6/SHARE" />
<add name="MAP22" value="/tetonwy/mapserv/main.map" />
</environmentVariables>
</applicationPoolDefaults>
</applicationPools>
and
<fastCgi>
<application fullPath="C:\gdal\bin\ms\apps\mapserv.exe">
<environmentVariables>
<environmentVariable name="MAP22" value="C:\tetonwy\mapserv\main.map" />
<environmentVariable name="PROJ_LIB" value="C:\gdal\bin\proj6\SHARE" />
</environmentVariables>
</application>
</fastCgi>
and in a cmd window the environment variables are visible
C:\>set MAP22
MAP22=C:\tetonwy\mapserv\main.map
C:\>set PROJ_LIB
PROJ_LIB=C:\gdal\bin\proj6\SHARE
So it seems like I've got the variables set all over the place but the app isn't seeing them. C:\gdal\bin\ms\apps\mapserv.exe is the FastCGI app that isn't seeing the environment variables. It's a compiled C program that I have used in previous versions of IIS.
There is an issue with MapServer not reading environment variables on Windows when used through FastCGI.
This is resolved by applying https://github.com/MapServer/MapServer/pull/6304 which will be backported to the 7.x MapServer releases.
See Environment variables ignored using FastCGI and IIS #6289 for more details.
<environmentVariables> section is displayed as a collection under specific application pool.
You could find it in IIS global configuration file C:\Windows\System32\inetsrv\config\applicationhost.config.
"Contoso" is the name of application pool.
I think read system-wide variable is still supported in IIS 10 and PHP FAST-CGI. I can get these configuration by running commandline SET in IIS PHP-CGI.
Could you post the code that you used to read the variable?
In some condition, Your application code require elevated permission. You could try to change application pool identity to local system and set Anonymous authenticated user to Application pool identity
I have somehow created an application directory with the appcmd command that has hidden all of my applications directory.
I can do a list of my application directories with appcmd and I think the last directory I created has the file path with a double quote character at the end, so I'm trying to delete that one application directory.
When I run the command appcmd list app I get the list of my application directories which do not show up in the UI.
Here is a list of the last three:
APP "Default Web Site/hotele/language90" (applicationPool:DefaultAppPool)
APP "Default Web Site/hotele/business900" (applicationPool:DefaultAppPool)
APP "Default Web Site/hotelk" (applicationPool:DefaultAppPool)
When I attempt to delete the hotelk one which is the one I think is messing up all of the directories I try running this command:
appcmd delete app "Default Web Site"/"hotelk"
It gives me this error:
message:Must use exact identifier for APP object with verb DELETE.
I've tried many different combinations of this delete syntax and not use what is meant by the identifier?
I can't delete this application directory with the IIS UI since when I go there all of my application directories do not appear.
First of all try to delete the app from Internet Information Services (IIS) Manager GUI.
If you can't find your app there you can manually edit IIS configuration file (ApplicationHost.config):
Go to path %windir%\system32\inetsrv\config
Create a backup of ApplicationHost.config file
Open ApplicationHost.config file
Search the name of the app you want to remove (ex. hotelk). You should find it in the <sites> section:
<sites>
<site name="Default Web Site" id="1">
...
</site>
<site name="hotelk"" id="2">
<application path="/">
<virtualDirectory path="/" physicalPath="d:\test" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
</bindings>
</site>
<siteDefaults>
...
</siteDefaults>
<applicationDefaults applicationPool="DefaultAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
remove the entire node containing the site you want to delete
save the file
If you want delete the app using appcmd this is the right command:
appcmd delete app "Default Web Site/hotelk"
I am working on a Unity 3D game which upon build for Windows generates game.exe and game_Data file and folder. The Game_Data folder contains a directory called **Game_Data\Mono\etc\mono\2.0**.
The directory files are shown in image.
The Browsers directory contains one file called Compact.browser.
The Current Scenario.
1. These game files are hosted on a server where IIS 7.5 is running.
The game resource files are served in virtual directory of the game website.
I've made few changes to the website's root web.config file so that all filetypes are allowed to download only in the game resources folder on server.
Yes, all file types including .html, .aspx, .xml, .config, .browser, .map etc are all downloading as normal files.
The problem
As you see the directory structure there is a web.config file inside the game resources folder. The file has nothing to do with website configuration but with the game (which is on client side after downloading).
As the files are served as individual files each file is downloaded separately. So when the client tries to download all files including the contents of the above folder.
Due to this web.config file, contents of the directory is not downloading. If I delete this web.config file all of the .aspx, .config, .map files are downloading. Also there are some other folders where many different files are downloading properly.
But this web.config file is also required for the game, and it is not allowing it be downloaded with other files too in the directory shown above.
I've tried to look into the solution. Found some hints to avoid inheritance in nested config files. But actually I want to completely treat this file as a normal file, not as a site configuration file.
I think you got my problem. Please let me know your suggestions. You can say adding Mime types. But actuall all of the file types are downloading including .config files. Except the file named web.config.
I'm having the same problem, and I think I found the solution: there is a way to tell IIS not to interpret web.config files.
To do this, modify the C:\Windows\System32\inetsrv\config\applicationHost.config file (I haven't found a way to do this in the IIS user interface), by specifying allowSubDirConfig="false" for the relevant <virtualDirectory> element:
<configuration>
<system.applicationHost>
<!-- ... -->
<sites>
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
<virtualDirectory path="/Staging" physicalPath="C:\inetpub\wwwroot\Staging" allowSubDirConfig="false" />
</application>
<bindings> <!-- ... --> </bindings>
</site>
See http://www.iis.net/configreference/system.applicationhost/sites/site/application/virtualdirectory for the details.
The problem is, it still won't let you download the web.config file, it keeps returning a 404 - Not found, even after removing all handlers.
Edit - found the solution. The short answer is that in your web.config, you should clear the fileExtensions and hiddenSegments lists:
<system.webServer>
<security>
<requestFiltering>
<hiddenSegments>
<clear />
</hiddenSegments>
<fileExtensions>
<clear />
</fileExtensions>
</requestFiltering>
</security>
I've written a blog article about it that explains all the details.
Yet another issue with CSPACK...
I have a service definition file like this:
<ServiceDefinition name="core-eur" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-01.2.3">
<LoadBalancerProbes>
<LoadBalancerProbe name="discovery.probe" protocol="http" path="/HealthMonitoring" port="80" intervalInSeconds="8" timeoutInSeconds="16" />
</LoadBalancerProbes>
<WebRole name="Discovery.UI" vmsize="ExtraSmall" enableNativeCodeExecution="false">
<Startup>
<Task commandLine="startup\CreateCustomEventSource.cmd" executionContext="elevated" taskType="simple" />
</Startup>
<Sites>
<Site name="main">
<Bindings>
<Binding name="https.root" endpointName="https" hostHeader="testingblah.com" />
</Site>
<Site name="api" physicalDirectory="..\..\..\catalog\Catalog.Search.API">
<Bindings>
<Binding name="https.root" endpointName="https" hostHeader="api.testingblah.com" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="http" protocol="http" port="80" loadBalancerProbe="discovery.probe" />
<InputEndpoint name="https" protocol="https" port="443" certificate="bibliothecatest.com" />
</Endpoints>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteForwarder" />
</Imports>
<Certificates>
<Certificate name="testingblah.com" storeLocation="LocalMachine" storeName="CA" />
</Certificates>
</WebRole>
The key points are the Sites "main" and "api". I've not included the physical directory because, as expected, when they are put in and point to the project files in the solution, the "api" site is not packaged correctly as the Visual Studio package process will only package the first site (i.e. "api" has all the un-transformed .config files and .cs files in it's packaged folder whereas "main" does not - it is correctly packaged, but this is a known issue so I'm not going to complain too much about this.
So to workaround it, for my build server I want to introduce a CSPACK step to do this properly. I pre-build the "main" and "api" web sites using MSDEPLOY to a temporary location, and then use CSPACK to create the package file.
This fails every time with "CloudService077: Need to specify the physical directory for the virtual path 'main/ of role "Discovery.UI". However, I am including the /sitePhysicalDirectories value in CSPACK, i.e.
cspack %root%\ServiceDefinition.csdef ^
/role:Discovery.UI;%compiled%\discovery\Discovery.UI\ ^
/sitePhysicalDirectories:Discovery.UI;main;%compiled%\discovery\Discovery.UI\ ^
/sitePhysicalDirectories:Discovery.UI;api;%compiled%\catalog\Catalog.Search.Api\ ^
/rolePropertiesFile:Discovery.UI;Properties.txt ^
/out:%output% /copyOnly
If I put the sitePhysicalDirectories attribute back into the ServiceDefinition file, and point it to the project directory location in Visual Studio (e.g.)
<Site name="main" physicalDirectory="..\..\..\discovery\Discovery.UI">
then CSPACK fails with CloudServices079: Cannot find the physical directory "nnn" for virtual path main/
This is despite the fact that the CSPACK command line /sitePhysicalDirectories are correct. What's happening is that CSPACK is taking the ServiceDefinition values, applying the relative path values and pointing to completely the wrong place.
If I update ServiceDefinition to use the same physical location (e.g. C:\....\nnnn as opposed to "......\nnnn" that I'm passing in the CSPACK command line, everything works !
So it seems that CSPACK ignores parameters and cannot override values, which isn't what I really need. Is this correct or should I be passing something else to CSPACK?
Azure SDK 2.3
I know this is long after the fact, but I also had endless trouble with CSPACK. It is basically impossible to find any useful information on it.
What I've found, is that if you don't provide the arguments properly, you get all sorts of "Cannot find the physical directory..." and "Need to specify the physical directory..." errors, sometimes with directories that you did not provide.
Thanks to this powershell script I was able to execute it using the correct format and learned these things:
1. You must specify the /role: argument. The /sites argument is an extension of the role you specify here.
2. Put all your sites in one /sites argument or in one /sitePhysicalDirectories argument. I use the /sites argument for my builds.
For the above example, I would try:
cspack %root%\ServiceDefinition.csdef
/role:Discovery.UI;%compiled%\discovery\Discovery.UI\ /sites:Discovery.UI;main;%compiled%\discovery\Discovery.UI\;api;%compiled%\catalog\Catalog.Search.Api\ /rolePropertiesFile:Discovery.UI;Properties.txt
/out:%output% /copyOnly
My .csdef file:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="SimpleAzure1.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
<WebRole name="SimpleAzure1" vmsize="Small">
<Sites>
<Site name="Web2" physicalDirectory="../../../SimpleAzure1/">
<Bindings>
<Binding name="Endpoint2" endpointName="Endpoint2" hostHeader="SimpleAzure1.cloudapp.net" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint2" protocol="http" port="80"></InputEndpoint>
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
</WebRole>
</ServiceDefinition>
And my project structure is:
I define physicalDirectory="../../../SimpleAzure1/" in .csdef but when I create a package and deploy in azure physicalDirectory's default.aspx page is not loaded.Its load a page from asp.net wepappliaction.When I define physicalDirectory in .csdef file why asp.net wepappliaction page is loading.Am I missing some thing.Thanks.
Concur with knightpfhor - if you only have one site, remove the physical directory and host header.
If you are using more than one site in the role, deployment changed from SDK 1.7 to 1.8:
The physicalDirectory attribute path is relative to the directory in
which the target Service Definition file resides when packaged. In
previous versions this file was located within the root project
directory. In this version, by default, this file is located in the
project output directory. You may need to update the relative path to
reflect the new location of the target Service Definition file.
To see where the files are actually located, enable remote access and RDP into the instance. Check the Physical Directory specified in IIS and then confirm that path exists and references the installed website, typically E:\sitesroot\0 or F:\sitesroot\0
If you only have one site in your web role then there is no need to specify the physical directory or the host header.I suspect the builder is taking some short cuts. Try removing the site from the role and adding it again and this time leave the defaults.