Browsed by
Tag: apache

Free Linux Server Backup Using Dropbox

Free Linux Server Backup Using Dropbox

I don’t need to tell you how important data backups are.  These days, several online backup services based on cloud computing are available for either free with some limited storage to a affordable monthly fee for unlimited storage.  Carbonite, Mozy, Blackblaze, and Dropbox are a few excellent examples.  There are advantages and disadvantages of these various services.  I use 3 out of the 4 mentioned, depending on the type of data, frequency of changes, , and how often I need to access them, etc.  For my VPS host at RapidVPS which runs on Ubuntu, I use Dropbox because Dropbox has a fairly decent support for Linux.

Here’s a pretty good instruction at Dropbox.  I didn’t follow the instruction exactly, but I’ve repeated the step enough times to know that it works for the most part.  I had some problems with my Python 2.6 installation after incrementally upgrading from 8.04 -> 8.10 -> 9.04 -> 9.10, but it’s all good now.  Anyway, on my VPS host, I set up several cron jobs to dump mysql databases and svn repos, rsync contents of some /var/www and tar-gzip contents of /etc, /root, and /var/log.  I don’t need to keep multiple versions of the backups because dropbox automatically takes care of incremental backup and versioning.  One thing to be aware, however, is that Dropbox doesn’t encrypt data, either in the transmission or storage, so you might want throw something like TrueCrypt or GnuPG in the mix.

Once backups are set-up with Dropbox, you can even subscribe to the backup/revision history RSS feed(s) provided by Dropbox to stay on top of the status.

Several other useful resources:

Apache’s MPM-prefork Leaking Memory

Apache’s MPM-prefork Leaking Memory

I’ve noticed in the last few weeks that my VPS host this site runs on has been running out of guaranteed physical memory.  This is the memory usage graph:

My VPS memory usage for 4/7/09 4/10/09
My VPS memory usage for 4/7/09 4/10/09

When this happens, many (but not all) of the sites served on this server stop responding to HTTP requests.  A simple ‘ps’ command shows anywhere around 8-15 “apache2” processes each having approximately 40-50MB footprint in the system memory.  Since I had not experienced this problem in the last 2 years prior to upgrading the apache2-mpm-prefork package on 3/17/09, I thought the mpm-prefork module might have something to do with this.

After reading Apache’s documentation on mpm-prefork and performance hints, I thought the mpm-worker module might work a bit better for my site.  My curiosity, however, told me to stick with mpm-prefork for the time being and change MaxClients parameter from 150 down to 10.

I have been monitoring the server to see how this affects memory usage and overall performance.  I have a feeling there is a bug in apache2-mpm-prefork 2.2.8-1ubuntu 0.5.  Feedbacks are welcome.

Here’s a link to an interesting article about tuning apache’s configuration file:
Apache Performance Tuning.

Using Apache’s Rewrite Engine to Redirect to HTTPS Site

Using Apache’s Rewrite Engine to Redirect to HTTPS Site

So you’ve installed on your Apache web server PHPMyAdmin, Bugzilla, WordPress, or any other sites that prompt the user for authentication info.  One thing about asking for authentication info on websites is that you have to be very careful about how the username and password are transmitted between the browser and the server.  Without HTTPS, they WILL be transmitted in clear text, open to all prying eyes along the way.

After enabling MOD_REWRITE, I added the following to the configuration file for my non-https site:

My "default" apache2 conf file:

RewriteEngine On
Options +FollowSymlinks
RewriteCond %{HTTPS} !=on
rewriteRule ^(.*)$ https://%{SERVER_NAME}/bugzilla/$1 [R,L]

Now when I go http://my-site/bugzilla, Apache will rewrite the URL to https://my-site/bugzilla.  Easy, aye?
Oh, by the way, this assumes that you have already configured your Apache to serve from port 443 with mod_ssl, of course.