apache - 设置不记录/存储 IP 地址的 LAMP 服务器?

标签 apache ubuntu lamp privacy

需要对基本的 Ubuntu LAMP 安装进行哪些配置以防止它记录访问者的 IP 地址?

最佳答案

在 apache 配置中查找 CustomLog 指令:

fgrep -wir CustomLog /etc/apache2/

你会发现这样的东西:
CustomLog /var/log/apache2/access.log combined
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

寻找第三部分,combinedvhost_combinedLogFormat 的昵称s。它们在 /etc/apache2/apache2.conf 中定义。与 LogFormat指令,包含几个 Format Strings .

寻找
%a  Remote IP-address
%h  Remote host

并将它们从您的 LogFormat 中删除指令。将它们替换为 0.0.0.0 可能更聪明所以日志文件处理仍然可以进行。

前:
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

后:
LogFormat "0.0.0.0 %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

关于apache - 设置不记录/存储 IP 地址的 LAMP 服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14283701/

相关文章:

apache - Ubuntu 10.04 为 apache 更新 openssl

mysql - 通过命令行将大型 sql 文件导入 MySql

php - LAMP 堆栈的 PHP 不工作 (Ubuntu 13.10/Apache 2.4.6)

php - 何时更喜欢 XAMPP 而不是 Linux、Apache、MySQL 和 PHP 的完整安装

浏览器访问文档根目录中的 php 文件,所有者和组作为根目录

java - 在 Ubuntu 上使用 Java 应用程序打开端口 80

ios - 创建端到端 iOS 应用程序时,应该先创建前端还是后端?

php - FEDORA 20、APACHE 上的权限被拒绝

apache - 如何在 CentOS 7 上设置 php-fpm?

node.js - Azure 移动服务中的 Neo4j