首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Magento安装重定向循环

Magento安装重定向循环
EN

Stack Overflow用户
提问于 2014-01-31 08:54:37
回答 4查看 4.3K关注 0票数 2

我试着用Nginx和php-fpm在我的VPS(在Linode上)上安装Magento Community Edition,但是我不能,我把Magento 1.8.1.0下载到我的服务器上。我创建了像Magento Wiki这样的nginx配置。但是当我请求我的域名时,它被302头重定向到'/index.php/install/‘路径,浏览器给出了无限循环错误。

你能给出一个解决方法吗?

编辑:我的nginx配置文件(我将真实域名替换为mydomain)

代码语言:javascript
复制
server {
  server_name mydomain.com www.mydomain.com;
  root "/home/mydomain/public_html";

  index index.php;
  client_max_body_size 10m;

    access_log /home/mydomain/_logs/access.log;
    error_log /home/mydomain/_logs/error.log;

    if ($http_user_agent ~* (Baiduspider|webalta|nikto|wkito|pikto|scan|acunetix|morfeus|webcollage|youdao) ) {
       return 401;
    }

    if ($http_user_agent ~* (HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) ) {
       return 401;
    }

    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)($|/)" {
        if (!-e $request_filename) { rewrite / /index.php last;  }

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param MAGE_RUN_CODE default;
        fastcgi_param MAGE_RUN_TYPE store;
        fastcgi_param HTTPS $https;

        fastcgi_pass   unix:/var/run/mydomain_fpm.sock;
        include        fastcgi_params;
    }


    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires max;
            log_not_found off;
            access_log off;
    }

    location ~* \.(html|htm)$ {
        expires 30m;
    }

    location ~* /\.(ht|git|svn) {
        deny  all;
    }
}
EN

回答 4

Stack Overflow用户

发布于 2014-02-06 00:20:43

基本上,如果您还没有crated数据库,它将在Nginx和虚拟主机配置中出现问题。

浏览器的内存可能会出现故障。试着清理它,或者使用匿名机制。

尝试删除magento文件并创建一个简单的index.php文件,其中包含"hello“文本。如果工作正常,请尝试将Magento文件再次复制到此文件夹并运行安装。

请记住,您必须使用对此数据库具有所有权限的用户创建一个空数据库。

第二个问题可能是安装错误,( magento已安装,您尝试再次连接安装程序,但这将重定向)。如果在安装过程中出现问题,请从数据库中删除表,然后重新运行安装。

票数 0
EN

Stack Overflow用户

发布于 2014-06-19 01:03:23

我的文件如下所示:

代码语言:javascript
复制
server {
    listen 80 default;
    access_log /var/log/nginx/test.ssl.access.log;
    error_log /var/log/nginx/test.ssl.error.log;
    ssl off;
    root /var/www/shop;
    server_name sales.test.net.au;
    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }
    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; }
        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;
        fastcgi_param MAGE_RUN_TYPE store;
        include fastcgi_params;
    }
    location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass 127.0.0.1:9000;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
}
server {
    listen 443 default;
    ssl on;
    ssl_certificate /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    access_log /var/log/nginx/test.ssl.access.log;
    error_log /var/log/nginx/test.ssl.error.log;
    server_name sales.test.net.au;
    root /var/www/shop;
    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }
    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; }
        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;
        fastcgi_param MAGE_RUN_TYPE store;
        include fastcgi_params;
    }
    location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_pass 127.0.0.1:9000;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       include /etc/nginx/fastcgi_params;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
}

对我来说很有效。

票数 0
EN

Stack Overflow用户

发布于 2014-07-03 03:08:33

问题是"default“行有"https",而”store“行有"http”。

使用PhpMyAdmin执行以下SQL命令:

代码语言:javascript
复制
SELECT * FROM `core_config_data` WHERE path like '%secure/base_url'

然后检查是否所有安全行都以"https“开头。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21470645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档