nignx安装Magento遇到的问题
以前搞java的,尝试安装magento,不是遇到noinputfilespecified,就是internalservererror,给自己找了个借口,不熟悉,所以就一直baidu,google,一直测试,试了好几,最终从http://stackoverflow.com/questions/11951816/nginx-magento-configuration-index-php-cyclic-error这里发现了,原来root后面要加一个/,例如
rootusr/share/nginx/www/;
具体配置可以参考magento官方网站的doc,http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento:
server{
listen80;
server_nameDOMAIN.com;
rewrite/$scheme://www.$host$request_uripermanent;##Forciblyprependawww
}
server{
listen80default;
##SSLdirectivesmightgohere
server_namewww.DOMAIN.com*.DOMAIN.com;##Domainisheretwicesoserver_name_in_redirectwillfavourthewww
root/var/www/vhosts/DOMAIN.com;
location/{
indexindex.htmlindex.php;##Allowastatichtmlfiletobeshownfirst
try_files$uri$uri/@handler;##IfmissingpasstheURItoMagento'sfronthandler
expires30d;##Assumeallfilesarecachable
}
##Theselocationswouldbehiddenby.htaccessnormally
location^~/app/{denyall;}
location^~/includes/{denyall;}
location^~/lib/{denyall;}
location^~/media/downloadable/{denyall;}
location^~/pkginfo/{denyall;}
location^~/report/config.xml{denyall;}
location^~/var/{denyall;}
location/var/export/{##Allowadminsonlytoviewexportfolder
auth_basic"Restricted";##Messageshowninloginwindow
auth_basic_user_filehtpasswd;##See/etc/nginx/htpassword
autoindexon;
}
location/.{##Disable.htaccessandotherhiddenfiles
return404;
}
location@handler{##Magentousesacommonfronthandler
rewrite//index.php;
}
location~.php/{##Forwardpathslike/js/index.php/x.jstorelevanthandler
rewrite^(.*.php)/$1last;
}
location~.php${##ExecutePHPscripts
if(!-e$request_filename){rewrite//index.phplast;}##Catch404sthattry_filesmiss
expiresoff;##Donotcachedynamiccontent
fastcgi_pass127.0.0.1:9000;
fastcgi_paramHTTPS$fastcgi_https;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
fastcgi_paramMAGE_RUN_CODEdefault;##Storecodeisdefinedinadministration>Configuration>ManageStores
fastcgi_paramMAGE_RUN_TYPEstore;
includefastcgi_params;##See/etc/nginx/fastcgi_params
}
}
接着遇到升级的问题SQLSTATE[42000]:Syntaxerrororaccessviolation:1067Invaliddefaultvaluefor'period',参考了http://zhiwu88.blog.hexun.com/69547674_d.html:
altertablecoupon_aggregatedchangeperiodperiodDATEnotnullDEFAULT'0000-00-00';
后面又遇到gate-waytimeout的问题,不记得从哪来找的:
sendfileon;
tcp_nopushon;
keepalive_timeout60;
tcp_nodelayon;
fastcgi_connect_timeout300;
fastcgi_send_timeout300;
fastcgi_read_timeout300;
fastcgi_buffer_size128k;
fastcgi_buffers2256k;#8128
fastcgi_busy_buffers_size256k;
fastcgi_temp_file_write_size256k;
fastcgi_intercept_errorson;
最终才安装成功,太不容易了,这么容易出错的安装,真让人有点受不了。