Couple of questions

Hey, that’s weird, I ran rpm --import the http url i posted above, which didn’t output anything back so i thought it worked. Then installed the fcgid successfully, but now you posted that file contents i decided to check and it’s not even there. No file at all in /etc/pki/rpm-gpg hmm

well i guess it worked, but it’s strange. searched elsewhere couldn’t find it.

Ok, so i didn’t do much… I disabled loading mod_php in /etc/httpd/conf.d/php.conf

I noticed there was already a fcgid.conf which was setup correctly i don’t know if that file was already there or not but i didn’t need to change anything.

After restarting apache sites now no longer repond. (continuous loading indicator even minutes later)…

i also checked server templates > apache and couldn’t find the default php mode directive (to set fcgid)

This is the error in error_log:

[Tue Dec 16 10:53:34 2008] [notice] child pid 32237 exit signal Segmentation fault (11)

Here is the default fcgid.conf that i have:

This is the Apache server configuration file for providing FastCGI support

through mod_fcgid

Documentation is available at

LoadModule fcgid_module modules/

Use FastCGI to process .fcg .fcgi & .fpl scripts

Don’t do this if mod_fastcgi is present, as it will try to do the same thing

<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl

Sane place to put sockets and shared memory file

SocketPath run/mod_fcgid
SharememPath run/fcgid_shm

and php.conf

PHP is an HTML-embedded scripting language which attempts to make it

easy for developers to write dynamically generated webpages.

#LoadModule php5_module modules/

Cause the PHP interpreter to handle files with a .php extension.

AddHandler php5-script .php
AddType text/html .php

Add index.php to the list of files that will be served as directory


DirectoryIndex index.php

Uncomment the following line to allow PHP to pretty-print .phps

files as PHP source code:

#AddType application/x-httpd-php-source .phps

I’ve now added the fcgi-bin directory in the user home dir and added the .fcgi file, also added /etc/php5/php.ini to home dir… (copy of normal php.ini)

and added the directives to the vhost…

AddHandler fcgid-script .php5
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php

now i seem to get blank pages or source code

ok, in the thread about mod_fcgid there were apparently a copule of errors in the first few posts, i hadn’t read the whole thread :slight_smile: i fixed those now.

Now i get a message "forbidden" on all php pages.

php pages are set as the user.

Now I get blanks again…

<VirtualHost 69.65.xx.xx:80>
DocumentRoot /home/example/public_html
ErrorLog /home/example/logs/error_log
CustomLog /home/example/logs/access_log combined
AddHandler fcgid-script .php
FCGIWrapper /home/example/fcgi-bin/php5.fcgi .php
DirectoryIndex index.php index.html index.htm index.php4 index.php5
#php_admin_value open_basedir /home/example/:/tmp/
<Directory /home/example/public_html>
Options -Indexes IncludesNOEXEC SymLinksIfOwnerMatch
allow from all
AllowOverride All
RemoveHandler .php

ok, i ofcourse had to put those lines in <directory> after i did that we’re one step further. now i receive internal server errors but at least it’s getting to mod_fcgid

[Tue Dec 16 11:30:13 2008] [notice] mod_fcgid: process /home/example/public_html/index.php(3347) exit(server exited), terminated by calling exit(), return code: 255
[Tue Dec 16 11:30:19 2008] [notice] mod_fcgid: process /home/example/public_html/index.php(3354) exit(communication error), terminated by calling exit(), return code: 255

I also get this:

[Tue Dec 16 11:32:55 2008] [notice] mod_fcgid: call /home/example/public_html/wp-config.php with wrapper /home/example/fcgi-bin/php5.fcgi

which results in 503 service temporarily unavailable.

And also this: [Tue Dec 16 11:43:33 2008] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Tue Dec 16 11:43:33 2008] [error] [client 78.21.x.x] Premature end of script headers: wp-config.php

(this is in the home dir, the others are in /var/log/httpd/error_log)

I’ve also now updated my other packages; httpd, httpd_devel, mod_ssl to use virtualmin repos as the docroot for suexec was previously var/www, but this is now correctly pointed to /home

however, none of the errors are fixed by doing this (i don’t even have suexec enabled yet)

new errors are:

[Tue Dec 16 12:15:43 2008] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Tue Dec 16 12:15:43 2008] [error] [client 78.21.x.x] Premature end of script headers: wp-config.php

