mod_geoip howto

wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
tar -zxf GeoIP-1.4.6.tar.gz
cd GeoIP-1.4.6
./configure
make
make install
cd ..
tar -zxf mod_geoip2_1.2.4.tar.gz
cd mod_geoip2-1.2.4/
apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c
vi /etc/httpd/conf/httpd.conf

GeoIPEnable On
GeoIPDBFile /usr/local/share/GeoIP.dat

scp imtiaz@netbrix.net:/home/imtiaz/src/GeoIP.dat /usr/local/share/

/etc/init.d/httpd stop
/etc/init.d/httpd start

vidEnable

Video Conversion script — Many formats to .flv

This is a script that converts your videos to flash video format, better known as flv, so as to be able to share them on the internet, just like on Youtube!

We have two different variants of this script, click the links below to try each one out:

We encourage you to try out all three scripts and let us know if you find something which you’d like integrated into your site.

We offer server setup for these and many other video share scripts. We also do script installs at $30 a pop. For a query about any script you need installed (besides the ones we develop) please feel free to use the Contact Form.

mails being rejected at aol or yahoo or gmail?

If you send mails using a webform using the php mail() function and your mails are being rejected by the destination servers here’s a small trick to fix the issue.

Usually this arises when your envelop does not carry a valid identifiable from header. So instead of using something like:

mail($to, $subject, $message, $headers);
Where you are not explicitly setting the sender address try something like this:
mail($to, $subject, $message, $headers,"-femail@domain");

This would set the correct from address in your mail envelop. Usually the address is picked up from php.ini on the server and if not mentioned it is set to the webuser@hostname

It’s a good practise to set the fifth field on your mail() function as it prevents confusion at the recipient end.

Squeaky clean virus free websites — on shared hosts

Hackers or script kiddies often end up defacing and hijacking your website. They can do this because you are not looking! Or not loking hard enough.

An antimalware/antivirus scan for linux would be a good thing as it would allow you to scan files on your server on a periodic basis(using cronjobs). Mostly backdoors are uploaded using upload forms that are made available for genuine users to upload stuff like pictures, attachments and other content. These forms, if badly written, or if there is no check for execution of code in the webroot can pretty much wipe out the server. So you need to be proactive and check your files as often as possible and clean them before things get out of hand.

Clamav is a good antivirus/malware scanner. Set it up to do your file watch job. Here’s the process to get it going on dreamhost.

  • svn co http://svn.clamav.net/svn/clamav-devel/trunk/
  • ./configure --prefix=$HOME --user=yourusername --group=yourgroupname
  • make & make install
  • edit /home/yourusername/etc/freshclam.conf and comment out the 4the line as instructed
  • edit /home/yourusername/etc/clamd.conf same edits as earlier for clamd
  • run freshclam and then clamdscan $HOME to find any backdoor or virus payload on your website.

Contact us if you need asistance with reclaiming your hacked website/server as well as other linux server admin requirements

keep your server clock ticking right

Time is money!
It’s important, from a lot of points of views besides security, ot keep the server time correct. The tool to use is ntpdate which syncs server time to a NTP server (Network Time Protocol)

Put this in your crontab if your server is in the NA vicinity
5 0 * * * /usr/sbin/ntpdate -u 0.north-america.pool.ntp.org

This will sync the clock to the NTP server at five past midnight.

For a complete list of which servers to use check here