Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using Apache 2.4 on my server. My scripts are using a lot of system() commands and they require to work in one process mode.

When I start apache using the command:

apachetctl -X

(which normally is debug mode, which works as single process if I'm not wrong), it works fine. However if I start Apache as system daemon it doesn't work anymore and gives some pretty bizarre results.

I commented the following line in httpd.conf

LoadModule mpm_event_module modules/mod_mpm_event.so

it didn't helped, then I uncommented it and gave it the following configuration in httpd-mpm.conf file:

<IfModule mpm_event_module>
    StartServers             1
    MinSpareThreads          1
    MaxSpareThreads          1
    ThreadsPerChild          1
    MaxRequestWorkers        1
    MaxConnectionsPerChild   0
</IfModule>

But it still won't work. In the /etc/httpd/modules/ directory I have also other modules related to threading and processes:

mod_mpm_event.so
mod_mpm_worker.so
mod_mpm_prefork.so

I read in docs that they are supposed to be precompiled in Apache, but when I call the command apachectl -l all I get is this:

# apachectl -l               
Compiled in modules:
  core.c
  mod_so.c
  http_core.c

So, my question is the following. How to configure Apache 2.4 in order it would work in the same mode as if it was started with the command apachectl -X. Thanks very much.

share|improve this question

migrated from serverfault.com Jul 15 at 21:52

This question came from our site for system and network administrators.

    
We do not consider RPi servers to be within the scope of Server Fault. The enthusiast nature of the device makes questions regarding them more appropriate for Super User, Unix & Linux or Raspberry Pi. –  Iain Jul 15 at 9:18
1  
But this problem is not hardware related. It will occur the same way on any other machine. The answer could be usefull for other people who are not using Pi, if I repost it on Raspberry Pi stack, they wouldn't find it. –  Marek Jul 15 at 9:21
    
I think it fits just fine. It's clearly hardware independent. An Apache configuration issue. Apache is Apache... –  i-CONICA Jul 15 at 9:24
    
We discussed this on meta meta.serverfault.com/questions/5586/…. We don't want SF flooded with RPi enthusiasts. @i-CONICA see that link too. –  Iain Jul 15 at 9:39
    
1. this is not RPi question, this is Apache 2.4 question. 2. I edited the post, I don't mention RPi anymore. 3. If you wish I can reproduce the problem on my home rack server which has nothing to do with Pi. And concerning your link, include Raspberry-Pis as a foundational element in the scenario, My PI is not a foundational element in this scenario, I did it on Pi, because it is portable and I can take it to the work in my pocket. –  Marek Jul 15 at 9:43

1 Answer 1

What was missing is ServerLimit definition. Once I added it it solved the issue. Now all system() commands work fine and I have exactly the same behavious as in debug mode.

<IfModule mpm_event_module>
    StartServers             1
    MinSpareThreads          1
    MaxSpareThreads          1
    ThreadsPerChild          1
    MaxRequestWorkers        1
    MaxConnectionsPerChild   0
    ServerLimit              1
</IfModule>
share|improve this answer

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.