Failure to reinstall IIS7 on Windows Vista Home Premium - iis-7

I cannot reinstall IIS7 on a windows vista home premium laptop. A previous working IIS7 installation failed upon installation of some windows automatic updates. The updates have been removed, and IIS7 was uninstalled.
Every time the IIS7 installation is attempted (with the selection of ALL features under the Internet Information Services tree in Windows Features), an error is received at the end saying that some features were not configured correctly and that the installation will not succeed.
The installation always fails with windows rebooting saying that updates were not configured properly and uninstalling them.
Can you please assist with the possible cause of the IIS reinstallation failure. I have done a lot of forum searches, with similar reinstallation problems, but the solutions are not successful in my instance.
Thankyou for your time; I would be happy to elaborate on any points and apologise for the vagueness of this question.
What appears to be the important part of the IIS7.log error is the following:
[01/20/2012 19:40:40] [ IIS 7.0 Component Based Setup ]
[01/20/2012 19:40:40] "C:\Windows\System32\inetsrv\iissetup.exe" /install SharedLibraries
[01/20/2012 19:40:40] < WARNING! > Failed to detect if config redirection is enabled. result=0x80070032.Assuming config is not redirected and continuing.
[01/20/2012 19:40:40] NetFrameworkConfigurationKey key container already exists
[01/20/2012 19:40:40] Set ACLs on NetFrameworkConfigurationKey
[01/20/2012 19:40:40] iisWasKey key container already exists
[01/20/2012 19:40:40] iisWasKey user key already exists
[01/20/2012 19:40:40] iisConfigurationKey already exists
[01/20/2012 19:40:40] < !!FAIL!! > Install of component SharedLibraries result=0x80070032
[01/20/2012 19:40:40] < !!FAIL!! > COMPONENT::ExecuteCommand result=0x80070032
[01/20/2012 19:40:40] [ End of IIS 7.0 Component Based Setup ]
[01/20/2012 19:40:42] [ IIS 7.0 Component Based Setup ]
[01/20/2012 19:40:42] "C:\Windows\System32\inetsrv\iissetup.exe" /launch C:\Windows\System32\inetsrv\appcmd.exe reset config -section:system.applicationHost/applicationPools
[01/20/2012 19:40:42] < WARNING! > Failed to detect if config redirection is enabled. result=0x80070032.Assuming config is not redirected and continuing.
[01/20/2012 19:40:42] Launching command C:\Windows\System32\inetsrv\appcmd.exe, with params C:\Windows\System32\inetsrv\appcmd.exe reset config -section:system.applicationHost/applicationPools
[01/20/2012 19:40:42] < !!FAIL!! > LaunchCommand result=0x80070032
[01/20/2012 19:40:42] [ End of IIS 7.0 Component Based Setup ]
[01/20/2012 19:40:42] [ IIS 7.0 Component Based Setup ]
[01/20/2012 19:40:42] "C:\Windows\System32\inetsrv\iissetup.exe" /launch C:\Windows\System32\inetsrv\appcmd.exe reset config -section:system.applicationHost/listenerAdapters
[01/20/2012 19:40:42] < WARNING! > Failed to detect if config redirection is enabled. result=0x80070032.Assuming config is not redirected and continuing.
The following have been tried, with the same error IIS7.log error:
a) Uninstall Windows Process Activation Service, reboot, before attempting reinstall of IIS7
b) Administrator command line to try and fully wipe IIS7 install before another reinstall failure
start /w pkgmgr.exe /uu:IIS-WebServerRole;WAS-WindowsActivationService

Better to first uninstall the installed IIS using following Command run with the admin privilege in CMD and install IIS using Web Platform Installer.It will be easy to manage.
start /w pkgmgr /uu:IIS-WebServerRole;IIS-WebServerManagementTools;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASP;IIS-ASPNET;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-NetFxExtensibility;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-HttpTracing;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-Performance;IIS-HttpCompressionStatic;IIS-Security;IIS-RequestFiltering;IIS-WindowsAuthentication;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
Helpful Link

