August 2015

Solution to NGINX upstream servers HTTP keepalive enabled serving wrong URL and content

With HTTP keepalive enabled in NGINX upstream servers reduces latency thus improves performance and it reduces the possibility that the NGINX runs out of ephemeral ports. Following the suggestion given by NGINX doc that the proxy_http_version directive should be set to "1.1" and the "Connection" header field should be cleared:

Get Drush to run Drupal cron regularly using crontab

Drush can Drupal cron without the need of accessing http://www.yoursite.com/cron.php?cron_key=<key>. This means we can safely remove or redirect cron.php to 404 Not Found in our .htaccess:

  
RewriteRule cron.php / [R=404,L]
  

To make our crontab script simple, we will use Drush's site aliases. Example if we are running multiple sites in our server: yoursite1.com, yoursite2.com and yoursite3.com we can assign alias @site1, @site2 and @site3 respectively. To do this:

Tags

How to fix inaccessible flash drive identified by computer as "USB Disk 30X USB Device"

Having a bootable Linux on flash drive is very handly tool for a web developer. When I was about to create one, my TDK 16GB flash drive becomes inaccessible in my Windows 7 file explorer. The Windows explorer detected it and shows "Removable drive (H:)". When I clicked the drive, it prompted me to insert a disk in Drive H: as if it were acting as a CD or DVD drive. I checked it on my "Device Manager" and found my flash drive registered as "USB Disk 30X USB Device". I tried some known fix: uninstalled/re-installed the drive's device driver, re-assigned new Drive letter and nothing worked.

Setup Rock Mongo web interface

I was looking for a admin web interface for mongoDB just like PHPMyAdmin for My SQL and found RockMongo a good one. In this article will show how to setup RockMongo using the authentication created in your mongoDB service. Please checkout this article Setup Drupal 7 Panopoly distribution with mongoDB on CentOS 7 if you haven't setup your mongoDB service and its PHP driver in your server.