Nginx for Drupal and for Redis

Recently, I compiled nginx on CentOS 6 for a Drupal 7 installation and for a Redis installation. So, I thought that I would share my steps.

Whenever I compile nginx, I always use the nginx_syslog_patch to enable syslog logging. The only module that is required for Drupal 7 is nginx-upload-progress-module. Here is my configuration for Drupal 7.

First, I added two repositories to get the latest PHP binaries.
rpm -Uhv epel-release-6-8.noarch.rpm

Zend Framework 1.12.1 includes protection from cross-site request fogery

Recently, I upgraded from ZF 1.11.9 to 1.12.1, and I discovered that requests from a friendly MS IIS web server were not working. I am using ZF as an API backend and MS IIS as a friendly frontend. The problem was that ZF refused to honor the REDIRECT_URL and overrode REDIRECT_URL with HTTP_X_ORIGINAL_URL. The simple fix was to place the following code in the ZF bootstrap.


How to Allow Apache to connect to a remote database under SELinux

Set SELinux to allow remote connections for HTTP

setsebool -P httpd_can_network_connect=1

That's all there is to it.

Kernel tuning for the TCP stack

Below are some kernel tweaks that I use for CentOS 6.2 with a 10 GB NIC.

#Lower syn retry rates, default is 5
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 3

# Tune IPv6
net.ipv6.conf.default.router_solicitations = 0
net.ipv6.conf.default.accept_ra_rtr_pref = 0
net.ipv6.conf.default.accept_ra_pinfo = 0
net.ipv6.conf.default.accept_ra_defrtr = 0
net.ipv6.conf.default.autoconf = 0
net.ipv6.conf.default.dad_transmits = 0
net.ipv6.conf.default.max_addresses = 1

# Increase TCP max buffer size setable using setsockopt()
# default 4096 87380 4194304

How to use Pageant and Putty from Windows

Here is a terse HowTo for using putty to ssh into a remote server without using a password.

1. Download Putty installer from the Putty download page. Make sure to grab the windows “Installer”.
2. Install Putty
3. Start PuttyGen from Start -> Putty-> PuttyGen
4. Generate a new key and save it as a .ppk file without a passphrase
5. Use Putty to login to the server you want to connect to

Did you get caught by the Leap-second bug?

I happened to be one of the many thousands of systems engineers that got a call at 9:00 p.m. on Saturday, June 30. All of our linux servers with Java applications were under heavy load. Restarting the Java applications did nothing to reduce the system load. After several hours of troubleshooting, we finally decided to reboot the server. Much to my surprise, this fixed the problem.

Installing ZeroMQ with node.js

Recently, I installed zeromq with node.js and zeromq.node. I had some difficulties, so I thought that I would generate a brief how to.

ZeroMQ installed without much difficulty. On Ubuntu, install the following prerequisite.
apt-get install uuid-dev
On CentOS, install:
yum install libuuid-devel uuid-devel

Then, unpack the tarball and execute: configure, make
As the super user, execute: make install
This will install ZeroMQ in /usr/local/bin

Download and install the latest stable version of node.js. Just unpack the tarball and execute: configure, make

Resizing your root file system on Ubuntu with the logical volume manager (LVM)

I recently add some disk space to my root file system on a live, mounted file system using Ubuntu 10.10. I was using a virtual machine, so I changed the size of my disk drive in the virtual machine manager. Then, I logged into Ubuntu as root and executed the following commands.

Partitioned the new drive space with fdisk.
fdisk /dev/hda
In fdisk, "n" (new partition), "p" (primary), "3" (partition number), selected all remaining space on the drive, "t" change the type of partition to "8e" (LVM Volumn), "w" write the changes. I created a new partition on /dev/hda3.

MongoDB versus Riak Datastore: Some Benchmarks

I was doing some google searches, and I found some benchmarks of MongoDB and Riak.

Mr. Howe benchmarked MongoDB. He was able to get 1,750 GET requests per second from Mongo, when the keys could be stored in memory.

In contrast, the folks at Joyeur were able to get 6,650 GET requests per second on a five-node Riak cluster and 13,700 GET requests per second on a 10-node cluster. These are "highly optimized" Riak clusters, using the "protocol buffers" interface.

Upgrading the pear installer with pear

I recently tried to install the latest version of PHPUnit, and I ran into a bit of trouble. When I installed pear on SLE 10 (zypper install php5-pear), the installer version was too old to download and install PHPUnit. So, I had to upgrade the pear installer to the latest version before I could install PHPUnit. To do this, simply run 'pear upgrade pear' from the command line (or in a shell). After you do that, PHPUnit should install without problems.

To install PHPUnit will all dependencies, execute the following from the command line (or in a shell).

Syndicate content