And another:

[Tue Dec 16 12:28:41 2008] [warn] mod_fcgid: can’t apply process slot for /home/example/public_html/index.php

Do you have any idea what could be wrong?

I have now also enabled suexec:

SuexecUserGroup example example

But now, every .php file i access returns a forbidden error, yet here is my home dir, seems to be set up ok?

drwxr-xr-x 2 example example 4.0K Dec 16 10:32 cgi-bin
drwxr-xr-x 3 example example 4.0K Dec 16 12:18 etc
drwxr-xr-x 2 example example 4.0K Dec 16 11:00 fcgi-bin
drwxr-xr-x 2 example example 4.0K Dec 7 14:42 homes
drwxr-x— 2 example example 4.0K Dec 14 04:02 logs
drwx------ 6 example example 4.0K Dec 15 11:18 mail
drwxr-x— 5 example example 4.0K Dec 16 10:38 public_html

Also, these are some errors from suexec.log:

[2008-12-16 13:22:45]: uid: (501/example) gid: (502/502) cmd: php5.fcgi
[2008-12-16 13:22:45]: file has no execute permission: (/home/example/fcgi-bin/php5.fcgi)

But these are old, I no longer get these errors… i did not add +x to the php5.fcgi, do i need to add this?

Btw, I installed webmin via RPM, did that not execute the I had already yum installed httpd etc beforehand.. But did not know that there was an

How far along are you in getting things running on your system? If you don’t have any Virtualmin virtual hosts setup yet, you probably do want to run Manual installation of a full-featured virtual hosting system is extremely intimidating, even for experienced administrators. It’s also very time consuming.

If you have already setup virtual hosts and the system is in production, then you’ll have to go the manual route.

First step would be installing the virtualmin-release package, so yum can install packages from our repository (you obviously can’t install packages from a repository that yum doesn’t know about, which is why “yum install mod_fcgid” doesn’t work for you!).

The CentOS 5 release package can be installed like this:

From there, you can install mod_fcgid, our httpd packages, etc.

i did not add +x to the php5.fcgi, do i need to add this?

Of course. You want it to execute, don’t you? :wink:

Also check to be sure the PHP paths in your php5.fcgi wrapper are correct for your system. The php-cgi binary is often called by different names on different distros. On CentOS, it’s just “php” I think, though maybe it’s also callable as php-cgi. I dunno. Obviously if you have the path wrong, it will not work.

i did not know there was an install script at the time because it is not mentioned on -- perhaps this should be added?

It actually is mentioned. Click "Install Script" on the Virtualmin page at It takes you to

The Webmin site is getting an overhaul as we speak, though, so there soon won’t be a separate Virtualmin page at–it’ll simply link to appropriate docs and information at

I already installed httpd, mod_fcgid, mod_ssl, httpd_devel from your release packages. I’ve added the +x to the fcgi file but I’m still getting the 403 forbidden error… (suexec i assume)

About reinstalling it, will that overwrite all config files? e.g. also for dovecot, etc? Really wish there was some kind of config check instead

About reinstalling it, will that overwrite all config files?

It will modify many config files. And, since this is a GPL installation, it won’t fix this particular problem (because mod_fcgid support is not part of GPL…it is being done outside of the control of Virtualmin, in this case).

What’s in your suexec_log when you make a request? And the error_log (both the system-wide one in /var/log/httpd and the one for the virtual server in /home/domainname/logs)?

Is suexec pointing to the right place for the docroot? You can make sure with:

/usr/sbin/suexec -V

It should have AP_DOC_ROOT set to “/home”. Since you’ve installed our httpd package, this should be true…but just to make sure.

Yes, suexec is configured correctly:

-D AP_DOC_ROOT="/home"
-D AP_HTTPD_USER="apache"
-D AP_LOG_EXEC="/var/log/httpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_USERDIR_SUFFIX="public_html"

I haven’t had any new entries in /var/log/httpd/error_log or /var/log/httpd/suexec.log or /home/example/logs/error_log since yesterday, only thing is in the access_log where it just says that status code 403 was returned.

78.21.xx.xx - - [17/Dec/2008:03:13:37 -0600] "GET / HTTP/1.1" 403 182 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_5; nl-nl) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1"