Page 237 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 237
Unit 12: Server Role: Linux as Web Server
review the error.log file for configuration mistakes. If you accepted the defaults when you notes
installed Apache, the commands would be:
c:
cd “\Program Files\Apache Group\Apache2\bin”
httpd
Then wait for Apache to stop, or press Control-C. Then enter the following:
cd ..\logs
more < error.log
When working with Apache it is essential to know how it will find the configuration file. You can
specify a configuration file on the command line in two ways:
1. -f specifies an absolute or relative path to a particular configuration file:
httpd -f “c:\my server files\anotherconfig.conf”
or
httpd -f files\anotherconfig.conf
2. -n specifies the installed Apache service whose configuration file is to be used:
httpd -n “MyServiceName”
In both of these cases, the proper ServerRoot should be set in the configuration file.
If you don’t indicate a configuration file with -f or -n, Apache will use the file name compiled
into the server, such as conf\httpd.conf. This built-in path is relative to the installation directory.
You can verify the compiled file name from a value labelled as SERVER_CONFIG_FILE when
invoking Apache with the -V switch, like this:
httpd -V
Apache will then try to determine its ServerRoot by trying the following, in this order:
A ServerRoot directive via the -C command line switch.
The -d switch on the command line.
Current working directory.
A registry entry which was produced if you did a binary installation. The server root compiled
into the server. This is /apache by default, you can verify it by using apache -V and looking for
a value labelled as HTTPD_ROOT.
Throughout the installation, a version-specific registry key is created in the Windows registry.
The location of this key depends on the type of the installation. If you chose to install Apache
for all users, the key is located under the HKEY_LOCAL_MACHINE hive, like this (the version
numbers will of course vary between different versions of Apache:
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Group\Apache\2.0.43
Likewise, if you chose to install Apache for the current user only, the key is located under the
HKEY_CURRENT_USER hive, the contents of which are dependent of the user currently logged
on:
HKEY_CURRENT_USER\SOFTWARE\Apache Group\Apache\2.0.43
This key is compiled into the server and can facilitate you to test new versions without affecting
the current version. Of course, you must take care not to install the new version in the same
directory as another version.
LoveLy professionaL university 231