Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

Thursday, September 3, 2009

SBS 2003 IIS won't start - try a Metabase restore

Restoring the Metabase with History Files (IIS 6.0)

To manually restore the metabase

1. From the Start menu, click Run.
2. In the Open box, type cmd, and then click OK.
3. Stop the IIS services by typing iisreset /stop at the command prompt, and then press ENTER. The command prompt displays the following:

Attempting stop...

Internet services successfully stopped

If the IIS services do not stop, and it is possible to restart the computer, type iisreset /stop /rebootonerror, and then press ENTER.
4. Make copies of your current metabase files. At the command prompt, type cd %systemroot%\System32\Inetsrv, and then press ENTER to navigate to the folder where the files are. Next, type copy MBSchema.xml MBSchema.old, and then press ENTER to copy the schema file. Finally, type copy MetaBase.xml Metabase.old, and then press ENTER to copy the metabase configuration file.
5. Locate the metabase history files. At the command prompt, type cd %systemroot%\System32\Inetsrv\History, and then press ENTER.
6. Select the version of history files that you want. At the command prompt, type dir, and then press ENTER. All of the files appear in the following format:

<date> <time> <file size> MBSchema_<identifying number>_0000000000.xml

<date> <time> <file size> MetaBase_<identifying number>_0000000000.xml

When you restore the IIS metabase to a previous version, you will need matching metabase schema and configuration files. Select matching files by their identifying number.
7. Copy the chosen history schema file over the existing metabase schema. At the command prompt, type copy /y MBSchema_<identifying number>_0000000000.xml %systemroot%\System32\Inetsrv\MBSchema.xml, and then press ENTER. With this command, you copy the file and rename it at the same time.
8. Copy the matching history configuration file over the existing metabase configuration. At the command prompt, type copy /y Metabase_<identifying number>_0000000000.xml %systemroot%\System32\Inetsrv\MetaBase.xml, and then press ENTER. Again, this command copies the file and renames it at the same time.

Important

If you mix up the names or copy a schema and configuration file that do not match, the metabase restoration will fail when you start the IIS services.
9. Restart IIS. At the command prompt, type iisreset /start, and then press ENTER. The command prompt displays the following:

Attempting start...

Internet services successfully started

If the IIS services do not restart, repeat these steps beginning at step 4, and copy a different set of history files over the current metabase files.

Small Business Server 2003 generated these errors after a power failure.

MSExchangeMU - Event 1009  - Failed to access the metabase, error code is 80080005 (Server execution failed).

IIS Config - Event 51262 - Unable to decrypt the secure property. Ignoring the property./LM/SmtpSvc/1AdminACL
ErrorCode           : 0x80090006

Service Control manager - Event 7024 - The IIS Admin Service service terminated with service-specific error 2148073478 (0x80090006).

Friday, July 17, 2009

PHP IIS 2k3 Server 2003 OCILogon Error

Fatal error: Call to undefined function OCILogon() in D:\wwwroot\testdb.php on line 3

We received this message on a server running Server 2003, IIS, PHP attempting to attach to an Oracle Server.

Some Prelims

1) Make a new app pool (we made one called PHP)

2) instead of an Isapi.dll simply edit the configuration (directory) on the properties of the site/virtual directory.

3) click configuration, add an extension mapping for the location of your isapi "D:\PHP\php5isapi.dll"

4) change the app pool of this site/virtual directory - to use the PHP app pool from #1.  Supposedly this allows you to right- click on the app pool, click recycle & it will reload your php.ini file without taking down everything.  In reality though, this didn't work & we still had to run (to get it to update):

net stop http /y

net start w3svc

5) Make sure PHP is in your allowed Web Service Extensions.  This script (test.php) will confirm PHP is working:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

2) check the 6th row in the above script's output

Configuration File (php.ini) Path                C:\WINDOWS

3) This tells us PHP is looking to c:\windows for the php.ini.  The second we copied our php.ini to that folder - everything started working.

4) use this script (testdb.php) to test your oracle connection:

<?php

if ($conn=OCILogon("username", "password", "DSN")) {
echo "Successfully connected to Oracle using OCI extension.\n";
OCILogoff($conn);
} else {
$err = OCIError();
echo "Error in connecting to the Oracle." . $err[text];
}
?>

But really, the bottom line was copying the php.ini file from d:\php to c:\windows.