这是麻烦:当我按照这个链接 – http://znak.net.ua它重写到http://znak.net.ua/ru/ru/ru/ru/ru/ ,我得到错误310(净: :ERR_TOO_MANY_REDIRECTS) 发生这种情况时,我开始使用fast_cgi保证mod_php这里是我的.htaccess: ErrorDocument 404“找不到请求的文件favicon.ico。 DirectoryIndex index.php <IfModule mod_php4.c> </IfModule> <IfModule sapi_apache2.c> </IfModule> <IfModule mod_php5.c> </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A1209600 ExpiresByType text/html A1 </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^(.*)$ http://znak.net.ua/ru/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ ru/index.php?q=$1 [L,QSA] </IfModule>
这是我的/etc/nginx/sites-available/default : # Sample site server { listen 80; ## listen for ipv4 server_name web; access_log /var/log/nginx/web.access.log; location / { root /srv/www/web/; index default.cshtml Default.cshtml; fastcgi_index Default.cshtml; fastcgi_pass 127.0.0.1:9000; include /etc/nginx/fastcgi_params; } } # Another Sample site server { listen 80; ## listen for ipv4 server_name irws; access_log /var/log/nginx/irws.access.log; location / { root /srv/www/irws/; index […]
我正在使用以下设置: CentOS 5.9 Apache与Nginx的静态资源代理 PHP 5.4 FastCGI的 上传较小的文件时,一切正常。 但是,如果我尝试上传较大的文件(我还没有确定切断点),我得到500错误。 我的apache日志设置为E_ALL&〜E_NOTICE&〜E_STRICT&〜E_DEPRECATED 当第一次发生这种情况时,我检查了日志,发现POST超过了fcgi config中的MaxRequestLen。 我迅速地在php.conf文件和cPanel中的post_virtualHost包含文件中更改了这个。 这阻止了错误消息得到logging,但我仍然收到500错误,混淆,没有任何错误相关的logging任何。 从客户端的angular度来看,该文件似乎上传的罚款,并需要很长的时间,因为它应该(HTML5文件API报告进展正常),并在服务器已经收到完整的文件后,长的脚本执行后,500错误生成。 该文件本身是一个大型的文本文件,其中包含几个base64图像,然后拉开服务器端,使用ImageMajick(通过IMajik php扩展)转换成实际的图像文件,然后复制到不同大小的版本与不同级别的过滤/压缩适用于他们。 整个过程可能需要一段时间。 这可能是问题的一部分吗? 如果是的话,我将如何解决? 我的fcgiconfiguration是最新的,如下所示: MaxRequestsPerProcess 1000 FcgidMaxProcesses 200 FcgidProcessLifeTime 7200 MaxProcessCount 500 FcgidIOTimeout 400 FcgidIdleTimeout 600 FcgidIdleScanInterval 90 FcgidBusyTimeout 300 FcgidBusyScanInterval 80 ErrorScanInterval 3 ZombieScanInterval 3 DefaultMinClassProcessCount 0 DefaultMaxClassProcessCount 3 FcgidMaxRequestLen 1073741824 我试图用旧的MaxRequestLenreplaceFcgidMaxRequestLen,但仍然没有运气。 任何帮助将不胜感激。
什么是推荐的path来编译或安装nginx的fastcgi_cache在Ubuntu 12.04 LTS precise ,与最新的nginx-common( 读> =版本1.2.7 )包工程? 或者有没有一种方法可以在debian / ubuntu服务器上完全从头开始有效地编译nginx?
我已经安装PHP作为Apache模块。 我已经prefork运行这一切。 我读过这个worker会消耗更less的内存,同时提供更高的性能] 1 。 所以,我编辑了/etc/sysconfig/httpd并取消注释: HTTPD=/usr/sbin/httpd.worker 并重新启动Apache。 但是,当我运行httpd -l ,我仍然得到以下内容: core.c prefork.c http_core.c mod_so.c 这意味着prefork仍然在运行,但不是worker ,我想。 现在当我运行顶部的命令,我得到httpd.worker COMMAND列而不是只是httpd 。 我的问题是:我目前的设置是否错误,他们会损害我的服务器的性能或内存消耗? 我已经看到人们将Apache工作者和PHP FastCGI包含在相同的教程中,所以我假设这两者是相互关联的。 我应该configurationPHP FastCGI来取代mod_php吗? 顺便说一句,我正在使用Amazon EC2。
我有一点麻烦。 我在rtcamp.com上一步一步的按照教程一步步的做了wordpress多站点,只是把“example.com” 改成了我的域名。 我安装了nginx helper插件,它看起来像整个网站,一切都很好。 (这是一个由LAMP设置移动的大约40个站点的networking) 我有一个问题,但。 即使使用fastcgi_cache进行configuration,我的页面加载时间也非常高。 这是当我查看源代码时间戳时读取的内容: <!–Cached using Nginx-Helper on 2013-03-12 00:21:19. It took 62 queries executed in 13.000 seconds. Visit http://wordpress.org/extend/plugins/nginx-helper/faq/ for more details –> 这不会发生在根网站上,只与子目录网站发生。 这里是我的configuration:这是网站可用/ example.com #move next 3 lines to /etc/nginx/nginx.conf if you want to use fastcgi_cache across many sites fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:500m inactive=60m; fastcgi_cache_key "$scheme$request_method$host$request_uri"; fastcgi_cache_use_stale […]
最近我切换到NGINX / PHP-FPM来运行我的论坛。 大多数时候,网站运行精美,认真快速,我真的很高兴。 它在一个13核心/ 30 + GB的内存实例与AWS,如此充足的资源(在8核心,16GB之前与Apache。) 那么,会发生什么呢,大多数时候我们有6到7个PHP-FPM进程,并且都和世界一样好; PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 27676 apache 20 0 499m 34m 19m R 49.2 0.1 0:06.33 php-fpm 27669 apache 20 0 508m 48m 24m R 48.2 0.1 0:10.84 php-fpm 27661 apache 20 0 534m 75m 26m R 45.9 0.2 […]
这是一个多部分的问题。 首先,我有502坏的门户,但我敢肯定,这是因为我下面这些线路之一是错误的。 其次,我很想知道我是如何做'安全明智的'。 我明白,那里的许多指导给了可怕的build议。 我试图聪明地集合所有的知识,但是我很新,所以我可能错过了一些东西。 安全对我来说非常重要,所以如果你喜欢,我会喜欢一个快速而肮脏的“审计”。 对于我的拓扑结构,我正在使用EC2和VPC。 亚马逊Linux AMI。 我有一个弹性负载平衡器,链接到2个nginx服务器。 这些服务器链接到一个单独的php-fpm服务器。 1 nginx服务器被禁用,而我debugging这个。 这是我得到的错误。 我觉得这很奇怪,因为我实际上并10.0.0.94在任何地方使用10.0.0.94 (据我所知)。 我正在使用* .210和* .248。 2013/03/27 14:33:10 [error] 2724#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.94, server: www.example.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://10.0.0.210:9001", host: "xxx.us-east-1.elb.amazonaws.com" 编辑:有一件事我忘了提及。 我认为,因为php-fpm是一个单独的服务器,我读了我必须有相同的文件作为nginx服务器。 我没有rsync或任何设置尚未…我只是上传一个简单的index.php文件到/var/www/html/example.com/index.php作为一个testing。 服务器1和2(nginx) nginx.conf # Run as a less […]
我基本上是试图实现Apache MultiViews行为,以便我的URL不需要.php扩展名。 就我从其他问题上看到的服务器故障回答,我应该有这个问题sorting,但是在我的nginxconfiguration中显然是错误的。 行为几乎是正确的; 我可以浏览到/path/to/app/和index.php文件被正确parsing 我可以浏览到/path/to/app/function.php文件被正确parsing 我可以浏览到/path/to/app/media/some.jpg并将其作为静态内容提供 如果我浏览到/path/that/doesnt/exist我得到一个404预期 但是,如果我浏览到/path/to/function try_files指令正确地匹配它到function.php但下载它作为一个静态文件。 这里是configuration文件: server { listen 80; server_name app; root /path/to/app; index index.php index.html index.htm; access_log /var/log/nginx/access.log; location / { allow all; try_files $uri $uri/ $uri.php =404; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; } location ~ /\.ht { deny all; } }
我在运行CentOS 6.3的VPS上安装了nginx,我似乎无法获得任何PHP文件的工作。 这是我的nginx.conf文件: user nginx; worker_processes 2; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/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 /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; […]