配置文件一般为 httpd.conf,位于 Apache 安装文件夹。
| 项目示例 | 意义 | 参考 |
|---|---|---|
| #注释内容 | ||
| Listen 12.34.56.78:80 | 绑定 IP 地址和端口 | |
| Port 80 | 端口 | |
| ServerName tc.web.com | WEB 服务器名字 | |
| DocumentRoot "D:/WWWROOT" | WEB 服务器根目录 | |
| Options Indexes
Options FollowSymLinks Options MultiViews |
||
| ScriptAlias /cgi-bin/ "C:/cgibin" | CGI 文件存放路径 | |
| ServerType standalone
ServerType inet |
独立启动,默认
有请求时才启动 |
|
| ServerRoot "/usr/local" | 进程默认目录 | |
| Timeout 300 | 超时秒数 | |
| KeepAlive On | 一次 HTTP 请求,多次传输功能 |
| 项目示例 | 意义 | 参考 |
|---|---|---|
| AddDefaultCharset GB2312 | 默认语言 | |
| Alias /vdir/ "C:/abcd/" | 虚拟目录 | |
| <Direrctory "C:/abcd/"> Options MultiViews AllowOverride None Order allow,deny Allow from all </Directory> |
虚拟目录设置 |