Apache is not starting – semget: No space left on device

If Apache is not starting with the following log: [emerg] (28)No space left on device: Couldn’t create accept lock (/usr/local/apache/logs/accept.lock.18895) (5) OR semget: No space left on device It’s because the sempahore arrays in system memory is full. Check if there’re any processes in semaphore that are owned nobody in semaphores (or the user which apache is being run): # ipcs...

December 31st, 2009 by Akhthar Parvez 

disable mod_security for a domain

It’s not recommended to disable mod_security for a domain. Most of the times, there should be some other workaround rather than disabling mod_security entirely. This post is for those who know disabling mod_security is the only option and it’s always better to disable it for a particular user rather than doing it server wide. If you want to disable mod_security2 for a particular domain...

December 25th, 2009 by Akhthar Parvez 

mkinitrd failed with error No module dm-mem-cache found for kernel

You might get the following error while running the mkinitrd command to install a new kernel on CentOS 5 (RHEL5) : No module dm-mem-cache found for kernel 2.6.18-92.1.13.el5, aborting. This is because the system tries to include the dm-mem-cache module in the generated initial ramdisk images eventhough your system might not have dmraid. So while creating a initial ramdisk images for kernels that do...

December 25th, 2009 by Akhthar Parvez 

PHP Fatal error: Allowed memory size exhausted

If you get the following error while running a PHP script Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in /home/abc/www/modules/project/mail.inc on line 243 It’s because the particular limit has exceeded the memory usage limit set in PHP configuration file. You can fix the issue by increasing the memory limit, if needed, by modifying the paramter...

December 22nd, 2009 by Akhthar Parvez 

WHM transfer not fetching accounts

If the WHM is not fetching any accounts on the remote server while Copying multiple accounts/packages from another server, it’s mostly to do with the Perl modules on the remote server. You may get the following message eventhough the packages do exist on the remote server: There are no packages that can be copied from the remote server. FIX: Goto the remote server and run the following script: #...

December 22nd, 2009 by Akhthar Parvez 

PHP CGI T_STRING error

PHP-CGI not working If you get the following error while accessing the PHP page, which is running as CGI: (ASCII=21) state=1 in /usr/local/cpanel/cgi-sys/php4 on line 382 Warning: Unexpected character in input: ‘ in /usr/local/cpanel/cgi-sys/php4 on line 382 Parse error: syntax error, unexpected T_STRING in /usr/local/cpanel/cgi-sys/php4 on line 382 FIX: Set the following under “Paths...

December 22nd, 2009 by Akhthar Parvez 

Password-less access for ssh

Do you want to setup password-less access to a remote server? Well, you can get this done quite easily. However, bear in mind that it’s highly insecure setting up password-less authentication, especially for the root user. But sometimes, you would need it. Make sure you’ve security systems in place such as TCP wrappers to make it safe. So here’re the steps to accomplish a password-less...

December 6th, 2009 by Akhthar Parvez 

Password protect a directory using htaccess

This’s how you can setup password protection using .htaccess: Goto the directory that you want to be protected and create an .htaccess file there with the following contents: AuthType Basic AuthName “Attendance” AuthUserFile /home/school/.htpass/attend Require valid-user Note: Make sure that you place the AuthUserFile outside your document root to make it secure. Then create a password...

December 5th, 2009 by Akhthar Parvez 

Courier to Dovecot migration

You can switch the IMAP program from courier to dovecot on a cPanel by using the following steps. # nohup /scripts/setupmailserver dovecot & Note: nohup command is used to run a task with saving the ouput into the file nohup.out instead of standard output. The above cPanel script will install dovecot and disable courier from the system. It will also convert all maildirs into dovecot format. If...

October 10th, 2009 by Akhthar Parvez 

Apache glibc detected error due to Zend

If you notice the following error in apache error log after installing/upgrading Zend: *** glibc detected *** free(): invalid pointer: 0x08b83400 *** It’s a known bug with Zend Optimizer <=3.0 version. You can get it fixed by upgrading Zend to 3.0.1 # wget http://downloads.zend.com/optimizer/3.0.1/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz # tar -zxvf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz #...

October 10th, 2009 by Akhthar Parvez