appache配置文件httpd.conf
Listen 80 设置端口号
serverAdmin 设置管理员邮箱
srevername 设置域名
documentRoot 设置站点根目录(documentroot和serverName是对应的)
directory配置段 主要用于站点根目录特性的设置
<Directory "D:/www">
#配置默认首页 ,当仅指定了域名,没有指定具体的文件时,apache会将此项配置文件返回给用户
DirectoryIndex index.html
#允许列出目录结构,当请求的文件不存在是会将站点的目录结构显示出来
Options Indexes FollowSymLinks
#开启外部配置 All None
AllowOverride All
#配置访问权限 除了110.110.110.110域名外的都可以访问
Order deny,allow //如果没有明确的拒绝则全部允许
deny from ip或者all
allow from all或者 ip
Order allow,deny //如果没有明确的允许则全部拒绝
allow from all
Require all granted //所有请求都需要授权
</Directory>
apache服务维护
dir 查看当前目录的内容
cd 更改目录的位置
httped.exe 文件可以进行 apache服务的情动、停止、重新启动
语法:
httpd.exe -k stop
httpd.exe -k start
httpd.exe -k restart
检测配置是否有错
httpd -t