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

From apache2 doc:

The LockFile directive sets the path to the lockfile used when Apache is used with an AcceptMutex value of either fcntl or flock.

And about AcceptMutex

The AcceptMutex directives sets the method that Apache uses to serialize multiple children accepting requests on network sockets.

I am running apache 2.2 with mod_wsgi for a django website on an Ubuntu 64bit box.

what is it for? is this even ever used?

I can't find a file in the specified location.

My /usr/sbin/apache2 -V tells me:

-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE

which should mean that sysvsem is used. Does that mean that LockFile is not used?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

http://httpd.apache.org/docs/2.0/mod/mpm_common.html#lockfile says:

The LockFile directive sets the path to the lockfile used when Apache

is used with an AcceptMutex value of either fcntl or flock. This directive should normally be left at its default value. The main reason for changing it is if the logs directory is NFS mounted, since the lockfile must be stored on a local disk. The PID of the main server process is automatically appended to the filename.

Brief version: do not touch, unless the file would end up on an NFS-mounted files ystem.

If you do not find the file where you expect/set it to be, it may mean, that AcceptMutex isn't set to neither fcnl nor flock. This may be optimal or not, depending on your architecture, as documented here: http://httpd.apache.org/docs/2.0/misc/perf-tuning.html.

share|improve this answer
    
thank Pawel, the latter is what interests me the most :-) . I edited my question, it looks like my Ubuntu box is using sysvsem. Does that mean that LockFile is simply unused - and another mechanism for locking is used instead? –  Stefano Jun 6 '11 at 18:26
    
Yes, your system should use SysV-style semaphores, and in that case this file is not used. –  Paweł Brodacki Jun 7 '11 at 4:05
    
Thanks again. Reading about this on the apache perf tuning page I see it's a method that has several drawbacks. would you advise changing it? –  Stefano Jun 7 '11 at 10:05
    
I only have 1 port I listen to (but i sometimes experiment with multiple apache2 instances, which might be subject to another question). –  Stefano Jun 7 '11 at 10:31
    
You are welcome. I'm not an Apache expert, I will not tell you which method is best, because I don't know and don't want to mislead you. Looking at the different options described on the page, it looks that you could benefit from migrating off this one if you use CGI scripts. OTOH there is a warning that this section wasn't updated for Apache 2.x. My advice would be to seek a good source of information. :) –  Paweł Brodacki Jun 7 '11 at 11:12
show 1 more comment

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.