如何设置Apache服务器以实现日志记录功能?
- 内容介绍
- 文章标签
- 相关推荐
本文共计544个文字,预计阅读时间需要3分钟。
相关文章内容如下:
apache配置文件中有三个指令,即 -
TransferLog:创建日志文件。 ( 推荐学习:Apache服务器 )
LogFormat:指定自定义格式。
CustomLog:创建和格式化日志文件。
TransferLog指令在apache配置文件中可用,它根据设置参数轮转虚拟主机日志文件。
VirtualHost www.example.com><br/><br/> ServerAdmin webmaster@yiibai.com<br/> DocumentRoot /usr/www/example/httpd/htdocs/<br/> ServerName www.example.com<br/> ServerAlias example.com www.example<br/> ErrorLog /usr/www/example/httpd/logs/error_log<br/> TransferLog /usr/www/example/httpd/logs/accesslog<br/> CustomLog /usr/www/example/httpd/logs/accesslog combined<br/><br/></VirtualHost><br/>
两种类型的Apache日志格式
通用日志格式
组合日志格式
可以通过编辑apache配置文件来启用它们,即apache2.conf(Debian/ubuntu)或httpd.conf(基于rpm的系统)文件。
本文共计544个文字,预计阅读时间需要3分钟。
相关文章内容如下:
apache配置文件中有三个指令,即 -
TransferLog:创建日志文件。 ( 推荐学习:Apache服务器 )
LogFormat:指定自定义格式。
CustomLog:创建和格式化日志文件。
TransferLog指令在apache配置文件中可用,它根据设置参数轮转虚拟主机日志文件。
VirtualHost www.example.com><br/><br/> ServerAdmin webmaster@yiibai.com<br/> DocumentRoot /usr/www/example/httpd/htdocs/<br/> ServerName www.example.com<br/> ServerAlias example.com www.example<br/> ErrorLog /usr/www/example/httpd/logs/error_log<br/> TransferLog /usr/www/example/httpd/logs/accesslog<br/> CustomLog /usr/www/example/httpd/logs/accesslog combined<br/><br/></VirtualHost><br/>
两种类型的Apache日志格式
通用日志格式
组合日志格式
可以通过编辑apache配置文件来启用它们,即apache2.conf(Debian/ubuntu)或httpd.conf(基于rpm的系统)文件。

