How to change time zone for a domain using .htaccess

Open your .htaccess file and add the following line:
SetEnv TZ location

where location is the specific timezone you want to define.

A list of Supported Timezones can be found here:


Apache: No space left on device: Couldn’t create accept lock

Within the Apache error logs, this message was appearing over and over:

[emerg] (28)No space left on device: Couldn’t create accept lock

1. Check the disk space

2. Review filesystem quotas

3. Clear out the active semaphores

# ipcs -s

If you see a list of semaphores, Apache has not cleaned up after itself, and some semaphores are stuck. Clear them out with this command:

# for i in `ipcs -s | awk ‘/httpd/ {print $2}’`; do (ipcrm -s $i); done

Now, in almost all cases, Apache should start properly. If it doesn’t, you may just be completely out of available semaphores. You may want to increase your available semaphores, and you’ll need to tickle your kernel to do so. Add this to /etc/sysctl.conf:

kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024

And then run sysctl -p to pick up the new changes.

Logic behind AWS free usage tier

Let me explain about the AWS free usage tier.

EBS devices are block devices.

This means the service does not know how much data we actually store on them, it only knows how much storage space we have allocated.

So the result of df -h doesn’t matter. Actually we are only using 16GB of storage out of 30 GB.

The actual size of the volume is all that matters and that’s the basis for billing. This means it will calculate whole 30GB here.

Now, the free tier allows 30 gigabyte-months of EBS volume usage. You can use more than that, but this is the limit that’s provided for free. You’ll be billed for any more than this.

A gigabyte-month means 1 gigabyte of block storage space, allocated for 1 month, regardless of how you use it.

2 gigabytes of allocated storage for 15 days is 1 GB-month.

10 gigabytes of allocated storage for 3 days is 1 GB-month.

The free tier would allow

30 GB volume for 30 days

60 GB volume for 15 days or

900 GB volume for only 1 day.

To recapitulate ->

If we have a 30 GB volume for 26 days, then we have used 26 GB-months of storage, which is 86.7% of the free tier limit of 30 GB-months.

This is the logic that applies to all the services. Actually it is charged per-second basis now.

Posted in AWS