Home >Backend Development >PHP Tutorial >APACHE(2)_PHP Tutorial

APACHE(2)_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:11:44890browse

Chapter 2
Start Apache
2.1 Start Apache
httpd This program can be started by the Internet service program inetd every time there is a connection to
enter the HTTP service. , or another way, it can also be executed continuously as a service program
(daemon) to handle requests. No matter which method you choose, you must set the
ServerType directive to tell the server how it wants to perform.
2.2 Command line options
The following options can be used on the httpd command line:
-d serverroot
Set the starting value of the ServerRoot parameter to serverroot. This can
be changed via the ServerRoot command in the configuration file. The default is
/usr/local/etc/httpd .
-f config
Execute the instructions in the config file at startup. If config does not start with /
, then it will be treated as a path relative to ServerRoot. The
default is conf/httpd.conf .
-X
Execute in single-process mode and only used for internal debugging; service
The program will not leave the terminal operation or generate any subroutines. Do not use this mode
to serve normal web pages.
-v
Print the version of httpd and exit.
-?
Print a list of httpd options and finish.
2.3 Configuration File
This server will read three configuration command files. Any command can appear in any of these files
. The names of these files are relative to the server root;
This is the root specified by the ServerRoot directive, or the -d command line flag.
By convention these files are:
conf/httpd.conf
Contains instructions for controlling the operation of the service program. The file name can be changed with the -f command line flag
flag.
conf/srm.conf
Contains directives that control the file specifications provided by the server to clients. The file name can be changed
with the ResourceConfig directive.
conf/access.conf
Contains instructions for controlling file access. The file name can be changed with the AccessConfig
command.
However, these conventions do not need to be followed exactly.
This server also reads a file containing MIME file types; this file name is set with the
TypesConfig directive, and has conf/mini.types as the default.
2.4 Log file
2.4.1 pid file
When the service program starts, it saves the program code (process id) of the parent program httpd to this
log/httpd.pid file. This file name can be changed with the PidFile command
. This code is used by the administrator to restart or terminate the service; a HUP signal
causes the service to reread its configuration file and a TERM signal causes it to terminate.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629554.htmlTechArticleChapter 2 Start Apache 2.1 Start Apache httpd This program can be used through the Internet service program inetd is started every time there is a connection to enter the HTTP service, or another...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn