A Look At Windows NT Service - Configuration problems
The following was lifted, with some modification, from two sources:
On Windows NT, a service is a special kind of executable program that runs in the background, usually with no console or other interaction with the desktop. Programs that implement things like network protocols and network-enabled database servers are typically written so they can be run as services. For instance, most WWW servers on Windows NT can be run as services. Indeed, Microsoft's own Internet Information Server (IIS) and Oracle's Database Server for NT both run as services, by default.
A service is different from other programs in several ways:
The most important thing to remember is that, for correct operation, you may have to take special steps to make resources available to services. When a service is set to run under the default SYSTEM account, you need to make the files it attempts to access available to the Everyone group since this is the only group to which it belongs and it is not a user whose security settings can be manipulated via the User Manager. Also, environment variables that a service running under the SYSTEM account uses must be specified as system environment variables.
1. What Are The Most Common NT Service Configuration Problems?Given the properties of services, as described above, several things can go wrong if one, such as the WWW service, is not configured properly. The three most common problems are:
A. Security Settings
For an example of improperly configured security, if IIS reports an authentication error (401), it may be because the WWW service is running under the default SYSTEM account, the requesting user is the IIS anonymous user, and yet the ACL for a resource that it is trying to access disallows such access, despite the fact that the webmaster desires it.
For the above reason, and many others, one should not (as my freind had done) explicitly specify the IIS anonymous user (or any user, for that matter) in the ACLs of the public directories and files that are on one's website. It is better to change the ACLs of all files and directories including and below one's root web directory (whether physically or by creation of virtual directories) to something like:
Administrators Full Control (all) (all) Everyone Read (RX) or Special Permission(R)and then remove the Everyone Group and add one or more of
SpecialGroup1 SpecialPermissions1 (????) (????) . . . . . . SpecialGroupN SpecialPermissionsN (????) (????) ExecuteGroup SpecialPermission Execute(X)as needed to the files and/or directories where special rights are required ( i.e having paid for or registered for use of part of the site; needing to execute as a script. etc)
B. Environment Variables And Software Version Conflicts
Environment variable errors/conflicts and software version conflicts can be best demonstrated by the situation I encountered while installing Oracle 8i and Oracle Application server on the same machine. I found in the Oracle news groups that several people had the same problems, and the following is my response to one such individual:
In response to:
"pher" <no.spam@plea.se> wrote in message news:p4c5ps0ugf2cm7sv1m5788sidvv72akvof@4ax.com...
> Hello all
> I'm trying to install the Oracle 8.1.5 onto an NT4 SP6 server
> that has Oracle Application Server 4.08 installed. The 2 softwares
> seem to be incompatible. I get Blue Screens or Dr Watson error at
> JREW.EXE upon installing. I install them in 2 different Oracle-home
> directories.
> Is there any advice on how to proceed ?
> Thank you very much in advance
> Pierrot
[Lengthy prolog concerning other issues related to which version of SP6 was installed and potential problems arising from this]
if you are still determined, then you should:
-1. Backup any work you have done, if requiredThat is back up:
In other words:
NOTE:
You may first have to change permissions on all items including and below the LEGACY_ORACLE* entries using regedt32, as by default only the SYSTEM account has the right to delete them. You will of course need Administrator group membership to change these permissions.
1. Back up and clear the system environment settings that the installations will affect .In other words:
NOTE:
You must do this because there are known incidents concerning exceeded path lengths during installation, conflicting DLLs (especially Object Request Broker DLLs), conflicting classpaths to Java archives, among other environment related problems.
2. Install the products under different accounts:NOTE:
It is best to put the %ORACLE_HOME%\bin items on the PATH in descending order, starting from the product with the latest release date. This will avoid as many DLL problems as possible.
7. Fix remaining non-Java related conflicts:If you had some other Java JRE installed before installing the Oracle products, you may run into version conflict problems:
Anyway, the above procedure is just a rough guide. If you can think up a system configuration that logically does the same thing (or better), great: do that instead. For instance, I have had some luck with running the command line tools through telnet, as this allows one to log on as the installation user, giving that user's environment and allowing trouble-free operation of at least the command line tools for that installation.
The real point here is your ideal is to have all the:
For instance, many of the tool and services expect %ORACLE_HOME% and/or %ORAWEB_HOME% to be set, with Oracle Application Server expecting them to point to the OAS HOME and Oracle RDBMS expecting them to point to the Oracle RDBMS HOME. Of course, many times these values are obtained from the registry, so they will work fine if you have installed the products under separate accounts and to separate homes. As well, discovery scripts are often executed by Oracle products to set up the correct execution environment, so in these cases things will work just fine too. But unfortunately, there are a few places that, in my experience, still need hand tweaking to work properly in a "same machine" Oracle RDBMS/OAS installation, even if separate accounts and ORACLE HOMES are used.
I have 8.1.6 Enterprise Edition and Oracle Application Server 4.082 installed on the same NT 4 Workstation Service Pack 5 machine (I have avoided SP6 due to reported problems and the fact that things seem to work just fine as they are). The techniques outlined above seem to have worked quite well, but I have still had some rough edges to deal with. The Oracle documentation states that Oracle RDBMS 8.1.6/OAS 4.082 should work together, even if installed using the default settings, with all Oracle services running under that default SYSTEM user account and both products installed to the same ORACLE HOME. However, I found that, like you, this was not the case. So I had to uninstall both products and went through the above procedure to isolate the products as much as possible.
If you have a couple of extra machines (they don't have to be that great), and you are installing the same or greater version of the software, I strongly recommend installing 8i RDBMS, Oracle Management Server for Oracle Enterprise Manager, and Oracle Application Server each on a separate, clean machine, with:
*if you choose the Oracle Enterprise Manager install only, I believe a database instance is installed that is custom tailored for OEM's needs and that takes far fewer system resources than the default 8.1.5 database instance install, but don't quote me on this.\
NOTE: The same situation I have discussed above applies to many Microsoft, Oracle and other company's server products, although you must watch out for the "per machine" licensing issues. It turns out, for instance, that the back office suite is usually licensed per machine, requiring you to allocate a fair amount of additional funds for each box that is to run some subset of the servers/services that back office provides. And in my experience, running everything from Exchange server to SQL Server on one box in, say, a 100+ user environment is just asking for trouble, both performance and reliability of service-wise, even on a quad Xenon box with redundancy RAID.
Anyway, the above one machine per Oracle product architecture will:
NOTE: If you use Oracle JDeveloper, definitely do not install it on the Oracle 8i RDBMS box, unless you have tons of RAM and a really fast CPU or 4 ;-). JDeveloper can easily use over 100MB of main memory for moderately complex projects and can eat 99.99 CPU for many seconds at a time in such a situation for each operation. Additionally, JServer for Oracle 8i is the same way when asked to do a server-side java load/compile. So if you have JDeveloper 3.x or above and 8.1.5 or above on the same machine and you are deploying from JDeveloper to a local 8.1.5+ instance, you really need 384 MB+ RAM and a 700 Mhz+ CPU to get any work done. Otherwise you will spend most of your time sitting around watching task manger say that CPU and memory usage are maxed out.
Campbell Boucher-Burnet,
Camco & Associates:
Software Development and Consulting
2. How to Diagnose And Eliminate Possibilities?The next step in solving a service confguration error is to:
For example, to narrow down the possibilities of where the previously mentioned http 401 error could be coming from, one must ensure that certain default security settings created during the installation of NT and IIS are still in place. I'm pretty sure the following is how the defaults are set under NT Workstation 4, but I asked my friend to check the defaults for IIS 4 under Win2000 Server and revert to these while solving the problem:
IUSR_mymachine, whether set explicitly or through group membership has only "Log on locally" and "Access computer across network"
For more accurate diagnostics, one needs to know that in IIS4 under NT4 (at least), there are actually 6 types of 401 error:
401 Authentication required 401;1 Unauthorized: Logon failed. 401;2 Unauthorized: Logon failed due to server configuration. 401;3 Unauthorized: Unauthorized due to ACL on resource. 401;4 Unauthorized: Authorization failed by filter. 401;5 Unauthorized: Authorization failed by IASP/CGI app.So, one should check precisely which is being reported. Of course, it does not tell you too much if it is the first, as in the case of my friend.
Next, set the extended logging so that the Windows user logname (not just the IP) is recorded and then check to see who is actually logged in and for what resource, as far as IIS is concerned, when the 401 error occurs. When one is running a site with frames including many pages (and possibly dynamically determined pages), server-side scripts, client-side scripts, mixed secure and unsecure pages, and the like, this is very important. If you are serving plain, static, non-frame HTML, this becomes much less an issue.
Then check the User Manager to see if there is more than one internet guest account, like I had once from reinstalling IIS after slightly changing the host name of my computer.
My friend had to do this because he removed the Everyone (All) (All) default (a stupid Windows default if you ask me) and explicitly added the IIS anonymous user to the ACLs of his web files and directories. However, as you can see from the regedit snapshot, below, IIS supports only the one anonymous user. This means that it is important to figure out (from the logs, the ACLs on one's web stuff, and the rights of various group and users) whether, perhaps, the user or group permissions and ACLs on the desired resources have gotten out of sync. Of course, this turned out not to be the problem for my friend, but strange things can happen when IIS is reinstalled or NTFS is upgraded (as per the move from NT4 to Windows 2000), or a boot drive is copied, verbatim, A La early Drive Image to another computer within a MS Windows Domain. Once again, one really should just give the Everyone Group read access to all public web files, as well as ensuring that any files outside the scope of one's web hierarchy (for example, external files accessed by the ASP engine or CGI programs) are accessible by whatever account the WWW service runs under.
Now, the next thing to understand is that various DLLs (Dynamic Link Libraries) handle server-side processed files, as shown below:
Additionally, for each site or IIS application (read: DNS name and subdirectory under its root) within the Internet Service Control Manager, an additional set of ISAPI (Internet Service Application Programming Interface) filters can be specified.
If I recall correctly, these can register to be passed control from the DLLs that handle file mappings, either totally, or for identified sections within a server-side processed file. Hence, if there is a functional overlap between filters, then there can be problems with the priority in which the filters are specified.
Remember also that if the files accessed by server-side processing are dynamically determined at run-time, then there is another set of security settings to worry about. Also, there can be cases where server-side processing occurs using trusted impersonation, so it may be difficult to predict when and if authentication violations will occur in such cases.
All in all, it is best to keep file system level authentication issues simple...very simple.
3. Can There Be Other Problems?A final thought in the form of an excerpt from the IIS Service manager Help Pages:
Anonymous User Account Use this dialog box to set the Windows NT user account used for anonymous connections. By default, the server creates and uses the account IUSR_computername. Username Type the name of the anonymous account you created with the Windows NT User Manager for Domains utility in this box. Password Type in the anonymous user account password in this box. When you installed the server, Setup created the account IUSR_computername in Windows NT User Manager for Domains and in Internet Service Manager. Note Enabling automatic password synchronization disables this box. The password is used only within Windows NT; anonymous users do not log on by using a user name and password. Enable Automatic Password Synchronization When you create a new anonymous account, you must make sure that your Web site and Windows NT password settings are identical. Select this option to automatically synchronize your anonymous password settings with those set in Windows NT. Important Password synchronization should only be used with anonymous user accounts defined on the local computer, not with anonymous accounts remote computers.So, there is one more problem that can occur here: if Enable Automatic Password Synchronization is not set and IIS is reinstalled or someone or something changes the Windows password for the anonymous user account, problems can occur. I have experienced this problem with Samba under Linux as well.
As you can see, there are many aspects to configuring services under Windows NT (or indeed any OS supporting services). They can range from the obvious to the subtle and complex. I hope that this article can help, in some small way, anyone who is having problems in this area and has bumped into this page somehow.
C.B. 2000
For Further Reading:
Comments
Post new comment