ユーザ用ツール

サイト用ツール


このページの翻訳:



最近の更新



Tag Cloud

50_dialy:2025:02:06

文書の過去の版を表示しています。


2025.02.06 Cloudflare CF-Connecting-IP

CF-Connecting-IP でリモートIPを取得

remoteip_moduleを利用
※Aache 2.4

module有効化

sudo a2enmod remoteip
sudo systemctl restart apache2

apachectl -M | grep remo
 remoteip_module (shared)

removeip.conf用意

/etc/apache2/conf-available/remoteip.conf

RemoteIPHeader CF-Connecting-IP

設定有効化

sudo a2enconf remoteip
sudo systemctl restart apache2

ログ確認

REMOTE_ADDR が CF-Connecting-IP になっているか確認

tail -f /var/log/apache2/access.log

あとは普通に.htaccessなどで制御

Order Deny,Allow
Deny from all
Allow from xxx.xxx.xxx.xxx
Allow from xxx.xxx.xxx.xxx
Allow from xxx.xxx.xxx.xxx
50_dialy/2025/02/06.1739003774.txt.gz · 最終更新: 2025/02/08 17:36 by matsui