Articles of FastCGI的

nginx:php-fastcgi运行但php文件不能执行

我最近设置了一个运行于FastCGI进程的PHP的nginx服务器。 服务器正在运行HTML文件,但PHP文件正在下载,而不是显示和PHP代码不处理。 这是我在nginx.conf中的: server { listen 80; server_name pubserver; location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } } 命令netstat -tulpn | grep :9000 netstat -tulpn | grep :9000显示以下内容,指示php-fastcgi正在运行并监听端口9000: tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 2663/php-cgi 如果这是我的服务器在CentOS 6上运行的重要性,并且我使用Fedora项目的软件库安装了nginx和PHP。

gentoo上的lighttpd + django 10秒钟来回答

我想在gentoo机器上用fastcgi在lighttpd上运行Django站点。 每次我尝试访问该网站时,我都会在10秒左右之后得到回应。 我使用套接字让lighttpd与我的Django站点通信,但一个TCP端口也没有帮助。 这可能是一个lighttpd问题? 我试图从互联网服务器以及从localost,这是lighttpd给我在error.log 2012-07-10 14:36:36: (response.c.300) — splitting Request-URI 2012-07-10 14:36:36: (response.c.301) Request-URI : / 2012-07-10 14:36:36: (response.c.302) URI-scheme : http 2012-07-10 14:36:36: (response.c.303) URI-authority: owntube 2012-07-10 14:36:36: (response.c.304) URI-path : / 2012-07-10 14:36:36: (response.c.305) URI-query : 2012-07-10 14:36:36: (response.c.300) — splitting Request-URI 2012-07-10 14:36:36: (response.c.301) Request-URI : /owntube.fcgi/ 2012-07-10 14:36:36: (response.c.302) URI-scheme […]

用FastCGI缓慢的WordPress

我最近升级了我的Media Temple服务器到dv4并启用了FastCGI。 我有这个问题,我的网站上的WordPress控制面板变得缓慢。 当我更新或发布post时,有时候会挂一会,然后给我一个500错误。 我经常在我的错误日志中find这些: [Mon Jul 30 03:32:00 2012] [warn] mod_fcgid: process 20466 graceful kill fail, sending SIGKILL [Mon Jul 30 06:27:03 2012] [warn] mod_fcgid: process 22061 graceful kill fail, sending SIGKILL [Mon Jul 30 09:47:57 2012] [warn] mod_fcgid: process 22232 graceful kill fail, sending SIGKILL [Mon Jul 30 13:19:57 2012] [warn] mod_fcgid: process […]

fastcgicaching如何cachinglogin的用户,并为每个用户定制

目前,我正在使用fastcgi_cache来caching非login用户,并使用(如果+ fastcgi_no_cache + fastcgi_cache_bypass)将login用户直接传递到PHP-FPM的后端。 这个工作足够好,但是当PHP-FPM开始达到500+ req / s时,缓慢/加载开始。 所以我在想的是为login用户创build一个caching,每个用户都有它自己的caching文件,这可能吗? 如果是的话,请给我提供一些关于这方面的提示。 我已经看了很多,但没有任何帮助。 运行mysql和memcached和apc的自定义php cms的网站 cat /etc/nginx/nginx.comf user username username; worker_processes 8; worker_rlimit_nofile 20480; pid /var/run/nginx.pid; events { worker_connections 10240; use epoll; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] ' '"$request" $status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log off; error_log /var/log/nginx/error.log […]

Lighttpd与FastCGIconfiguration运行ViewVC – 重写问题

