As a top priority for the configuration and management of Apache servers, Apache server directives are very important, as we all know. Here is a detailed introduction to the Apache command set, named Apache Command Encyclopedia, I hope to be able to help you work and study! Specific content:
First, general configuration commands
Default value: Accessfilename. htaccess
This command is the name of the access control file for the directory;
Default value: Bindaddress *
Set the IP address that the server listens on;
Default value: DefaultType text/html
When the server does not know the file type, it notifies the client with the default value;
Default value: DocumentRoot "/var/www/html/"
Set up the directory where Apache provides file services;
Set the response that Apache does when a problem occurs;
Commands for using modules not included in Apache installation
Contains additional configuration files
Default value: All IP addresses that can be connected to the server
Specifies how to respond to address requests that are removed from port-specified ports address;
Control the server functions that a particular directory can use;
The values are:
None: represents only browsing,
FollowSymLinks: Allow pages to be connected elsewhere,
EXECCGI: Allow CGI to execute,
MultiViews: Allow to watch animation or listen to music and other actions,
Indexes: Allows the server to return a formatted list of directories,
Includes: SSI is allowed. These settings can be checked.
All: You can do anything but do not include multiviews.
AllowOverride: The None parameter indicates that anyone can browse the files in the directory.
The other parameters are: FileInfo, Authconfig, Limit.
Default value: Port 80
Set up the network port on which the server listens;
Set up an administrator's e-mail address;
Set the host name of the server;
Default value: serverroot/etc/httpd/
Set the root directory of the server;
14. User && Group
Specifies the user ID and group ID used by the server to answer the request;
Ii. performance and resource configuration commands
1. Process Control
Default value: MaxClients 150
Set the number of requests that can serve at the same time;
Default value: Maxrequestsperchild 0
Sets the maximum number of requests that each process can respond to, with 0 indicating no limit;
Default value: Maxspareservers 10
Set the maximum number of idle service processes; Minspareservers Set minimum idle service process number;
Default value: ServerType standalone
Set the way the system executes the server;
Default value: StartServer 5
The number of child processes that were established when the server was started;
Default value: Threadsperchild 50
Set the number of threads used by the Apache server;
Default value: Timeout 300
Sets the timeout value for processing a request;
2. Establish continuous connection
Default value: KeepAlive on
Set to open or close TCP connections in Apache 2.2, KeepAliveTimeout
Default value: KeepAliveTimeout 5
Set the time to wait for the TCP connection to be turned off in Apache;
Default value: Maxkeepaliverequests 100
Sets the maximum number of requests per connection for persistent connections;
3. Control system resources
Control the time that the Apache process consumes CPU;
Control the amount of memory consumed by the Apache process;
Set the maximum number of concurrent processes per user;
4. Dynamic Loading Module
Mount a precompiled module that is not used by the current server;
Clears the list of precompiled modules;
Third, the standard container command
and container directives, which are applied to the specified directory and its subdirectories;
And in addition to using regular expressions as parameters and not needing wildcard characters ~, and
And containers are used to set access by file name;
and similar, but cannot use wildcards ~;
and container commands are used to provide access control through a URL.
And the same, just can't use the wildcard character ~.
Four, the Virtual host command
Define a specific virtual host.
Use this command if you want to make a virtual host based on a name.
A name-based virtual host that contains multiple IP names. You can use a separate virtual host command to define all the IP names.
Five, log command
Default value: ErrorLog logs/error_log
Set the error log file.
Default value: Lockfile logs/accept.lock
The path used to set the lock file to ensure that only the Apache server has read and write access to this file.
Default value: Pidfile logs/httpd.pid
A file that sets the process ID of the Apache Server record daemon.
Default value: Scoreboardfile logs/apache_status
Sets the path to store the internal process data files.
VI. Certification of security orders
Default value: AllowOverride all
When the server finds the file specified by Accessfilename, you need to know that the instructions in that file can overwrite instructions that appear earlier in the configuration file.
AllowOverride can be set to none, the contents of the file are not read at this time, and if set to all, the server will allow all instructions.
Set the label for a resource that requires authentication.
Select the authentication type to use for a directory.
Default value: Hostnamelookups off
Set Apache allows or disables DNS lookups for each request.
And the wrapped instructions are applied only to any valid HTTP access method specified.
This command selects users who have been authenticated to access the directory.
If you have established a basic HTTP authentication configuration and have used both the Allow and require commands, you can use this command to configure the conditions in which Apache can meet the requirements of authentication.
Provides access control based on the host name or IP address of the client.
A typical application is in a container to allow access to eligible hosts.
A typical application is in a container, which is used to prohibit eligible host access.
Used to control the order of allow and deny directives.
can provide CGI scripts or HTTP request methods based on MIME type.
Specifies an action for a specific mime-type.
This command is similar to action, but instead of linking operations to Mime-type, it links actions to HTTP request methods, such as get and put.