No Space Left on Device

When you restarting the httpd services while the the server found high load, you might get these error.

ERROR: (28)No space left on device: mod_rewrite: could not create rewrite_log_lock

Why you will getting this error? The reason is the semaphore issue. What is semaphore? It is the process used to communicate between active process from Apache.

To check what is the semaphore used, you may use the command as below.

Continue reading No Space Left on Device

Redirect A Website with mod_rewrite

.htacess is very useful when you want to manage your website. It can be used to define the value that you want, block certain IPs, etc.

To redirect a website, you do not need to hard code from every single of your page, but you may use the .htaccess rewrite to get it done.

To redirect a domain name to www such as mickgenie.com to www.mickgenie.com

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mickgenie\.com$
RewriteRule ^(.*)$ http://www.mickgenie.com [R=301,L]

To redirect mickgenie.com and www.mickgenie.com to www.mickgenie.com

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mickgenie\.com$ [OR]
RewriteCond %{HTTP_HOST} ^mickgenie\.com$
RewriteRule ^(.*)$ http://www.mickgenie.com [R=301,L]