ecshop搭建nginx+php+mysql+fastcgi环境
2012-02-13 17:14 来源:www.chinab4c.com 作者:ecshop专家
ecshop搭建nginx+php+mysql+fastcgi环境,我们将ecshop的环境安装在nginx上,这样不但可以发挥ecshop最大的性能,同时也能增强ecshop运行是发生的并发量处理。将你的ecshop通过修改,安装在nginx环境上。
1:首先先删除linux下默认的程序httpd
yum remove httpd
yum update
2:安装mysql
yum install mysql mysql-server
3:加载驱动mysql
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
4:设置mysql密码
mysql_secure_installation
5:获得安装rpm
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh http://centos.alt.ru/repository/centos/5/x86_64/centalt-release-5-3.noarch.rpm
6:安装nginx
yum install nginx
7:启动nginx
chkconfig --levels 235 nginx on
/etc/init.d/nginx start
8:安装php扩展
yum install php-fpm php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap php-tidy
9:修改php.ini
vi /etc/php.ini
修改cgi.fix_pathinfo = 1
service php-fpm start
10:启动php-fpm 参数
chkconfig --levels 235 php-fpm on
11:配置nignx.conf
vi /etc/nginx/nginx.conf
- server {
- listen 80;
- server_name _;
- #charset koi8-r;
- #access_log logs/host.access.log main;
- location / {
- root /usr/share/nginx/html;
- index index.php index.html index.htm;
- }
- error_page 404 /404.html;
- location = /404.html {
- root /usr/share/nginx/html;
- }
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass http://127.0.0.1;
- #}
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- root /usr/share/nginx/html;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- }
12:重起nginx
/etc/init.d/nginx restart
/etc/init.d/php-fpm restart
13:建立测试php
vi /usr/share/nginx/html/info.php
14:修改nginx.conf
在nginx/conf/nginx.conf 找到:
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 改为:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
最近更新
常用插件
- ecshop分类树中统计商品数
最近忙于开发其他项目,在不少朋友不断要求和催促的情况下,做出了该小...
- ecshop通用红包编码
很多时候,为了结合促销,必须扩展一下ecshop的红包功能。ecshop的红包...
- ecshop降价通知登记插件
ecshop降价通知登记插件,主要是为了方便某些客户,对商品价格要求比...
- ecshop红包修改成满多少减
我们在长期使用ecshop的时候,我们可以发现。ecshop的红包是一个非常强...
- ecshop购物车功能改进[插件
ecshop购物车功能改进[插件套餐]主要是我们最近开发工作和开发项目中。...