![[아파치]외부링크 차단](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb5lmLQ%2FbtsENS22Uue%2FGTnZq2BzvXugyGLe2VY7rk%2Fimg.png)
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 변경](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F7mJ9Q%2Fbtq1D1X7yAu%2FCVgVRPz5rk2luTkv21T400%2Fimg.png)
LogFormat "{ \"time\":\"%t\", \"clientip\":\"%a\",\"host\":\"%V\", \"request\":\"%U\", \"query\":\"%q\", \"method\":\"%m\", \"status\":\"%>s\", \"userAgent\":\"%{User-agent}i\", \"referer\":\"%{Referer}i\" }" json_format
# 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..
![아파치 로그를 이용한 트래픽 확인방법](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdENixD%2FbtrPh89kGpy%2F86xLiq49bXkWaXfIYzQkbK%2Fimg.png)
일일 트래픽 계산 cat | grep '11/May' | awk '{sum = sum + $10} END {printf ("%f\n", sum/1073741824)}'
ssl인증서를 설치했더라도 http로 접속하면 80으로 접속가능하기때문에 http로 접속하더라도 ssl이 적용된 https로 접속하게 할려면 아래와 같이 apache설정을 해야합니다. Virutalhost설정안에 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} 설정 후 apache재시작을 해주세요. 주의 : rewrite_module이 설치되어 있는지 꼭 확인하세요.