mkdir -p /usr/local/etc/nginx/sites-available
File locations:
nginx.conf
to/usr/local/etc/nginx/
default
anddefault-ssl
to/usr/local/etc/nginx/sites-available
#STOP APACHE
sudo apachectl stop
# get total requests by status code | |
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | |
# get top requesters by IP | |
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}' | |
# get top requesters by user agent | |
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | |
# get top requests by URL |
mkdir -p /usr/local/etc/nginx/sites-available
File locations:
nginx.conf
to /usr/local/etc/nginx/
default
and default-ssl
to /usr/local/etc/nginx/sites-available
#STOP APACHE
sudo apachectl stop