It will work but your log file will be in a different location. You just need to cd to the right directory then you can go from grep command. From memory give this a try
cd /var/log/apache2
grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' access.log > ips.txt