Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

So I run this command:

/etc/init.d/apache2 start

And it says:

* Starting web server apache2 [ OK ]

But! My website still doesn't pull up. And!

service --status-all
 [ - ]  apache2

Whaattt....? What's goin' on? ;(

[Sat May 01 14:45:18 2010] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat May 01 14:45:18 2010] [notice] Apache/2.2.11 (Ubuntu) PHP/5.3.2 configured -- resuming normal operations
[Sat May 01 14:45:18 2010] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread
[Sat May 01 14:45:18 2010] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread
[Sat May 01 14:45:20 2010] [alert] No active workers found... Apache is exiting!
share|improve this question
4  
logs, please! have a look at '/var/logs/apache2/error.log' or other files in the same directory. –  lajuette May 1 '10 at 20:51
    
Nothing, logs say nothing about it. –  Robert Ross May 1 '10 at 20:55
    
Just to make sure, are you running this as root or using sudo? ie not a normal user account –  David Rickman May 2 '10 at 4:12
    
Are you sure your installation is well done? Type dpkg --configure -a to make sure all files were configured properly. –  ℝaphink Aug 27 '10 at 9:23

3 Answers 3

On Linux, this is usually due to high ThreadsPerChild + high or unlimited ulimit -s.

On Linux, the default stack size for each thread is ulimit -s value or 8-10 megabytes -- Apache needs about 512 kilobytes of stack space or less under normal use.

This quickly overruns either 32-bit address space size with TPC near 200+, or if you have system memory limits you can run afoul of them as well.

Set ulimit -s 512 in your "envvars" file shipped alongside apachectl -- note that ThreadStackSize does not help here because that sets a minimum.

share|improve this answer

Is this a new Installation or was it previously stable and cannot start back up?

Insufficient memory could be the cause although a "(12)Cannot allocate memory: apr_thread_create: unable to create worker thread" should display if thats the case.

It's more likely that you are exceeding PTHREAD_THREADS_MAX setting within your OS. You could increase that, or lower ThreadsPerChild within Apache.

You are likely using the "Worker" distribution of Apache, the "prefork" may be more appropriate because it uses 1 thread per process, vs "worker" which uses many threads per process.

Sources:

share|improve this answer
    
Thanks! Switching to prefork solved this for me. –  Felix Frank Aug 7 '14 at 8:58

Take a look at the logs, especially the error_log. That should help. If it doesn't help, try to strace the apache2 command:

strace -f -o output.txt /etc/init.d/apache2 start

strace will trace the system calls (the -f flag orders strace to follow child processes as well and the -o flag writes the output to the file output.txt)

share|improve this answer
    
[Sat May 01 14:45:18 2010] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run? [Sat May 01 14:45:18 2010] [notice] Apache/2.2.11 (Ubuntu) PHP/5.3.2 configured -- resuming normal operations [Sat May 01 14:45:18 2010] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread [Sat May 01 14:45:18 2010] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread –  Robert Ross May 1 '10 at 21:48
    
what's the strace output? the last lines should be relevant... –  Marco Ramos May 1 '10 at 22:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.