2014-01-31 36 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」。