Archive

Archive for the ‘Cpanel Server’ Category

Fixing Apache “No space left on device: Couldn’t create accept lock” errors

April 3rd, 2009 1 comment

Hello,

I was facing same error with one of my shared server last couple of week, apache was broke on server and getting following error in apache error logs file.

[emerg] (28)No space left on device: Couldn't create accept lock
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[notice] Digest: generating secret for digest authentication ...
[notice] Digest: done
[warn] pid file /etc/httpd/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[emerg] (28)No space left on device: Couldn't create accept lock

I checked disk space, or quota limit but everything was fine. I through it seem to apache semaphore problem

Apache can create the “accept lock” is with a semaphore. A semaphore is an inter-process communication tool that is used by Apache to communicate with it’s child processes. This error message may mean that Apache couldn’t create a new semaphore.

Check to see how many semaphores are currently in use. If Apache is running correctly, you should see something like this:

# ipcs -s

If Apache is stopped, and you still see these semaphores, then you can safely kill them by running this command for each semaphore id (in the second column)

$ ipcrm -s <semid>

To destroy all semaphores, you can run this from the command line (with “apache” being the apache-user:

for semid in `ipcs -s | grep apachec | cut -f2 -d" "`; do ipcrm -s $semid; done

OR

ipcs -s | grep apache | perl -e ‘while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}’

OR

ipcs -s | grep nobody | perl -e ‘while () { @a=split(/\s+/); print `ipcrm sem $a[1]`}’ ipcs -m | grep nobody | perl -e ‘while () { @a=split(/\s+/); print `ipcrm -m $a[1]`}’

OR

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

How to increase semaphore limit

To view the current parameters:

ipcs -l

To change these parameters, modify the file /etc/sysctl.conf and add the following lines:

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

Then load these settings with the command:

sysctl -p

Regards

StacyM

System Administrator

How do I enable/disable eAccelerator?

March 20th, 2009 1 comment

eAccelerator is used improve performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution.
If  eAccelerator is installed on serverwide then it is enable for all account or you can enable it eAccelerator by makeing  a .htaccess file in your ‘htdocs’ directory, and add the following lines:

php_flag eaccelerator.enable 1
php_flag eaccelerator.optimizer 1

if you’d like to turn off eAccelerator for a particular directory, put the following in a .htaccess file in that subdirectory:

php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

If php suexec is enabled on server then create php.ini file and following code in that file to disble eAccelerator.

eaccelerator.enable 0
eaccelerator.optimizer 0

Regards
Alex P
System Administrator

Categories: Cpanel Server Tags:

Install & compile Firebird InterBase database server with PHP on Linux Server ?

March 18th, 2009 1 comment

What is firebird

Firebird is an open source relational database offering many ANSI SQL-99 features that runs on Linux, Windows, and a variety of Unix platforms. Firebird offers excellent concurrency, high performance, powerful language support for stored procedures and triggers. It has been used in many production systems within a large number of commercial companies since 1981.

Steps to compile compile firebird module with php

  • Download the firebird module
 #cd /usr/src
 #wget http://nchc.dl.sourceforge.net/sourceforge/firebird/
       Firebird-2.0.3.12981-1.tar.bz2

  • Manually build and install the firebird module
#tar -jxf Firebird-2.0.3.12981-1.tar.bz2
#cd Firebird-2.0.3.12981-1
#mv Firebird-2.0.3.12981-1 firebird
#cd firebird
#./autogen.sh; make;make install

  • Rebuild PHP along with the firebird
–with-interbase=/usr/src/firebird’ option.

When installing is finished, open the php.ini configuration file (located in /usr/local/lib/), and check if these lines exist (uncomment/modify them if necessary):

magic_quotes_sybase = On ; Use Sybase-style magic quotes (escape ' with '' instead of ')
extension=php_interbase.so

magic_quotes_sybase = On;Use Sybase-style magic quotes (escape ' with '' instead of ')
extension=php_interbase.so

4) check php module using php -m command

Regards

Stacy

System Administrator.