spx2
12-26-2007, 05:01 AM
getting a report with all the ip's and date of access from
apache's log
spx2@firepower:~/server_scripts$ pwd
/home/spx2/server_scripts
spx2@firepower:~/server_scripts$ cat ips_connected_to_apache.sh
cat /var/log/apache2/access.log | perl -ne '@a = $_=~/(^.*?) - - \[(.*?)\]/;print "@a\n"' | sort | uniq > /tmp/ips_access.txt
spx2@firepower:~/server_scripts$ cat report_ip_access.sh
konsole -e sh -c "/home/spx2/server_scripts/ips_connected_to_apache.sh;vim /tmp/ips_access.txt"
spx2@firepower:~/server_scripts$
apache's log
spx2@firepower:~/server_scripts$ pwd
/home/spx2/server_scripts
spx2@firepower:~/server_scripts$ cat ips_connected_to_apache.sh
cat /var/log/apache2/access.log | perl -ne '@a = $_=~/(^.*?) - - \[(.*?)\]/;print "@a\n"' | sort | uniq > /tmp/ips_access.txt
spx2@firepower:~/server_scripts$ cat report_ip_access.sh
konsole -e sh -c "/home/spx2/server_scripts/ips_connected_to_apache.sh;vim /tmp/ips_access.txt"
spx2@firepower:~/server_scripts$