Re: [Mod-fcgid-users] apache2-mpm-itk different php versions per user php.ini / mod_fcgid
No promises this will work as I am not a maintainer nor developer of mod_fcgid, but I have prepared a patch for you that should achieve the same effect. I'm not able to test compilation with mpm-itk (mainly because I'm not sure which package you're using), but it compiles cleanly without mpm-itk libraries installed. Go ahead and give it a shot, I guess; make sure you compile this against an apache where MPM_ITK is defined and hopefully it will do what you desire. Apply the patch from the mod_fcgid/modules/fcgid directory with patch -p1 mpm-itk_mod-fcgid.patch Josiah On Thu, Feb 21, 2013 at 7:45 AM, m...@unimx.de m...@unimx.de wrote: Hello Group, the problem using ITK+mod_fcgid is the fcgid socket. the socket is owned by wwwuser (wwwrun / www-data) of apache. ITK set vhost to user1, so fcgid says: Permission denied: mod_fcgid: can't lock process table in pid socket dir: srwx-- 1 wwwrun wwwrun 0 21. Feb 14:11 11585.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:12 2666.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:12 2666.1 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:17 3083.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:25 3938.0 The way using fcgi is, we have different php-versions and per user php.ini The way we use ITK is, we want to safe homedirs of all user not have to be readable by wwwrun (f.e. remember symlink problem) So we think, we must patch mod_fcgid (source http://httpd.apache.org/mod_fcgid/) May like modwsgi: http://code.google.com/p/modwsgi/issues/detail?id=187 if (!geteuid()) { +#if defined(MPM_ITK) +if (chown(process-socket, process-uid, -1) 0) { +#else if (chown(process-socket, ap_unixd_config.user_id, -1) 0) { +#endif ap_log_error(APLOG_MARK, WSGI_LOG_ALERT(errno), wsgi_server, mod_wsgi (pid=%d): Couldn't change owner of unix domain socket '%s'., getpid(), Thus, set UNIX listener socket to be owned by the same user as daemon process runs as. Any ideas how to PATCH mod_fcgid ? mpm-itk with mod_fcgid would be more than great :) OR: Any way to user mpm-itk and different php-versions / per user php.ini ? Thanks Martin -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users mpm-itk_mod-fcgid.patch Description: Binary data -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users
Re: [Mod-fcgid-users] apache2-mpm-itk different php versions per user php.ini / mod_fcgid
I'm sorry, I should have considered that an unprivileged user would be unable to change ownership of an existing socket created with a different uid. I'll have to consider further what additional changes might be necessary. Josiah On Feb 22, 2013 5:34 PM, m...@unimx.de wrote: Thanks, but it does not work: ** ** srwx-- 1 wwwrun wwwrun 0 23. Feb 02:26 10055.6 ** ** error_log: (13)Permission denied: mod_fcgid: can't lock process table in pid ** ** patch and compile without error ** ** greets martin ** ** *Von:* Josiah Purtlebaugh [mailto:josiah.purtleba...@gmail.com] *Gesendet:* Freitag, 22. Februar 2013 21:08 *An:* mod-fcgid-users@lists.sourceforge.net *Betreff:* Re: [Mod-fcgid-users] apache2-mpm-itk different php versions per user php.ini / mod_fcgid ** ** No promises this will work as I am not a maintainer nor developer of mod_fcgid, but I have prepared a patch for you that should achieve the same effect. I'm not able to test compilation with mpm-itk (mainly because I'm not sure which package you're using), but it compiles cleanly without mpm-itk libraries installed. ** ** Go ahead and give it a shot, I guess; make sure you compile this against an apache where MPM_ITK is defined and hopefully it will do what you desire. ** ** Apply the patch from the mod_fcgid/modules/fcgid directory with patch -p1 mpm-itk_mod-fcgid.patch ** ** Josiah ** ** On Thu, Feb 21, 2013 at 7:45 AM, m...@unimx.de m...@unimx.de wrote: Hello Group, the problem using ITK+mod_fcgid is the fcgid socket. the socket is owned by wwwuser (wwwrun / www-data) of apache. ITK set vhost to user1, so fcgid says: Permission denied: mod_fcgid: can't lock process table in pid socket dir: srwx-- 1 wwwrun wwwrun 0 21. Feb 14:11 11585.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:12 2666.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:12 2666.1 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:17 3083.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:25 3938.0 The way using fcgi is, we have different php-versions and per user php.ini The way we use ITK is, we want to safe homedirs of all user not have to be readable by wwwrun (f.e. remember symlink problem) So we think, we must patch mod_fcgid (source http://httpd.apache.org/mod_fcgid/) May like modwsgi: http://code.google.com/p/modwsgi/issues/detail?id=187 if (!geteuid()) { +#if defined(MPM_ITK) +if (chown(process-socket, process-uid, -1) 0) { +#else if (chown(process-socket, ap_unixd_config.user_id, -1) 0) { +#endif ap_log_error(APLOG_MARK, WSGI_LOG_ALERT(errno), wsgi_server, mod_wsgi (pid=%d): Couldn't change owner of unix domain socket '%s'., getpid(), Thus, set UNIX listener socket to be owned by the same user as daemon process runs as. Any ideas how to PATCH mod_fcgid ? mpm-itk with mod_fcgid would be more than great :) OR: Any way to user mpm-itk and different php-versions / per user php.ini ? Thanks Martin -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users ** ** -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users
Re: [Mod-fcgid-users] apache2-mpm-itk different php versions per user php.ini / mod_fcgid
Right. The Unix socket is already owned by wwwrun and the chown is being executed by a different uid, I think. We need to enforce not only the chown but also the creation of the socket. It will be in another function. Josiah On Feb 22, 2013 5:48 PM, m...@unimx.de wrote: We test: ** ** /* Correct the file owner */ ** ** if (!geteuid()) { ** ** ** ** //#if defined(MPM_ITK) //if (chown(unix_addr.sun_path, procnode-uid, -1) 0) { if (chown(unix_addr.sun_path, web589, -1) 0) { //#else //if (chown(unix_addr.sun_path, ap_unixd_config.user_id, -1) 0) { //#endif ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, mod_fcgid: couldn't change owner of unix domain socket %s, unix_addr.sun_path); close(unix_socket); return errno; } } ** ** But the same: ** ** srwx-- 1 wwwrun wwwrun 0 23. Feb 02:44 5690.2 ** ** (13)Permission denied: mod_fcgid: can't lock process table in pid ** ** ** ** *Von:* m...@unimx.de [mailto:m...@unimx.de] *Gesendet:* Samstag, 23. Februar 2013 02:33 *An:* mod-fcgid-users@lists.sourceforge.net *Betreff:* Re: [Mod-fcgid-users] apache2-mpm-itk different php versions per user php.ini / mod_fcgid ** ** Thanks, but it does not work: ** ** srwx-- 1 wwwrun wwwrun 0 23. Feb 02:26 10055.6 ** ** error_log: (13)Permission denied: mod_fcgid: can't lock process table in pid ** ** patch and compile without error ** ** greets martin ** ** *Von:* Josiah Purtlebaugh [mailto:josiah.purtleba...@gmail.comjosiah.purtleba...@gmail.com] *Gesendet:* Freitag, 22. Februar 2013 21:08 *An:* mod-fcgid-users@lists.sourceforge.net *Betreff:* Re: [Mod-fcgid-users] apache2-mpm-itk different php versions per user php.ini / mod_fcgid ** ** No promises this will work as I am not a maintainer nor developer of mod_fcgid, but I have prepared a patch for you that should achieve the same effect. I'm not able to test compilation with mpm-itk (mainly because I'm not sure which package you're using), but it compiles cleanly without mpm-itk libraries installed. ** ** Go ahead and give it a shot, I guess; make sure you compile this against an apache where MPM_ITK is defined and hopefully it will do what you desire. ** ** Apply the patch from the mod_fcgid/modules/fcgid directory with patch -p1 mpm-itk_mod-fcgid.patch ** ** Josiah ** ** On Thu, Feb 21, 2013 at 7:45 AM, m...@unimx.de m...@unimx.de wrote: Hello Group, the problem using ITK+mod_fcgid is the fcgid socket. the socket is owned by wwwuser (wwwrun / www-data) of apache. ITK set vhost to user1, so fcgid says: Permission denied: mod_fcgid: can't lock process table in pid socket dir: srwx-- 1 wwwrun wwwrun 0 21. Feb 14:11 11585.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:12 2666.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:12 2666.1 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:17 3083.0 srwx-- 1 wwwrun wwwrun 0 21. Feb 13:25 3938.0 The way using fcgi is, we have different php-versions and per user php.ini The way we use ITK is, we want to safe homedirs of all user not have to be readable by wwwrun (f.e. remember symlink problem) So we think, we must patch mod_fcgid (source http://httpd.apache.org/mod_fcgid/) May like modwsgi: http://code.google.com/p/modwsgi/issues/detail?id=187 if (!geteuid()) { +#if defined(MPM_ITK) +if (chown(process-socket, process-uid, -1) 0) { +#else if (chown(process-socket, ap_unixd_config.user_id, -1) 0) { +#endif ap_log_error(APLOG_MARK, WSGI_LOG_ALERT(errno), wsgi_server, mod_wsgi (pid=%d): Couldn't change owner of unix domain socket '%s'., getpid(), Thus, set UNIX listener socket to be owned by the same user as daemon process runs as. Any ideas how to PATCH mod_fcgid ? mpm-itk with mod_fcgid would be more than great :) OR: Any way to user mpm-itk and different php-versions / per user php.ini ? Thanks Martin -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users ** ** -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb
Re: [Mod-fcgid-users] [newbie] Delay after editing script?
Hello Gilles, Are you familiar with how mod_fcgid executes scripts? Basically, the executable is run and stays in memory so that it can serve any future requests without forking additional processes per request. Once the process reaches the timeout defined in the mod_fcgid configuration (or the max number of requests) the process will die and a new process will be created by the next request. Unfortunately, without access to the mod_fcgid configuration you are at the mercy of the timeout or max requests variables defined by the administrator. That is why it appears to take so long for your scripts to update. Sorry for the bad news but I hope this helps. Josiah Purtlebaugh On Fri, Sep 28, 2012 at 4:38 PM, Gilles codecompl...@free.fr wrote: Hello I'm only getting started with FCGI to run Python web applications. On a shared host with Apache + mod_fcgid + the Flup FastCGI server that takes care of translating between FastCGI and WSGI, I noticed that there's a several minute delay between when I edit a script and when the change shows up in a browser. I read the docs (http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html), but didn't find a directive that would explain this. But anyway, on a shared host, is there a way to reduce this delay, or is it off-limit to non-root users? Thank you. -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users
Re: [Mod-fcgid-users] Fwd: mod_fcgid with php CGI hangs on interrupted downloads
Liam, Someone else commented that you should increase the value of your IPCCommTimeout setting; I'd recommend this as well, though I have to ask, as these uploads taking multiple minutes to complete or do they hang fairly quickly? Josiah Purtlebaugh josiah.purtleba...@gmail.com +1 253 797 4233 On Feb 22, 2011, at 6:03 AM, Liam O'Boyle wrote: Hi Josiah, There was a strace snippet in the linked serverfault page, as follows root@some-machine:~# strace -p 24837 Process 24837 attached - interrupt to quit write(3, \5|A\313%\35\337\376\275\237\230\266\242\371\37YjzD\322\215\357\336:M\362P\335\242\214\341..., 17432 Just hanging on that, or something like it, each time. I assume this is blocking trying to write back to the fcgid handler. Thanks, Liam On Tue, Feb 22, 2011 at 12:12 PM, Josiah Purtlebaugh josiah.purtleba...@gmail.com wrote: I don't have any solutions for you, but I'd recommend trying to discover where or why it's hanging. The tool 'strace' would be most useful in figuring this out. The ideas that come to mind off the top of my head are problems with file size, the memory of the child processes, or something like that. A dump of the php-cgi process might lead to you figuring out the true issue, though. Josiah Purtlebaugh josiah.purtleba...@gmail.com +1 253 797 4233 On Feb 21, 2011, at 4:12 PM, Liam O'Boyle wrote: Morning, I still haven't had any luck addressing this problem; I'm posting this in the hope that someone has some sort of idea, otherwise I will have to scrap mod_fcgid and revert to mod_php this evening, as this is causing considerable problems for our users. Thanks for any assistance, Liam -- Forwarded message -- From: Liam O'Boyle l...@elyobo.net Date: Tue, Feb 8, 2011 at 4:46 PM Subject: mod_fcgid with php CGI hangs on interrupted downloads To: mod-fcgid-users@lists.sourceforge.net Hi there, I'm having an issue with downloads through PHP when using mod_fcgid; if the download is interrupted before it's complete, the php-cgi process seems to block until the execution timeout is reached, rather than aborting immediately. Further requests to the server by the same user that interrupted the download hang until the process aborts and the php-cgi process starts serving more requests, but requests by other users do not appear to be affected. It doesn't appear to be a PHP problem, as the same code, when run using mod_php, executes correctly. Does anyone have any suggestions that I could look into to fix this? A full explanation is up on ServerFault - http://serverfault.com/questions/226464/php-fcgid-hangs-if-download-interrupted Thanks for any help, Liam -- Index, Search Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users -- Index, Search Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users -- Index, Search Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk
Re: [Mod-fcgid-users] Fwd: mod_fcgid with php CGI hangs on interrupted downloads
I don't have any solutions for you, but I'd recommend trying to discover where or why it's hanging. The tool 'strace' would be most useful in figuring this out. The ideas that come to mind off the top of my head are problems with file size, the memory of the child processes, or something like that. A dump of the php-cgi process might lead to you figuring out the true issue, though. Josiah Purtlebaugh josiah.purtleba...@gmail.com +1 253 797 4233 On Feb 21, 2011, at 4:12 PM, Liam O'Boyle wrote: Morning, I still haven't had any luck addressing this problem; I'm posting this in the hope that someone has some sort of idea, otherwise I will have to scrap mod_fcgid and revert to mod_php this evening, as this is causing considerable problems for our users. Thanks for any assistance, Liam -- Forwarded message -- From: Liam O'Boyle l...@elyobo.net Date: Tue, Feb 8, 2011 at 4:46 PM Subject: mod_fcgid with php CGI hangs on interrupted downloads To: mod-fcgid-users@lists.sourceforge.net Hi there, I'm having an issue with downloads through PHP when using mod_fcgid; if the download is interrupted before it's complete, the php-cgi process seems to block until the execution timeout is reached, rather than aborting immediately. Further requests to the server by the same user that interrupted the download hang until the process aborts and the php-cgi process starts serving more requests, but requests by other users do not appear to be affected. It doesn't appear to be a PHP problem, as the same code, when run using mod_php, executes correctly. Does anyone have any suggestions that I could look into to fix this? A full explanation is up on ServerFault - http://serverfault.com/questions/226464/php-fcgid-hangs-if-download-interrupted Thanks for any help, Liam -- Index, Search Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users -- Index, Search Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev ___ Mod-fcgid-users mailing list Mod-fcgid-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users