The location of this file is set at compile-time, but may be overridden with the -f command line flag. In addition, other configuration files may be added using the Include directive, and wildcards can be used to include many configuration files. Any directive may be placed in any of these configuration files. Changes to the main configuration files are only recognized by httpd when it is started or restarted. The server also reads a file containing mime document types; the filename is set by the TypesConfig directive, and is mime.
There must be no other characters or white space between the backslash and the end of the line. Arguments to directives are separated by whitespace. If an argument contains spaces, you must enclose that argument in quotes. Directives in the configuration files are case-insensitive, but arguments to directives are often case sensitive.
Lines that begin with the hash character " " are considered comments, and are ignored. Comments may not be included on the same line as a configuration directive.
White space occurring before a directive is ignored, so you may indent directives for clarity. The location of the error log is determined by the value specified using the ErrorLog directive. This file is critical because you will refer to it in order to debug errors, solve server configuration problems, and optimize the server. If the server hosts multiple sites and you want to have separate error logs for each site, you can specify a different file and location for each site in the virtual hosts file.
The LogLevel directive controls the level of the messages logged in the error logs. By default, it is set to warn, meaning that all messages with the value of warning and higher as in more critical will be logged. You can change the value of this directive to adjust the logging level to your preference.
This is the default Apache web server document directory, and its contents are readily and publicly available to clients connecting through the web. It contains the static and dynamic content to be served once the server receives an HTTP request for them.
If you are hosting multiple websites on the same server, you need to set a different DocumentRoot for each site. This can be done within the respective VirtualHost directive that corresponds to each site. To set a separate error log for each of these domains, which is really a good idea, then your virtual hosts will like this:. The ServerName directive is used to set the host name of the server; this is how the server identifies itself.
The Apache service first starts as root in order to bind to the privileged port 80 for HTTP or if using SSL because port numbers less than are only reserved to the root user. After the initial execution, children processes spawn to handle client requests which are owned by the Apache user specified in the configuration file.
For this reason, you will find one root process and multiple processes belonging to the web user; this root process is the first one initiated when Apache starts. You can control the location of the Pid file by using the PidFile directive in the configuration file. If you open the file specified in the PidFile directive, you will find a number that corresponds to the parent process ID. You may find yourself becoming overwhelmed as you start to set up Apache server.
As an open source, advanced application capable of a wide range of functions, Apache web server configuration and setup is fairly complex. With both installation options, modules can be compiled in the form of a dynamic shared object, or DSO. A DSO is an object file capable of being shared and utilized by numerous applications. DSO modules are separate from the core Apache file.
The DSO approach to compiling modules is popular because it makes adding, updating, and removing modules easy. This Apache server tutorial will now provide instructions for Apache web server configuration in Linux, step by step.
Modifying configuration settings will ensure they reflect the domain specifics, which will allow Apache to respond to domain requests correctly and successfully. The process for completing virtual server Apache configuration is simple:. After setting up Apache web server, I highly recommend the use of a monitoring tool to help you test Apache server and monitor it effectively. To see which modules are currently compiled into the server, you can use the -l command line option.
You can also see what modules are loaded dynamically using the -M command line option. Directives placed in the main configuration files apply to the entire server. These sections limit the application of the directives which they enclose to particular filesystem locations or URLs.
They can also be nested, allowing for very fine grained configuration. This is called Virtual Hosting. Although most directives can be placed in any of these sections, some directives do not make sense in some contexts. For example, directives controlling process creation can only be placed in the main server context.
To find which directives can be placed in which sections, check the Context of the directive. For further information, we provide details on How Directory, Location and Files sections work. The special files are usually called.
0コメント