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.

I'm not sure why, but when I try to start the httpd service, it will not start.

Server config:

OS: CentOS 5.10
PHP: 5.5.7
Apache: 2.2.3

Here's how I found out what was going on:

$ sudo service httpd start
Starting httpd:                                            [  OK  ]
$ sudo service httpd status
httpd dead but subsys locked

So I removed the subsys file for httpd, and I tried again, but it failed again.

My process for adding fcgid was as follows:

  1. I built mod_fcgid from source, put it into the /etc/httpd/modules directory.

  2. I appended LoadModule fcgid_module modules/mod_fcgid.so to the list of modules

  3. I commented out LoadModule cgi_module modules/mod_cgi.so since I will not need it.

  4. I created a wrapper script for php and placed it into /var/www/cgi-bin:

  5. I created a handler for PHP that points to the wrapper.

  6. Then I try to start the httpd service

The following is the error that I get in /var/log/httpd/error_log:

[Mon Dec 16 12:18:26 2013] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0
[Mon Dec 16 12:18:26 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 16 12:18:26 2013] [notice] SSL FIPS mode disabled
[Mon Dec 16 12:18:26 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 16 12:18:26 2013] [notice] Digest: done
[Mon Dec 16 12:18:26 2013] [emerg] (17)File exists: mod_fcgid: Can't create shared memory for size 1200712 bytes

I see that it says "File exits", but I've search everywhere for any extra files with "fcgi" in the name, and I can't find anything.

I'm not sure if this is a permissions issue, or something with SELinux perhaps - or maybe suEXEC?

I would appreciate any guidance, since I'm not even sure where to start searching.


I tried again, and the error was slightly different this time:

[Mon Dec 16 12:50:23 2013] [emerg] (13)Permission denied: mod_fcgid: Can't create shared memory for size 1200712 bytes

I'm not sure which folder or file I need to change ownership of.


I set SELinux to permissive and it allowed the process to start without issue - but I do not want to leave SELinux as such. I'll ask another question of how to allow Apache, fcgid, and PHP to work together under SELinux.

share|improve this question

1 Answer 1

just to test SELinux part, try disabling it and see if that's the cause of your issue:

[alexus@XXXXXXXXXX ~]$ getenforce 
Enforcing
[alexus@XXXXXXXXXX ~]$ sudo setenforce 0
[alexus@XXXXXXXXXX ~]$ getenforce 
Permissive
[alexus@XXXXXXXXXX ~]$ 

also, are you running doing it as chroot by any chance? I've had similar issue back to FreeBSD days, but that was related to jail/chroot.

share|improve this answer
    
I just tested that right as you were placing your answer - it does seem to be an issue SELinux. Unfortunately, I have absolutely 0 knowledge of SELinux, so I'm not sure what to do at this point. Any direction? I'm using nearly a nearly default configuration, and I myself haven't specifically set anything to use chroot, so unless it's somehwere in the default configuration for RHEL's default Apache installation, I'm not. –  Zaemz Dec 16 '13 at 21:11
    
if you "absolutely 0 knowledge of SELinux" i'd probably suggest you to keep it Disabled or Pemissive mode, at least until you're more comfortable w/ it. –  alexus Dec 16 '13 at 21:37
    
I'm going to keep it on permissive until I discover how to correctly allow fcgi, php, and apache to work together while SELinux is enforcing its policy. –  Zaemz Dec 16 '13 at 23:06

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.