Ramblings from MostlyChris

Tech stuff and a bit more

Browsing Posts tagged Apache

mod_deflate allows apache to compress files and deliver them to browsers that can use compressed files. This saves on bandwidth and renders page loads faster. It's a fairly simple process to do this. You need to have write access to the apache config files and need to be able to create a new conf file. [...]

This is a super simple site redirect. This, of course, can get much more complicated than what is shown here. Place this in the apache configuration file (non-Plesk boxen) or in a .htaccess file. Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] —– If you want to redirect a site using the httpd.conf file inside [...]

Use this little one liner to grab the number of hits from the apache access logs. DATE=`date +%d.%b.%Y`':';for i in `lsof -p $(ps faxwwwu|awk '$1 ~ /^root$/ && $11 ~ /httpd$/ {print $2|"head -1"}' )| awk '$9 ~ /access_log$/ {print $9| "sort -u"}'`; do echo "——-"$i"——"$DATE;awk '$4 ~ /^.'$DATE'/ {hit[substr($4,2,2)"\t"substr($4,14,2)"."substr($4,17,1)]++;ip[$1]++} END { for (i in [...]