Apache modes

12 posts / 0 new
Last post
#1 Fri, 07/09/2010 - 11:20
Owdy

Apache modes

PHP script execution mode Apache mod_php (run as Apache's user) CGI wrapper (run as virtual server owner) FCGId (run as virtual server owner)

Whats difference between those? Why FCGId is default?

Fri, 07/09/2010 - 11:24
andreychek

FCGID and CGI each come with the security advantage of running all scripts as the domain owner's userid, rather than that of the Apache user. That's a big security win.

FCGID also happens to have the benefit of caching scripts in memory, offering performance similar to mod_php.

FCGID is used as the default because it offers a blend of both improved security and good speed.

-Eric

Fri, 07/09/2010 - 12:27
Owdy

Ok, thanks. I have to try it :) Do i need to do anything else than change that setting from "Website Options"?

Fri, 07/09/2010 - 14:32
ronald
ronald's picture

nothing more would be required

Sun, 07/11/2010 - 14:14
Owdy

Is it safe to use APC accelator with FCGID?

Sun, 07/11/2010 - 19:47
shinji

Yes but it's effectiveness is questionable. In benchmarking it showed a marked improvement (66% drop with APC) but I don't know how it would perform in real world conditions. I personally had installed eAccelerator since it can also do a proper file cache.

Mon, 09/20/2010 - 05:10
jmunjr

I have installed eaccelerator and xcache on my migrated server but neither appear to work. I am using the "CGI wrapper" php execution mode on my server because for some reason FCGId does not work(my sites were originally created using Virtualmin GPL in 2007 and migration to the new version didn't work 100%).

Should caching apps like eaccelerator and xcache with with CGI-wrapper?

If not, is FCGId the preferred execution mode? If so, what do I need to do to make my sites work in FCGId ?

Thanks

Mon, 09/20/2010 - 09:46 (Reply to #7)
andreychek

Yeah, I suspect those caching apps should work just fine using the CGI wrapper.

-Eric

Wed, 09/29/2010 - 03:29 (Reply to #8)
jmunjr

Nope only in mod_php, or at least not in PHP-CGI or FCGId since the latter two run php scripts in their own process separately...something like that.

I managed to manually edit httpd.conf to get my sites to run under mod_php and now eAccelerator runs properly.

Mon, 09/20/2010 - 10:22
groadin

I have a problem with this feature. I just installed new version of virtualmin GPL on a new machine, and tried to restore previously backed up virtual server from previous machine. Earlier I had fcgid configured manually as posted on forums and it worked. But as now it can be easily set in Virtualmin, I wanted to use this feature. Unfortunately apache runs as www-data and not as domain owner, despite the fact that FCGID is chosen. What should I check?

Mon, 09/20/2010 - 11:10
andreychek

You can enable whether suexec is used for new Virtual Servers in System Settings -> Server Templates -> Default -> Apache Website.

For existing sites, I'm not aware of a way to do that in the Virtualmin GUI, but it can be done from the command line using:

virtualmin modify-web --domain DOMAIN --suexec

Tue, 09/21/2010 - 09:05
groadin

I can only find the "Automatically add appropriate SuExec directive" option and it is set to Yes. Also the command didn't help.

I also created new virtual server (not restored) and put simple PHP file, and unfortunately there was no process spawned under proper owner (only www-data). So this is not related to my old backups probably. What can I do / check more?

[EDIT] Finally found out what's wrong - I had php5 module active in apache, so disabling it (a2dismod php5) helped. Same problem as here: http://www.virtualmin.com/node/15168

Topic locked