Apache配置文件httpd.conf的理解

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

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值