Apache配置文件httpd.conf的理解,9.PidFile:


httpd.conf 是Apache使用的主要配置文件:

1.文件位置, 一般在:C:\wamp64\bin\apache\apache2.4.51\conf

2. # 是注释符号: 1)解释每一指令的作用,2)指令模板,有时去掉#就能使用

3.Unix/Linux 用 /,如: /etc/httpd/conf/httpd.conf

windows用 \,如: D:\xampp\apache\conf\httpd.conf

4.ServerName: http访问/回应的网站名,即你注册的DNS网站名(如果没有,可以写上IP 地址,假设是117.220.48.20),比如:ServerName www.example.com:80

下面一段没有验证,不知道理解对不对: 如果没有注册的DNS名,则需要在hosts 文件上写上 (/etc/hosts):

117.220.48.20 www.example.com example.com

5.Listen 80 :服务器监听的端口号( 80 和 443, 分别是 default ports for HTTP and HTTPS)

6. User/Group:运行httpd的用户/组

7.ServerRoot: Apache 重要文件所在处 Apache’s important files, like the server’s configuration, error, and log files are kept at the top of the directory tree. This location is the ServerRoot,

8.DocumentRoot: 网站的网页所在处。

9. PidFile: 第一个httpd进程(所有其他进程的父进程)的进程号文件位置 The Apache service first starts as root in order to bind to the privileged port 80 for HTTP (or 443 if using SSL) because port numbers less than 1024 are only reserved to the root user

相关内容