Articles of nginx

安装了php-gd,但是在运行nginx的CentOS 5.3服务器上的phpinfo中没有显示gd

以root身份login,我使用安装了php-gd库 $ yum install php-gd 它说一切正常,所以我做到了 $ /etc/init.d/nginx restart 但我一直在工作的代码仍抱怨没有gd库,当我去检查phpinfo的输出时,没有“gd”部分。 我应该注意到yum list | grep gd yum list | grep gd显示 gd.i386 2.0.33-9.4.el5_1.1 installed gd-devel.i386 2.0.33-9.4.el5_1.1 installed gdb.i386 6.8-27.el5 installed gdbm.i386 1.8.0-26.2.1 installed php-gd.i386 5.1.6-23.2.el5_3 installed 我还将extension=gd.so手动添加到了/etc/php.ini ,并且仍然没有显示或者提示错误,这导致我相信我的php.ini在重新启动nginx时不会被重新parsing。 是否有重新启动nginx之外的东西我必须做的php.ini更改加载? 虽然没有正式的培训,但我还是有相当数量(如3年)的特别服务器pipe理经验,但是我对nginx比较陌生,以前从来没有和CentOS一起工作过,所以任何帮助都不胜感激。

如何configurationNginx通过多个FCGI进程来处理各种后端?

我见过很多教程,展示了如何通过各种FCGIstream程在nginx上设置PHP / Python / Perl / RoR 。 我find的教程都没有展示如何在一台服务器上提供多个FCGI服务。 如何configuration稳定的nginx(nginx-0.7.64)来为多个FCGI进程(每个上述语言一个)提供服务? 每个FCGI过程的示例地址如下所示: 127.0.0.1:8080 – PHP 127.0.0.1:8081 – Python 127.0.0.1:8082 – Perl 127.0.0.1:8083 – Ruby on Rails 一个示例configuration文件显示了如何实现多个FCGI的closures一台服务器是我真正需要的。 也许其他人也会受益。

在nginx上安装ikiwiki – fastcgi / fcgi包装

我的最终目标是设置ikiwiki,我目前的目标是获得一个fcgi包装器为nginx工作,所以我可以继续下一步… ikiwiki页面指出了这个页面作为一个fcgi包装的例子: http://technotes.1000lines.net/?p=23 到目前为止,我已经通过aptitude安装了ikiwiki和libfcgi-perl模块: aptitude install libfcgi-perl aptitude install ikiwiki 它安装了这些软件包以及一些最小的依赖包。 所以下一步在技术指南后,我抓住http://technotes.1000lines.net/fastcgi-wrapper.pl,但我不知道在哪里实际放置此文件…我作为一个服务运行它? 该脚本在/ var / run / nginx中创build套接字文件,但该目录不存在..我手动创build它吗? 所以除了cgi包装器的.pl文件之外,我还需要为参数定义一个单独的cgi文件。 如果我的configuration文件看起来像这样 server { listen 80; server_name notes.domain.org; access_log /www/notes/public_html/notes.domain.org/log/access.log; error_log /www/notes/public_html/notes.domain.org/log/error.log; location / { root /www/notes/public_html/notes.domain.org/public/; index index.html; } } 而我没有一个cgi-bin目录,我应该在哪里创build它,在我的结构中,我明显需要更新下面的代码,但是我只是不确定这将如何工作。 # /cgi-bin configuration location ~ ^/cgi-bin/.*\.cgi$ { gzip off; fastcgi_pass unix:/var/run/nginx/perl_cgi-dispatch.sock; [1]* fastcgi_param SCRIPT_FILENAME /www/blah.com$fastcgi_script_name; […]

Nginx负载平衡和维护URL

