Re: (no subject)
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers
I have the following requirements which I am struggling to meet:
1) Use UNIX domain sockets (named pipes) to communicate (they are on the same box)
2) Have a single instance of both lighttpd and myApp running
3) Have multiple simultaneous requests forwarded from Lighttpd at a time
I have a robust setup which uses TCP connections and works very well. This uses the FCGX API to allow myApp to receive multiple requests simultaneously. All I am trying to do is port this from using tcp connections to using named pipes. But I have as yet failed to make this work.
I have now reverted to a simple test app which I have included below along with my Lighttpd config snipet.
I have set the ownership of everything in a ten mile radius to ‘lighttpd’
I would be very grateful for any help or suggestions as to what might be going wrong.
Best Regards
Howard May
P.S. Konstantin, I have BCCed you explicitly as you had previously offered assistance in this area (back in 2009!)
fastcgi.server = ( "/namedpipetest/" =>
(
(
"socket" => "/var/tmp/lighttpd/wsi-fastcgi.socket",
"check-local" => "disable"
)
)
)
#include <stdio.h>
#include "fcgiapp.h"
void main(int argc, char ** argv)
{
int fd;
int result;
FCGX_Request req;
printf("Fastcgi FIFO test app\n");
result = FCGX_Init();
if(result != 0)
{
printf("FCGX_Init returned %d\n", result);
return;
}
fd = FCGX_OpenSocket("/var/tmp/lighttpd/wsi-fastcgi.socket", 16);
if(fd == 0)
{
printf("FCGX_OpenSocket returned 0\n");
return;
}
FCGX_InitRequest(&req, fd, 0);
while((result = FCGX_Accept_r(&req))==0);
{
FCGX_FPrintF(req.out, "Content-type: text/html\r\n\r\n<TITLE>Whoop</TITLE>\n");
}
printf("FCGX_Accept_r returned %d\n", result);
return;
}
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers
My question is: Is it possible to detect this using FCGX_GetError() on the output stream right before calling FCGX_Finish_r() ? If not, how might I trap such a condition.
Cheers._______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers
Folks, I think the mailing lists and archives are all fixed up now. I also opened the archives up so they can be Google-searched (thanks to the person who pointed that out). The wiki and web site will be migrating shortly as well as soon as I get a chance to finish setting up and securing httpd and the Drupal stuff. http://mailman.fastcgi.com Should be the right URL (and properly propagate now as well). Cheers, David.
Hi there,
PHP: 5.3.3
Apache: 2.2.17
mod_fastcgi: 2.4.6
I'm trying out FastCGI for the first time, so please forgive my ignorance.
Basically, I'm trying to use FastCGI to run PHP scripts as the UID/owner of
the script itself, not the default apache 'nobody'/etc.
I must be missing a few things because I'm running into a few problems and
would appreciate *any* pointers.
Here's my apache config for a virtual host:
<VirtualHost ...>
<IfModule mod_fastcgi.c>
FastCgiServer /www/virtual/abc.com/cgi-bin/php
AddHandler php-fastcgi .php
SetHandler fastcgi-script
Action php-fastcgi /cgi-bin/php
AddType application/x-httpd-php .php
<Directory /www/virtual/abc.com/htdocs>
Options +ExecCGI
</Directory>
</IfModule>
php_flag engine off
Options +IncludesNOEXEC -Indexes +FollowSymLinks
ServerAdmin webmaster@...
DocumentRoot /www/virtual/abc.com/htdocs/index.html # or without index.html
php_admin_value open_basedir /www/virtual/abc.com/htdocs:/tmp
php_admin_value display_errors on
ServerName www.abc.com
ServerAlias abc.com
ErrorLog /www/virtual/abc.com/logs/error_log
TransferLog /www/virtual/abc.com/logs/access_log
ScriptAlias /cgi-bin/ /www/virtual/abc.com/cgi-bin/
</VirtualHost>
/cgi-bin/php file:
------------------
#!/bin/sh
PHPRC="/usr/local/php5/lib"
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
exec /usr/local/php5/bin/php
/cgi-bin/php is +x (executable) owned by root.
Test PHP script: /htdocs/1.php is owned by UID/GID 20964:2374 (ie, not the
apache user). Perms are 775 (-rwxrwxr-x).
If I browse to abc.com/1.php it hangs for 30s, producing this error in the logs:
FastCGI: comm with (dynamic) server "/www/virtual/abc.com/htdocs/1.php"
aborted: (first read) idle timeout (30 sec)
FastCGI: incomplete headers (0 bytes) received from server
"/www/virtual/abc.com/htdocs/1.php"
It's almost as if /cgi-bin/php is not being fed the 1.php file and it's
waiting for input from stdin (which is what the php CLI binary does if you run
it without args). It then times out waiting for input, producing the error
above.
I've configured/compiled PHP 5.3.3 with/without '--with-fastcgi' (even though
./configure --help does not show --with-fastcgi as being available).
I used 'top_dir = /.../apache/httpd-2.2.17' in the Makefile for
mod_fastcgi-2.4.6. Your site talks about a php binary version which talks the
FastCGI protocol, so I'm not sure whether my PHP binary is compiled correctly
to work with FastCGI (the binary produced appears to be the same with/without
'--with-fastcgi, so this might be a factor).
Also, since this setup is intended for a customer, and they only have FTP
access to update their site, with CHMOD disabled, is there any way to do this
without having to make the PHP script executable? If I turn off the
executable bit, then I get the "execute not allowed" (for uid 99, gid 99, ie,
the apache user) error which I suppose is expected.
A side-effect of all this is that I cannot even browse to an HTML file
(index.html) - it produces the error:
FastCGI: invalid (dynamic) server "/www/virtual/abc.com/htdocs/index.html":
access for server (uid 99, gid 99) not allowed: execute not allowed
Or it tries to execute the htdocs/ directory if I leave out the index.html for
DocumentRoot:
FastCGI: invalid (dynamic) server "/www/virtual/abc.com/htdocs/": script is a
directory!
I hope I've made sense in the above. Any assistance/pointers would be
appreciated. btw, it's a pity this mailing list is not open to google, else
I'd be able to search it for suggestions...
regards
Henry
Hello, I want to build a fast cgi server application which can handles long polling calls. There should be only one process of this fast cgi app which handles all incoming requests. I wrote an app which is similar to the threaded.c example in the fast cgi sdk. (http://www.fastcgi.com/devkit/examples/threaded.c) Before responding, my app will wait a certain time after an incoming request. (For testing I only put a sleep() call above FCGX_FPrintF(...) in threaded.c). I tested with Lighttpd und nginx and got the same result: The second call is blocked until the first one is finished. I think the method FCGX_Accept_r(&request); blocks until FCGX_Finish_r(&request); is called. Does anyone has a running multithread fastcgi app? Thanks Marc
Hi
Please help me to fix this issue.
[Wed Apr 20 14:28:39 2011] [notice] mod_fcgid: call /var/www/vhosts/domain.com/httpdocs/index.php with wrapper /usr/bin/php-cgi
[Wed Apr 20 14:28:39 2011] [error] (12)Cannot allocate memory: mod_fcgid: can't create wrapper process for /var/www/vhosts/domain/httpdocs/index.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Site hosted with plesk control.
Below is the server settings.
vi /etc/httpd/conf.d/fcgid.conf
added by psa-mod-fcgid-configurator
LoadModule fcgid_module /usr/lib64/httpd/modules/mod_fcgid.so
<IfModule mod_fcgid.c>
SocketPath /var/lib/httpd/fcgid/sock
</IfModule>
# added by psa-mod-fcgid-configurator
<IfModule mod_fcgid.c>
IdleTimeout 36000
ProcessLifeTime 7200
MaxProcessCount 64
DefaultMaxClassProcessCount 8
IPCConnectTimeout 300
IPCCommTimeout 450
DefaultInitEnv RAILS_ENV production
</IfModule>
For solving some other issue with fcgid, created a new vhost.conf and vhost_ssl.conf then added below entries to files.
<IfModule mod_fcgid.c>
SocketPath /var/lib/httpd/fcgid/sock
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 1000
DefaultMinClassProcessCount 3
DefaultMaxClassProcessCount 100
IPCConnectTimeout 8
IPCCommTimeout 600
BusyTimeout 300
</IfModule>
All these settings done before 2- 3 months. Drupal is used for building the sites. But now i'm getting errors i posted above.
Total memory - Mem: 1984536k total
Please help.
Regards
Nidhin M D
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
I have a dedicated application server. Whenever I push out an update to my product, there's a massive spike demand of PHP calls and it starts getting the dreaded 502 errors. I'm trying to figure out the best way to configure this box to avoid these at all costs. It's fine if the box gets bogged down and it just just takes longer to process the requests, speed isn't a big deal for this application, but getting back 502's causes me great pain on the front end.
RAM: 4 GB,
Disk: 500 GB
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
I am using Lighttpd with a fastCGI client using libfcgi on Linux. If Lighttpd opens more than 1024 tcp connections it seems that libfcgi fails and I believe this is on account of using ‘select’ with the default FD_SETSIZE value of 1024.
My question is whether this is a known issue with a tried and tested work around.
Note: my application is required to support more than 1024 simultaneous HTTP requests.
Best regards
Howard May
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
_______________________________________________ FastCGI-developers mailing list FastCGI-developers@... http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
RSS Feed2 | |
|---|---|
5 | |
2 | |
7 | |
18 | |
20 | |
15 | |
5 | |
3 | |
13 | |
11 | |
36 | |
17 | |
14 | |
15 | |
20 | |
36 | |
15 | |
12 | |
20 | |
53 | |
6 | |
20 | |
18 | |
17 | |
44 | |
8 | |
11 | |
34 | |
21 | |
10 | |
12 | |
12 | |
29 | |
35 | |
32 | |
23 | |
7 | |
11 | |
3 | |
7 | |
1 | |
7 | |
5 | |
11 | |
15 | |
6 | |
5 | |
4 | |
4 | |
5 | |
8 | |
40 | |
24 | |
22 | |
44 | |
23 | |
64 | |
102 | |
25 | |
27 | |
37 | |
31 | |
45 | |
67 | |
62 | |
60 | |
39 | |
33 | |
46 | |
56 | |
38 | |
53 | |
44 | |
40 | |
21 | |
30 | |
33 | |
50 | |
22 | |
13 | |
22 | |
7 | |
14 | |
11 | |
73 | |
44 | |
20 | |
139 | |
51 | |
98 | |
81 | |
35 | |
23 | |
59 | |
71 | |
27 | |
38 | |
57 | |
35 | |
49 | |
48 |