09-02
28

CustomLog的使用和Apache重起速度

从httpd.conf中 打开虚拟机
>apachectl restart


Syntax error on line 33 of /usr/local/etc/apache22/extra/httpd-vhosts.conf:
CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional "env=" clause (see docs)

如果在httpd-vhosts.conf中注释掉下面这句启动就不会有问题。


CustomLog "/usr/local/www/log/club.wwwer.org-access_log common"

并且 apachectl restart 特别的慢 如果把apache的虚拟目录关闭就很快。
寻找了半天答案,终于解决问题,方法如下:
出现错误是因为 CuStomLog 后面不需要加双引号!官方规范如下:


# 使用nickname
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common

# 明确使用格式格式字符串
CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"

Apache重起时间非常的长,是因为不能填写域名!要填写IP!


NameVirtualHost 211.157.108.95:80


<VirtualHost 211.157.108.95:80>
ServerAdmin Johnny.He@Live.com
DocumentRoot "/usr/local/www/Blog"
ServerName wwwer.org
ErrorLog "/usr/local/www/log/wwwer.org-error_log"
CustomLog /usr/local/www/log/wwwer.org-access_log common
</VirtualHost>

至此 问题全部解决...
*以上操作 全部在/usr/local/etc/apache22/extra/httpd-vhosts.conf 文件中!

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 731
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