我的服务器上只有 32GB,而且日志很快就耗尽了这个空间。所以我想禁用日志。
我想我找到了在哪里做,但由于我在服务器方面是一个完全的菜鸟,我不想在不确定它们不会使服务器崩溃的情况下开始改变事情。
在 etc/apache2/apache2.conf 中,我发现了这个:
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
在 etc/apache2/conf.d/other-vhost-access-log 中,我发现了这个:
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined
我需要做什么来禁用日志?
提前致谢