目前,我正在与ViewVC的lighttpd的configuration挣扎。 configuration从Apache 2.2.x移植,它仍然在机器上运行,服务于WebDAV / SVN的东西,通过代理。 现在,我遇到的问题似乎与重写规则,我不知道我在这里错过了什么。 这里是我的configuration(略作简要说明): var.hgwebfcgi = "/var/www/vcs/bin/hgweb.fcgi" var.viewvcfcgi = "/var/www/vcs/bin/wsgi/viewvc.fcgi" var.viewvcstatic = "/var/www/vcs/templates/docroot" var.vcs_errorlog = "/var/log/lighttpd/error.log" var.vcs_accesslog = "/var/log/lighttpd/access.log" $HTTP["host"] =~ "domain.tld" { $SERVER["socket"] == ":443" { protocol = "https://" ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/ssl/…" ssl.ca-file = "/etc/lighttpd/ssl/…" ssl.use-sslv2 = "disable" setenv.add-environment = ( "HTTPS" => "on" ) url.rewrite-once += ("^/mercurial$" […]

将www-data添加到/ etc / sudoers以作为其他用户运行php-cgi的安全性影响

我真正想要做的就是让'www-data'用户能够以另一个用户的身份启动php-cgi。 我只是想确保我完全理解安全性的含义。 服务器应该支持共享主机环境,其中各种(可能不受信任的)用户通过chroot来访问服务器的FTP来存储他们的HTML和PHP文件。 然后,由于PHP脚本可能是恶意的,读/写别人的文件,所以我想确保每个用户的PHP脚本以相同的用户权限运行(而不是以www数据运行)。 长话短说,我在/etc/sudoers文件中添加了以下行,并且想通过社区运行它作为完整性检查: www-data ALL = (%www-data) NOPASSWD: /usr/bin/php-cgi 这一行应该只允许www-data像这样运行一个命令(没有密码提示): sudo -u some_user /usr/bin/php-cgi …其中some_user是组www-data中的用户。 这有什么安全影响? 这应该允许我像这样修改我的Lighttpdconfiguration: fastcgi.server += ( ".php" => (( "bin-path" => "sudo -u some_user /usr/bin/php-cgi", "socket" => "/tmp/php.socket", "max-procs" => 1, "bin-environment" => ( "PHP_FCGI_CHILDREN" => "4", "PHP_FCGI_MAX_REQUESTS" => "10000" ), "bin-copy-environment" => ( "PATH", "SHELL", "USER" ), "broken-scriptfilename" […]

超时与Apache和PHP瓦特/每个虚拟主机有他自己的用户进程

我在/ home /中有10个unix用户。 每个用户都是针对特定的子域名,例如/ home / www / public_html中的用户www是www.mywebsite。 在/ home / blog / public_html的博客是为blog.mywebsite。 90%是php和10%ror 目前我使用apache + fastcgi使用SuexecUserGroup来设置好用户的过程。 它似乎工作,但我有一个奇怪的行为,在几小时/天后,服务器停止应答(超时),但CPU负载仍然非常低(这是一个大的服务器),Apache状态显示大量的“W”发送答复国家,但仍有50名闲置的工人,所以应该能够回答。 在较旧的服务器(很多较慢)我们只添加一个用户和使用mod_php,我们从来没有这个问题。 有没有另外一种方法做到这一点,没有fastcgi和SuexecUserGroup,或者你知道什么是错的?

在IIS上的FastCGI中编辑MaxRequestLen(Plesk)

尝试在我的服务器上上传大文件时,收到500内部服务器错误。 我所有的PHP设置是正确的,即post_max_size,execution_time等… 我非常确定这是FastCGI的一个限制,因为这是大多数网站告诉我的。 但是,所有这些网站都是指运行Apache的服务器,因此修复很简单(只需编辑conf文件)。 当我运行IIS时,问题稍微复杂一点! 有谁知道我如何在IIS中编辑FastCGI的'MaxRequestLen'值? 我似乎无法find办法做到这一点,而不是由于我不是很熟悉IIS的事实。 如果这不是问题,那么请build议使用IIS和FastCGI上传大文件的问题的其他原因

在Apache中减lessworker MPM的内存

我已经从prefork MPM转移到了工人MPM,原因是我在VPS上遇到了一个进程限制。 但是,切换后内存使用量增加了(这是因为工作者MPM应该占用更less的内存?)。 他们大多属于php-cgi进程。 有什么我做错了吗? 我有大约20个网站,每个都有不同的fcgi包装脚本。 这可能是一个原因吗?

PHP5.3 FastCGI不使用全局configuration的值

有一个Centos6.3系统。 Apache 2.2.15 + mod_fcgid + PHP 5.3.3 date.timezone值有问题。 这是在全球/etc/php.ini提到的: date.timezone = "Europe/Moscow" 并没有在用户的本地php.ini中提到。 结果,我得到很多的警告,如: Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this […]