<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Case &#187; nginx</title>
	<atom:link href="http://case.net.ru/tag/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>http://case.net.ru</link>
	<description>Just another technical weblog</description>
	<lastBuildDate>Sat, 19 Jun 2010 14:06:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Установка nginx и php_fastcgi</title>
		<link>http://case.net.ru/2009/02/01/nginx-fastcgi/</link>
		<comments>http://case.net.ru/2009/02/01/nginx-fastcgi/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 11:10:20 +0000</pubDate>
		<dc:creator>Case</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://case.net.ru/?p=171</guid>
		<description><![CDATA[Променяли apache на nginx + fastcgi. Замечания: - наверное должно работать быстрее - в отличии от апачевских rewrite&#8217;ов &#8211; в nginx&#8217;овских вначале должно стоять ^/, а не просто ^ - красивый конфиг где все понятно - под php надобно демона запускать, вот скриптик: 1 2 3 4 5 6 7 8 9 10 11 12 [...]]]></description>
			<content:encoded><![CDATA[<p>Променяли apache на nginx + fastcgi. Замечания:<br />
- наверное должно работать быстрее<br />
- в отличии от апачевских rewrite&#8217;ов &#8211; в nginx&#8217;овских вначале должно стоять ^/, а не просто ^<br />
- красивый конфиг где все понятно<br />
- под php надобно демона запускать, вот скриптик:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># PROVIDE: php_fastcgi</span>
<span style="color: #666666; font-style: italic;"># REQUIRE: DAEMON</span>
<span style="color: #666666; font-style: italic;"># BEFORE:  LOGIN</span>
<span style="color: #666666; font-style: italic;"># KEYWORD: shutdown</span>
&nbsp;
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.subr
&nbsp;
<span style="color: #007800;">name</span>=<span style="color: #ff0000;">&quot;php_fastcgi&quot;</span>
<span style="color: #007800;">rcvar</span>=<span style="color: #000000; font-weight: bold;">`</span>set_rcvar<span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
load_rc_config <span style="color: #007800;">$name</span>
&nbsp;
: <span style="color: #800000;">${php_fastcgi_enable=&quot;NO&quot;}</span>
: <span style="color: #800000;">${php_fastcgi_user=&quot;www&quot;}</span>
: <span style="color: #800000;">${php_fastcgi_bindaddr=&quot;127.0.0.1&quot;}</span>
: <span style="color: #800000;">${php_fastcgi_bindport=&quot;9000&quot;}</span>
: <span style="color: #800000;">${php_fastcgi_children=&quot;5&quot;}</span>
: <span style="color: #800000;">${php_fastcgi_max_requests=&quot;1000&quot;}</span>
: <span style="color: #800000;">${php_fastcgi_allowed_env=&quot;&quot;}</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PHP_FCGI_CHILDREN</span>=<span style="color: #800000;">${php_fastcgi_children}</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PHP_FCGI_MAX_REQUESTS</span>=<span style="color: #800000;">${php_fastcgi_max_requests}</span>
&nbsp;
<span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">command</span></span>=<span style="color: #ff0000;">&quot;/usr/local/bin/php-cgi&quot;</span>
<span style="color: #007800;">command_args</span>=<span style="color: #ff0000;">&quot;-q -b <span style="color: #007800;">${php_fastcgi_bindaddr}</span>:<span style="color: #007800;">${php_fastcgi_bindport}</span> &amp;&quot;</span>
<span style="color: #007800;">pidfile</span>=<span style="color: #ff0000;">&quot;/var/run/<span style="color: #007800;">${name}</span>.pid&quot;</span>
&nbsp;
<span style="color: #007800;">_allowed_env</span>=<span style="color: #ff0000;">&quot;ORACLE_HOME PATH USER PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS FCGI_WEB_SERVER_ADDRS&quot;</span>
<span style="color: #007800;">_allowed_env</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${_allowed_env}</span> <span style="color: #007800;">${php_fastcgi_allowed_env}</span>&quot;</span>
&nbsp;
<span style="color: #007800;">start_precmd</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${name}</span>_start_precmd&quot;</span>
<span style="color: #007800;">start_postcmd</span>=<span style="color: #ff0000;">&quot;ps -U <span style="color: #007800;">${php_fastcgi_user}</span> -o 'pid,command'|grep <span style="color: #007800;">${command}</span>|head -1|cut -f 1 -d ' ' &gt; <span style="color: #007800;">${pidfile}</span>&quot;</span>
<span style="color: #007800;">stop_postcmd</span>=<span style="color: #ff0000;">&quot;: &gt; <span style="color: #007800;">${pidfile}</span>&quot;</span>
php_fastcgi_start_precmd<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">USER</span>=<span style="color: #800000;">${php_fastcgi_user}</span>
    <span style="color: #007800;">E</span>=
    <span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${_allowed_env}</span>; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #007800;">_val</span>=<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\$</span><span style="color: #007800;">$i</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${_val}</span>_x&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;_x&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">eval</span> <span style="color: #007800;">_add</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>=<span style="color: #007800;">$_val</span>&quot;</span>
            <span style="color: #007800;">E</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${E}</span> <span style="color: #007800;">${_add}</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">done</span>
    <span style="color: #007800;"><span style="color: #7a0874; font-weight: bold;">command</span></span>=<span style="color: #ff0000;">&quot;env - <span style="color: #007800;">${E}</span> <span style="color: #007800;">${command}</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
load_rc_config <span style="color: #007800;">$name</span>
&nbsp;
run_rc_command <span style="color: #ff0000;">&quot;$1&quot;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://case.net.ru/2009/02/01/nginx-fastcgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
