Apache use fcgid instead of module

Hi, i’m trying to set fcgid use to a virtual server instead of the regular mod_php, i’ve set in website options “PHP script execution mode” as “FCGId”, it creates the files, the config, but in phpinfo i still read that’s run as apache module.

Any help? I’ve also tried to reload/restart apache…

virtualhost settings is:

<VirtualHost 95.169.188.197:80>
SuexecUserGroup “#1000” “#1000
ServerName alexnetwork.it
ServerAlias www.alexnetwork.it
ServerAlias webmail.alexnetwork.it
ServerAlias admin.alexnetwork.it
DocumentRoot /home/alexnetwork/public_html
ErrorLog /var/log/virtualmin/alexnetwork.it_error_log
CustomLog /var/log/virtualmin/alexnetwork.it_access_log combined
ScriptAlias /cgi-bin/ /home/alexnetwork/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory “/home/alexnetwork/public_html”>
Options -Indexes +IncludesNOEXEC +FollowSymLinks +ExecCGI
allow from all
AllowOverride All
php_admin_flag safe_mode on
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/alexnetwork/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/alexnetwork/fcgi-bin/php5.fcgi .php5

<Directory /home/alexnetwork/cgi-bin>
allow from all

RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.alexnetwork.it
RewriteRule ^(.) https://alexnetwork.it:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.alexnetwork.it
RewriteRule ^(.
) https://alexnetwork.it:10000/ [R]
RedirectMatch /cgi-bin/mailman/([^/.])(.cgi)?(.) https://alexnetwork.it:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/.])(.cgi)?(.) https://alexnetwork.it:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
Alias /pipermail /var/lib/mailman/archives/public
RemoveHandler .php
RemoveHandler .php5
IPCCommTimeout 31

Howdy,

Does it by chance work if you switch to CGI rather than FCGID?

Also, just to verify, the place to switch that is in Server Configuration -> Website Options -> PHP script execution mode.

-Eric

Thanks for the reply, yes i’ve set it in “Server Configuration -> Website Options -> PHP script execution mode”, also using CGI mode doesn’t work. I had to remove the mod_php5 module in apache.
It seems that you can’t use module or fcgid for each virtualhost.

Hi Guys

I am also running testing on a new ubuntu 10.04 server fresh install. I too am having this problem. I have created 3 virtual servers. 2 are top level servers and one is a sub-server. The problem I am having is only with the sub-server. The Server Configuration> Website Options> PHP script execution mode> is set to “FCGId (run as virtual server owner)” this was set by virtualmin when I created the Virtual server and is what I want. However the php scripts running on the sub-server are running as www-data.

Howdy,

Some folks have mentioned recently that simply having mod_php installed and enabled in Apache causes it to supersede any cgi/fcgid setup.

So, in order to use cgi or fcgid, you may need to explicitly disable mod_php from Apache.

-Eric

I’ve reached the same conclusion too. That’s what i’ve done to get it working… :slight_smile:

Also for me it would be nice to don’t put the fcgi wrapper inside the home dir, cause user can change it every time he wants and so he can run system commands inside of it. Right?

Howdy,

The fcgi wrappers should be setup with the “immutable” attribute. That a filesystem attribute that prevents any modification to the file until that attribute is removed. And only the root user can remove it.

With that in mind, it shouldn’t be possible for a user to modify or delete the fcgi wrapper files.

-Eric

Hi Eric
I want to run this past you before I report it to jamie. I think I have narrowed down the problem I am having with FCGId.

Explanation
Goto Virtualmin> System Settings> Server Templates> Default Settings For Sub-Servers> form “Edit template section:” select “Apache website”. The first option is “Directives and settings for new websites” with two radio button choices “From default settings” and “Apache directives below …”. The radio button next to “From default settings” is selected and most of the page is greyed out. Which I assumed meant that the information on the Sub-Servers Apache website page was replaced with the information from Apache website default template settings page.

My first question is, is that assumption supposed to be correct?

Because what happens is the Sub-Server is being created with the information that has been greyed out on the Sub-Servers Apache website page.

Is that the behaviour you would expect?