我正在尝试使用nginx作为负载平衡器,并且它工作得很好。 一个问题,但。 负载均衡框为123.123.123.123,后端框为456.456.456.456。 所以我有这个configuration: upstream backend { server 456.456.456.456; } server { listen 80; server_name 123.123.123.123; access_log off; error_log off; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://backend; } } 这很好。 我在我的浏览器中打了123.123.123.123,页面出现了。 但是现在浏览器中的url是http://456.456.456.456 。 我是否需要使用重写规则或其他东西来保持URL正确? 去不同的支持服务器时,我不希望它有所不同。 我读过的所有教程都没有提到这个。

nginx与stub_status ..需要帮助nginx.conf

我想设置存根状态的nginx,所以我可以监视nginx请求等与serverdensity.com。 我需要把这样的东西放在nginx.conf中 server { listen 82.113.147.xxx; location /nginx_status { stub_status on; access_log off; allow 82.113.147.xxx; deny all; } } 而这个监测acctualy工程。 然而,似乎我失去了“包含”在我的nginx.conf部分,现在没有虚拟主机在网站启用工作。 这里有一点我的nginx.conf http { include /etc/nginx/mime.types; default_type application/octet-stream; server_tokens off; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_comp_level 2; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss […]

使用不同的nginx位置上下文和后端服务器上下文进行负载平衡

我使用nginx和上游模块进行负载平衡,具有以下configuration upstream lb { server 127.0.0.1:8080; server 127.0.0.1:8081; } server { listen 88; server_name localhost; location /cas/ { proxy_pass http://lb; proxy_redirect off; proxy_connect_timeout 2; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } 问题是“位置/上下文/”必须匹配到后端服务器的上下文,所以当我请求localhost / context / index.html然后nginx路由它到127.0.0.1:8080/context/index.html或127.0.0.1 :8080 /上下文/ index.html中。 是否有可能有不同的后端上下文和Nginx的位置,例如“位置/”nginx会将请求路由到127.0.0.1:8080/context/index.html或127.0.0.1:8080/context/index.html 谢谢。

iptables端口转发+ nginxredirect问题

这是我的networking 浏览器=>代理(iptables端口转发)=> nginx服务器 代理:192.168.10.204,转发192.168.10.204:22080到192.168.10.10:80 nginx服务器:192.168.10.10 nginx版本:0.7.65 debiantesting 在nginx设置中,我设置了: server_name _; server_name_in_redirect off; 因为我的服务器没有域名 现在,访问192.168.10.10/index.html或192.168.10.10/foobar是好的 那么访问192.168.10.204:22080/index.html是可以的 但访问192.168.10.204:22080/foobar,nginx 301redirect到http://192.168.10.204/foobar 怎么修? 谢谢 telnet 192.168.10.204 22080 Trying 192.168.10.204… Connected to 192.168.10.204. Escape character is '^]'. GET /index.html HTTP/1.1 Host: 192.168.10.10 HTTP/1.1 200 OK Server: nginx/0.7.65 Date: Fri, 28 May 2010 10:07:29 GMT Content-Type: text/html Content-Length: 12 Last-Modified: Fri, 28 […]

Nginx和多个wordpress实例与fastcgi在同一个域下

我的网站在Apache上运行。 两个wordpress实例存在于/ tr /和/ eng /path下。 我想将设置移动到nginx,但无法设法得到它的工作。 我的设置包括0.7.66,PHP 5.3.2和php-fpm。 / tr /和/ eng /是分别位于/ home / istci / webapps / wordpress_tr和/ home / istci / webapps / wordpress下的两个单独的wordpress实例。 下面是nginx.conf中的服务器部分,它只包含tr的configuration,但是也不能使它工作。 server { listen 80; server_name www.example.com; charset utf-8; location ~ ^/$ { rewrite ^(.+)$ http://www.example.com/tr/ permanent; } location ~ /tr/.*php$ { fastcgi_pass unix:/home/istci/var/run/wptr.sock; fastcgi_index index.php; fastcgi_param […]

nginx比apache更适合dynamic内容?

可能重复: Apache或NGINX的PHP? 嗨, 我已经在网上search这个,我找不到我的问题的正确答案。 基本上我想知道如果我能用nginx比用apache(在php应用程序中)获得更好的性能,而且我不涉及静态内容(在哪里我知道nginx更好)。 这些网站是一个广泛收集的脚本有很多variables,使用旧的不面向对象代码和新的网站使用类和聪明。 这些网站是非常dynamic的,在每个请求中改变部分。 我想避免起诉nginx的静态内容和apache的PHP,所以为此,我问,如果它值得过渡的performance。 我的主要困惑来自于我已经看到使用wordpress和wp-supercache插件的基准testing,这可以使它比nginx更好的自定义网站与我已经描述的function。 我已经看到其他基准没有显示出很大的差异(约5%) 提前感谢任何帮助:D 问候,阴影。

nginx重写Joomla的规则!

我已经从版本库(v0.7.65)在Ubuntu上安装了nginx,虽然我的默认站点configuration使用WordPress漂亮的URL和nginx兼容性插件(到目前为止),但它并没有Joomla !. 这里是configuration: server { listen 80 default; server_name localhost; access_log /var/log/nginx/localhost.access.log; root /var/www/nginx-default; location /wordpress { try_files $uri $uri/ @wordpress; } location /joomla { try_files $uri $uri/ @joomla; } # Configuración para instalaciones de WordPress location @wordpress { fastcgi_pass 127.0.0.1:9120; fastcgi_param SCRIPT_FILENAME $document_root/wordpress/index.php; include fastcgi_params; } # Configuración para instalaciones de Joomla! location @joomla […]