November 2007 Archives

Rotating Rails Log Files

taken from: NullIsLove

One of the chores I dislike most is cleaning up and clearing out the log files in my Rails applications. On some of my higher profile sites, I get a lot of spiders probing my applications for security holes. They don’t succeed (knock on wood) but they do fill up my log files with errors.

I finally decided to get smart and get lazy (the two best traits a programmer can have), and I set up automatic log rotation on all of my Rails applications. The idea behind log rotation is simple: make a back up of the current log file, continue logging into a new or cleared log file, and discard log files that are older than a certain date.

Your webserver probably already rotates its own log files. For Apache, they are probably located in /etc/httpd/logs and they are probably rotated weekly. These logs store everything Apache does. Simple webserver stats and traffic analysis tools make use of these log files to show who visits a site when and what pages are viewed.

While it is possible to configure your Rails application to log to your Apache log files, I do not think it is a good practice. It’s much better to give each Rails application its own log file—it will be easier to find important Rails errors, it will keep your Apache logs cleaner and Rails is set up to keep its own logs by default. Fortunately, on a Linux server the built-in logrotate program will make the process super-easy. After the jump, I’ll walk you through the steps to get it set up.

Continue Reading…

Posted by Administrator on Nov 28, 2007 digg delicious technorati blinklist furl reddit

Network cloning a FreeBSD system

On this website I found the following tip:

Cloning a FreeBSD system

Simplifying by assuming a single partition, a secure network, and ucspi-tcp already installed on ORIG

Install fresh hard disk in CLONE, and boot from a FreeBSD rescue floppy.

Rather than installing, go to the “configure” submenu and do “fdisk” and “slice.” Use W Q instead of just Q to quit each one. Install a boot manager just as if you were building a new system.

Go back to the main menu and choose “fixit,” then “live filesystem on CD-ROM.”

Continue Reading…

Posted by Administrator on Nov 28, 2007 digg delicious technorati blinklist furl reddit