2014-01-31 37 views
2

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

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

编辑:我的nginx的配置文件(我换成真正的域名作为MYDOMAIN)

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; 
    } 
} 
+0

你能提供更多的细节到你的nginx配置吗? –

+0

我添加了nginx配置文件。 –

回答

0

基本上,如果你没有装箱数据库的是,这将是Nginx的问题和虚拟主机的配置。

可能的错误将在您的浏览器的内存中。尝试清理它,或使用匿名制度。

尝试删除magento文件,并创建一个简单的index.php文件,其中带有“hello”文本。如果有效,请尝试将Magento文件再次复制到此文件夹并运行安装。

请记住,您必须创建一个空数据库,用户拥有该数据库的所有权限。

第二个问题可能是故障安装,(您的magento已安装,并且您尝试再次连接安装程序,但会重新定向)。在这种情况下,安装时出现错误,从数据库中删除表并再次运行安装。

-2

请检查您的htaccess文件。如果存在的话,请检查现有的规则

+3

Nginx没有。htaccess:| –

-1

的php.ini disable_classes

首先删除了所有disable_classes然后在安装完成添加所有保存的php.ini

了shell_exec,EXEC,系统,水珠,猫,DL, openbasedir,POPEN,proc_close,proc_get_status,proc_nice,proc_open,escapeshellcmd,escapeshellarg,show_source,posix_mkfifo,mysql_list_dbs,get_current_user,getmyuid,pconnect,链接,符号连接,pcntl_exec,ini_alter,parse_ini_file,泄漏,apache_child_terminate,posix_kill,posix_setpgid,posix_setsid,posix_setuid, proc_terminate,系统日志,fpassthru,allow_url_fopen选项,stream_select,socket_select,socket_create,socket_create_listen,socket_create_pair,socket_listen,socket_接受socket_bind,socket_strerror,pcntl_fork,pcntl_signal,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,openlog,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,虚拟,姓名

+0

disable_classes在我的php.ini文件中为空。你的意思是我必须把这些列表作为它的价值吗? –

0

我的文件是这样的:

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

您可能也有权限问题...将所有内容设置为777,尝试执行此操作,并将权限再次设置为正常... – ShaunOReilly

0

的问题是, “默认” 行了 “https” 开头,而 “商店” 行了 “HTTP”。

使用phpMyAdmin来执行这个SQL命令:

SELECT * FROM `core_config_data` WHERE path like '%secure/base_url' 

然后检查所有安全行开始以 “https”。