Open regidit, navigate to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP]:
a) Change Start from 4 ( disabled) to 3 ( automatically)
b) Delete "NoRun" key if this key exists
Reboot the server.
Reinstall IIS7 again.
from
http://blogs.msdn.com/b/asiatech/archive/2011/01/10/iis7-re-installation-failed-due-to-http-service-disabled.aspx

Related

IpRestrictionModule - HTTP Error 500.19 - Internal Server Error

After trying multiple configuration changes, I cannot seem to get past this error. This is a fresh install of Windows Server 2012R2, with all of the options selected under the ASP.NET/IIS modules and features selected. I'm using Visual Studio 2013, and the target framework is 4.5
I have also executed the following commands:
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/handlers
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/security/ipSecurity
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/modules
Try adding
-commit:apphost
to the command, like this
%windir%\system32\inetsrv\appcmd.exe unlock config section:system.webServer/security/ipSecurity -commit:apphost
so that the unlocking is applied at the topmost (applicationhost.config) level instead of the lower web.config levels

Drush install on local server error (Command pm-enable needs a higher bootstrap level)

I am getting an error message in Drush on a local mamp install
PDO::__construct(): [2002] Connection refused (trying to connect via tcp://127.0.0.1:3306) [warning]
environment.inc:517
Command pm-enable needs a higher bootstrap level to run - you will need to invoke drush from a more [error]
functional Drupal environment to run this command.
The drush command 'en devel' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a configured database. In this case
you can select another site with a working database setup by specifying the URI to use with the --uri
parameter on the command line. See `drush topic docs-aliases` for details.
* connect the database through a socket. The socket file may be wrong or the php-cli may have no
access to it in a jailed shell. See http://drupal.org/node/1428638 for details.
Drush was attempting to connect to:
Drupal version : 7.21
Site URI : http://default
Database driver : mysql
Database hostname : 127.0.0.1
Database username : root
Database name : geoslate
Default theme : garland
Administration theme: garland
PHP configuration : /private/etc/php.ini
Drush version : 5.8
Drush configuration:
Drupal root : /Applications/MAMP/htdocs/geoslate
Site path : sites/default
Modules path : sites/all/modules
Themes path : sites/all/themes
File directory path: sites/default/files
%paths : Array
my drupal settings needed a port specifying which is on the MAMP home page and for me is 8889

How to check whether ASP.NET 4.0 registered on IIS 7.5

Is there any reliable way how to check whether ASP.NET 4.0 registered on IIS 7.5 programmatically? I need to test it in the installer as prerequisite, before ASP.NET application installation start.
If ASP.NET 4.0 not registered on the IIS, later during the installation just installed application cannot be run and returns 500 internal server error (and it is too late to solve the problem). Instead, I want to show some warning (and hint how to solve the issue) before any installation steps started. But no reliable solution found yet.
AFAIK, registry entries reading sometimes may not work correctly. So now, I run aspnet_regiis.exe -lv to list versions (as suggested here) and parse the output. But even if .NET not registered correctly my test (falsely) succeeds, because the output is (contains version 4.0):
2.0.50727.0 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0 C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
(Win7 32bit)
Running aspnet_regiis.exe -ir can repair it in this case.
It's similar issue as this question, but I need test it programmatically.
Do you have any ideas or experiences?
Using your own answer as a basis, this can also be done using the command line (with elevation):
%WINDIR%\System32\inetsrv\appcmd.exe list apppool /managedRuntimeVersion:v4.0
If anything is returned, ASP.NET 4.0 is registered.
The issue with this approach is that it seems to be possible to create 4.0 application pools manually even if the filter is not installed, and then this method would not work.
EDIT:
I have ended up running these three checks:
aspnet_regiis.exe -lv (should return a line containing "c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll")
appcmd.exe list apppool /managedRuntimeVersion:v4.0 (should return a line containing "MgdVersion:v4.0")
appcmd.exe list config -section:system.webServer/isapiFilters (should return a line containing "c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll")
Note that I only care about 32bit versions.
If all three checks pass, it can be concluded that ASP.NET 4.0 is registered. Still not 100% false positive-proof though.
This is an old question, but I'm posting an answer because your question is one of the top results on google, and it's unanswered.
The registry key you are looking for is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0. If that key is present, then .Net 4 has been installed and is registered in IIS.
If you just want to check if .Net 4 is installed, you can check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full.
In Powershell it could be done like this:
# load the IIS-Commandlets
Import-Module WebAdministration
# get the isapi filters currently loaded
Get-WebConfigurationProperty -Filter "/system.webServer/isapiFilters/filter" -name *
An output could look like this:
name : ASP.Net_4.0_32bit<br/>
path : %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll<br/>
enabled : True<br/>
enableCache : True<br/>
preCondition : runtimeVersionv4.0,bitness32<br/>
ItemXPath : /system.webServer/isapiFilters/filter[#name='ASP.Net_4.0_32bit']<br/>
Attributes : {name, path, enabled, enableCache...}<br/>
ChildElements : {}<br/>
ElementTagName : filter<br/>
Methods :<br/>
Schema : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema<br/>
name : ASP.Net_4.0_64bit<br/>
path ........
Based on that we could write this code to check and install .NET 4 if needed:
$DotNet4Missing = $true
# lets make sure we got .net 4 correctly setup
$isapiFilters = Get-WebConfigurationProperty -Filter "/system.webServer/isapiFilters/filter" -name *
"/system.webServer/isapiFilters/filter count: {0}" -f $isapiFilters.Count
foreach ($filter in $isapiFilters)
{
"filter.name: {0}" -f $filter.name
if ($filter.name -eq "ASP.Net_4.0_64bit")
{
"-> Found .NET 4 - GREAT!"
$DotNet4Missing = $false
}
}
if ($DotNet4Missing)
{
"Missing .NET 4 IIS integration - running aspnet_regiis.exe"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe"
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = "-iru"
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start() | Out-Null
$p.WaitForExit()
$stdout = $p.StandardOutput.ReadToEnd()
$stderr = $p.StandardError.ReadToEnd()
"aspnet_regiis.exe stdout: {0}" -f $stdout
"aspnet_regiis.exe stderr: {0}" -f $stderr
"aspnet_regiis.exe ExitCode: {0}" -f $p.ExitCode
}
Summary: The problem described above occurs on non-server operating system (Win7). The .NET 4.0 is not registered on the IIS even if you install IIS before .NET 4.0 (and so .NET should be registered on IIS correctly). This causes unexpected problems during any ASP.NET application installation -- until aspnet_regiis.exe -ir is ran from the commandline. There is no problem with Win 2008 (i.e. when IIS installed before .NET 4.0 then .NET is registered correctly on IIS and everything works as expected).
So finally my colleague told me what possibly could be solution of the problem. I've verified that following solution works fine (also on Win7). ServerManager from Microsoft.Web.Administration namespace can be employed easily:
public static bool IsAspNetRegistered()
{
using (var mgr = new ServerManager())
{
return mgr.ApplicationPools.Any(pool => pool.ManagedRuntimeVersion == "v4.0");
}
}
In case of successful .NET registration on IIS, there is at least one application pool which runtime version is set to "v4.0" so this fact was used for the check.
Of course, if anybody deletes all application pools, this method can work incorrectly. But this is bit pathological situation I don't care. The main issue is to prevent that although everything is done according our installation recommendations, still not possible to install the application on the machine.

How to replace OpenExeConfiguration in a web context (asp.net mvc 1)

OK so we have something that is currently using OpenExeConfiguration for reading a config file, however this doesn't work when running in the web context.
I've tried a variety of different ways of opening the web.config programmatically but I can't seem to get it to read the correct web.config file. In case it matters I am currently debugging it in VS 2008.
1. config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);
2. config = ConfigurationManager.OpenMappedExeConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = "web.config" }, ConfigurationUserLevel.None);
3. config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
4. config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(null);
5. System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath);
It either opens up the wrong config file (either the machine config, or the VS /IDE/Web.config) or complains about the error:
{System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Failed to map the path '/'. ---> System.InvalidOperationException: Failed to map the path '/'.
Edit -
OK so a combination of
config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
AND running Visual Studio 2008 As Administrator worked. Am hoping we don't run into security/permission issues when we deploy to our web server / client environments!
So in the end I used this code (had to handle whether the web application was running, or if our unit test code was running).
System.Configuration.Configuration config = null;
if (System.Web.HttpContext.Current != null && !System.Web.HttpContext.Current.Request.PhysicalPath.Equals(string.Empty))
config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
else
config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
Also have to be running Visual Studio in Administrator mode - which I found out you can set as a property on your shortcut so you don't need to remember each time in Windows 7 to right click and run as administrator :)

IIS giving 503 errors

I am running a Vista machine with IIS7. I believe (not 100% confident) IIS was working fine for me before I installed PHP from php-5.3.5-nts-Win32-VC9-x86.msi from official PHP website. I went ahead with the default install - did not cutomize anything. After the install, http://localhost gives me 503 Service Unavailable error. I have tried diagnosing using following links but can't find anything wrong. Please help me.
http://mvolo.com/blogs/serverside/archive/2006/10/19/Where-did-my-IIS7-server-go_3F00_-Troubleshooting-_2200_service-unavailable_2200_-errors.aspx
http://www.php.net/manual/en/install.windows.iis7.php
My apppools are running:
C:\Windows\System32\inetsrv>appcmd list apppools
APPPOOL "DefaultAppPool" (MgdVersion:v2.0,MgdMode:Integrated,state:Started)
APPPOOL "Classic .NET AppPool" (MgdVersion:v2.0,MgdMode:Classic,state:Started)
I don't see any errors in either the Application Log or the System Log.
The CGI, ISAPI Extensions, ISAPI Filters are all checked as in http://www.php.net/manual/en/install.windows.iis7.php
also set following values in php.ini
fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo=1
cgi.force_redirect = 0
following mapping is set in IIS:
Request path: *.php
Module: FastCgiModule
Executable: C:[Path to PHP installation]\php-cgi.exe
Name: PHP_via_FastCGI
C:\Windows\System32\inetsrv>appcmd list config -section:system.webServer/fastCgi
gives:
<system.webServer>
<fastCgi>
<application fullPath="C:\Program Files\PHP\php-cgi.exe" activityTimeout="60
0" requestTimeout="600" instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
<environmentVariable name="PHPRC" value="C:\Program Files\PHP\" />
</environmentVariables>
</application>
</fastCgi>
</system.webServer>
the solution provided here fixed the problem for me partly. It had nothing to do with PHP. I had added a url reservation sometime earlier when trying to experiment and self-host
some WCF services, and removing that url reservation solved the problem:
http://haacked.com/archive/2007/05/21/the-iis-7-team-rocks.aspx
netsh http show urlacl
The result showed that I had reserved http://+:80/ which takes precedence over all other URLs on port 80.
Reserved URL : http://+:80/
User: METAVERSE\Phil
Listen: Yes
Delegate: No
SDDL:
D:(A;;GX;;;S-1-5-21-1527697538-1582451445-1978546337-1000)
The solution was to run this command:
netsh http delete urlacl url=http://+:80/
Which removed the reservation.
My php scripts now run, but http://localhost/iisstart.htm is giving me a blank screen. Need to investigate it further...
The blank screen problem was fixed using this post: http://forums.iis.net/p/1158261/1906535.aspx
Control Panel->Programs and Features->Turn Windows features on/off->IIS->WWW Services->Common Http features->Static Content

Resources