Apache配置文件httpd.conf的理解

Apache配置文件httpd.conf的理解httpd.conf是Apache使用的主要配置文件:1.文件位置,一般在:C:\wamp64\bin\apache\apache2.4.51\conf2.#是注释符号:1)解释每一指令的作用,2)指令模板,有时去掉#就能使用3.Unix/Linux用/,如:/etc/httpd/conf/httpd.confwindows用\,如:D:\xampp\apache\conf\httpd.conf4.ServerName:http访问/回应的网站名,即你注册的DNS网

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

今天的文章Apache配置文件httpd.conf的理解分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/27234.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注