首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

nignx安装Magento遇到的有关问题

2013-07-16 
nignx安装Magento遇到的问题以前搞java的,尝试安装magento,不是遇到no input file specified,就是internal

nignx安装Magento遇到的问题
以前搞java的,尝试安装magento,不是遇到no input file specified,就是internal server error,给自己找了个借口,不熟悉,所以就一直baidu,google,一直测试,试了好几,最终从http://stackoverflow.com/questions/11951816/nginx-magento-configuration-index-php-cyclic-error这里发现了,原来root后面要加一个/,例如
root usr/share/nginx/www/;

具体配置可以参考magento官方网站的doc,http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento:

server {
    listen 80;
    server_name DOMAIN.com;
    rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
}

server {
    listen 80 default;
## SSL directives might go here
    server_name www.DOMAIN.com *.DOMAIN.com; ## Domain is here twice so server_name_in_redirect will favour the www
    root /var/www/vhosts/DOMAIN.com;

    location / {
        index index.html index.php; ## Allow a static html file to be shown first
        try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
        expires 30d; ## Assume all files are cachable
    }

    ## These locations would be hidden by .htaccess normally
    location ^~ /app/                { deny all; }
    location ^~ /includes/           { deny all; }
    location ^~ /lib/                { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/            { deny all; }
    location ^~ /report/config.xml   { deny all; }
    location ^~ /var/                { deny all; }

    location /var/export/ { ## Allow admins only to view export folder
        auth_basic           "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex            on;
    }

    location  /. { ## Disable .htaccess and other hidden files
        return 404;
    }

    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }

    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ .php$ { ## Execute PHP scripts
        if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss

        expires        off; ## Do not cache dynamic content
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  HTTPS $fastcgi_https;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
        fastcgi_param  MAGE_RUN_TYPE store;
        include        fastcgi_params; ## See /etc/nginx/fastcgi_params
    }
}

接着遇到升级的问题SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'period' ,参考了http://zhiwu88.blog.hexun.com/69547674_d.html:
alter table coupon_aggregated change period period DATE not null DEFAULT '0000-00-00';

后面又遇到 gate-way timeout的问题,不记得从哪来找的:
                sendfile on;
tcp_nopush     on;

keepalive_timeout 60;

tcp_nodelay on;

fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 2 256k;#8 128
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;

最终才安装成功,太不容易了,这么容易出错的安装,真让人有点受不了。

热点排行