<?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>夜行人 &#187; Magento</title>
	<atom:link href="http://www.187299.com/archives/tag/magento/feed" rel="self" type="application/rss+xml" />
	<link>http://www.187299.com</link>
	<description>寻觅生命中的那一片浅草......</description>
	<lastBuildDate>Wed, 16 Nov 2011 11:25:49 +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>run Magento with Nginx</title>
		<link>http://www.187299.com/archives/108</link>
		<comments>http://www.187299.com/archives/108#comments</comments>
		<pubDate>Sat, 11 Apr 2009 10:14:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.momati.net/archives/108</guid>
		<description><![CDATA[.系统环境：CentOS5.0 Nginx版本：0.7.47 Magento版本：1.2.0.3 Nginx+MySQL+PHP环境是按照张宴的文章搭建的，只需作一点修改就可以让Magento跑起来 1、修改fcgi.conf vi /usr/local/webserver/nginx/conf/fcgi.conf 将 fastcgi... ]]></description>
			<content:encoded><![CDATA[<p>.<span style="font-size: small;">系统环境：CentOS5.0<br />
Nginx版本：0.7.47<br />
Magento版本：1.2.0.3</span></p>
<p><span style="font-size: small;"> Nginx+MySQL+PHP环境是按照张宴的文章搭建的，只需作一点修改就可以让Magento跑起来<br />
<span id="more-108"></span><br />
1、修改fcgi.conf<br />
vi /usr/local/webserver/nginx/conf/fcgi.conf<br />
将<br />
fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;<br />
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;<br />
修改为<br />
#fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;<br />
#fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;</span></p>
<p><span style="font-size: small;">2、修改nginx.conf<br />
mv /usr/local/webserver/nginx/conf/nginx.conf /usr/local/webserver/nginx/conf/nginx.conf.OLD<br />
vi /usr/local/webserver/nginx/conf/nginx.conf<br />
添加以下内容：</span></p>
<p><span style="font-size: small;">user  www www;<br />
worker_processes 8;<br />
pid        /usr/local/webserver/nginx/nginx.pid;<br />
worker_rlimit_nofile 51200;</p>
<p>events<br />
{<br />
use epoll;<br />
worker_connections 51200;<br />
}</p>
<p>http<br />
{<br />
include       mime.types;<br />
default_type  application/octet-stream;</p>
<p>#charset  gb2312;</p>
<p>server_names_hash_bucket_size 128;<br />
client_header_buffer_size 32k;<br />
large_client_header_buffers 4 32k;<br />
client_max_body_size 8m;</p>
<p>sendfile on;<br />
tcp_nopush     on;</p>
<p>keepalive_timeout 60;</p>
<p>tcp_nodelay on;</p>
<p>fastcgi_connect_timeout 300;<br />
fastcgi_send_timeout 300;<br />
fastcgi_read_timeout 300;<br />
fastcgi_buffer_size 64k;<br />
fastcgi_buffers 4 64k;<br />
fastcgi_busy_buffers_size 128k;<br />
fastcgi_temp_file_write_size 128k;</p>
<p>gzip on;<br />
gzip_min_length  1k;<br />
gzip_buffers     4 16k;<br />
gzip_http_version 1.0;<br />
gzip_comp_level 2;<br />
gzip_types       text/plain application/x-javascript text/css application/xml;<br />
gzip_vary on;</p>
<p>#limit_zone  crawler  $binary_remote_addr  10m;<br />
server {<br />
listen   80;<br />
server_name  www.example.com;<br />
index index.html index.htm index.php;<br />
root  /data0/htdocs/www;<br />
error_log  /data1/logs/nginx_error.log;</p>
<p># media<br />
location ~* \.(png|gif|jpg|jpeg|css|js|swf|ico)$ {<br />
root   /data0/htdocs/www/;<br />
access_log off;<br />
expires 30d;<br />
}</p>
<p># pass the PHP scripts to FastCGI socket<br />
location ~ \.php$ {<br />
fastcgi_pass   127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
fastcgi_param  SCRIPT_NAME $fastcgi_script_name;<br />
fastcgi_param  SCRIPT_FILENAME /data0/htdocs/www$fastcgi_script_name;<br />
include fcgi.conf;<br />
}<br />
location ^~ /js/proxy.php {<br />
fastcgi_pass   127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
fastcgi_param  SCRIPT_NAME $fastcgi_script_name;<br />
fastcgi_param  SCRIPT_FILENAME  /data0/htdocs/www$fastcgi_script_name;<br />
include fcgi.conf;<br />
access_log off;<br />
expires 30d;<br />
}<br />
location / {<br />
fastcgi_pass  127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
fastcgi_param  SCRIPT_NAME index.php;<br />
fastcgi_param  SCRIPT_FILENAME /data0/htdocs/www/index.php;<br />
include fcgi.conf;<br />
}<br />
}<br />
} </span></p>
<p><span style="font-size: small;">请根据实际情况进行修改，如果按照张宴文章配置，则只需将server_name修改为你自己的域名，保存退出。<br />
重启Nginx，使配置生效<br />
kill -HUP `cat /usr/local/webserver/nginx/nginx.pid`</span></p>
<p><span style="font-size: small;"> 经过以上设置，就可以使Magento跑在Nginx上了。</span></p>
<p><span style="font-size: small;">主要参考文章：</p>
<p>http://blog.s135.com/nginx_php_v4/</p>
<p>http://www.magentocommerce.com/boards/viewthread/7931/</p>
<p>http://www.ruby-forum.com/topic/177888</p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.187299.com/archives/108/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

