[아파치]외부링크 차단
# Web&WAS/Apache2024. 2. 14. 08:31[아파치]외부링크 차단

RewriteEngine On # Allow example.com domain RewriteCond %{HTTP_REFERER} !^https?://(www\.)?example\.com [NC] # Log blocked requests RewriteRule .* - [L,R=403] # Custom log format for blocked requests LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" blocked_requests CustomLog "/path/to/your/logs/blocked_requests.log" blocked_requests

아파치 로그포맷 JSON 변경
# Web&WAS/Apache2021. 4. 1. 17:49아파치 로그포맷 JSON 변경

LogFormat "{ \"time\":\"%t\", \"clientip\":\"%a\",\"host\":\"%V\", \"request\":\"%U\", \"query\":\"%q\", \"method\":\"%m\", \"status\":\"%>s\", \"userAgent\":\"%{User-agent}i\", \"referer\":\"%{Referer}i\" }" json_format

awstats-7.7 설치(로그분석툴)
# Web&WAS/Apache2019. 10. 4. 17:43awstats-7.7 설치(로그분석툴)

# wget https://prdownloads.sourceforge.net/awstats/awstats-7.7.tar.gz https://awstats.sourceforge.io/#DOWNLOAD AWStats - Open Source Log File Analyzer for advanced statistics (GNU GPL) [What is AWStats] [Demo] [Features] [Downloads] [Documentation / FAQ] [Comparison] [AWStats Project/Development] What is AWStats AWStats is a free powerful and featureful tool that generates advanced web, streamin..

아파치 로그를 이용한 트래픽 확인방법
# Web&WAS/Apache2019. 1. 30. 09:48아파치 로그를 이용한 트래픽 확인방법

일일 트래픽 계산 cat | grep '11/May' | awk '{sum = sum + $10} END {printf ("%f\n", sum/1073741824)}'

아파치  https 리다이렉트 설정
# Web&WAS/Apache2019. 1. 12. 16:20아파치 https 리다이렉트 설정

ssl인증서를 설치했더라도 http로 접속하면 80으로 접속가능하기때문에 http로 접속하더라도 ssl이 적용된 https로 접속하게 할려면 아래와 같이 apache설정을 해야합니다. Virutalhost설정안에 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} 설정 후 apache재시작을 해주세요. 주의 : rewrite_module이 설치되어 있는지 꼭 확인하세요.

image