【问题标题】:Test for .htaccess rewrites failed.htaccess 重写测试失败
【发布时间】:2014-09-11 11:00:53
【问题描述】:

我正在尝试安装 SugarCRM Enterprise 7.2,但在系统检查期间不断收到此错误:

.htaccess 重写测试失败。这通常意味着您没有 为 Sugar 目录设置 AllowOverride。

我正在使用 LAMP 运行 Ubuntu 14.04,我正在尝试将 Sugar 安装到本地路径

var/www/html/sugar_ent_7

我都试过了

<Directory /var/www/ >
    Allowoverride All
    Order allow,deny
    Allow from all
    </Directory> 

<Directory /var/www/html/sugar_ent_7 >
Allowoverride All
Order allow,deny
Allow from all
</Directory> 

给我的

/etc/apache2/apache2.conf

文件,但没有结果。我也试过做一个

/etc/apache2/sites-available/sugar_ent_7.conf

包含此代码的文件

<Directory /var/www/html/sugar_ent_7>
        Order allow,deny
        Allow from All
        AllowOverride All
</Directory>

还是什么都没有。我做错了什么?

【问题讨论】:

  • 这些更改后您是否重新启动或重新加载了 apache?
  • 是的,每次更改后
  • 这是什么system check?通过将相同的垃圾(随机)文本放在您的 .htaccess 顶部来验证您的 .htaccess 是否启用,并查看它是否会生成 500(内部服务器)错误?
  • 当您安装 SugarCRM 时,它会检查您的系统是否支持您尝试安装的版本。那是系统检查。如果您的服务器配置未正确设置,Sugar 无法正常工作,则会显示错误。 .htaccess 已启用,当我在其中放入一些垃圾时出现 500 错误。
  • 任何实用程序都无法检查 .htaccess 是否已启用。按照我的建议进行测试。

标签: apache .htaccess ubuntu sugarcrm


【解决方案1】:

当 Sugar 在系统检查期间尝试通过 IP 寻址自身时,也会发生此错误(具有误导性?)。配置虚拟主机后,它无法通过 IP 找到自己,因此主机文件的条目可以解决此问题。在终端输入:

vi /etc/hosts

然后添加运行 Sugar 的系统的 IP 以及您引用的 URL,例如:

123.234.123.234 subdomain.host.com

【讨论】:

    【解决方案2】:

    我遇到了同样的问题。

    它的目的只是检查您的 .htaccess 中是否存在以下代码:

    # install/installSystemCheck.php
    <IfModule mod_rewrite.c>                                                                             
        RewriteEngine On                                                                                 
        RewriteBase {$basePath}                                                                          
        RewriteRule ^itest.txt$ install_test.txt [N,QSA]                                                 
    </IfModule>
    

    我认为 SugarCRM 不足以检查此设置,所以我们将其注释掉并使其通过:

    # 
    //    if($res != "SUCCESS") {                                                                     
    if(false) {                                                                                   
    ....
    

    【讨论】:

      【解决方案3】:

      运行命令

      a2enmod rewrite;
      

      在您的终端中并重新启动您的 apache。
      希望这会有所帮助。

      【讨论】:

        【解决方案4】:
        # BEGIN SUGARCRM RESTRICTIONS
        RedirectMatch 403 (?i).*\.log$
        RedirectMatch 403 (?i)/+not_imported_.*\.txt
        RedirectMatch 403 (?i)/+(soap|cache|xtemplate|data|examples|include|log4php|metadata|modules)/+.*\.(php|tpl)
        RedirectMatch 403 (?i)/+emailmandelivery\.php
        RedirectMatch 403 (?i)/+upload
        RedirectMatch 403 (?i)/+custom/+blowfish
        RedirectMatch 403 (?i)/+cache/+diagnostic
        RedirectMatch 403 (?i)/+files\.md5$
        # END SUGARCRM RESTRICTIONS
        <IfModule mod_rewrite.c>
            Options +FollowSymLinks
            RewriteEngine On
            RewriteBase /dir
            RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jslang&module=app_strings&lang=$1 [L,QSA]
            RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoint=jslang&module=$1&lang=$2 [L,QSA]
        </IfModule>
        <FilesMatch "\.(jpg|png|gif|js|css|ico)$">
                <IfModule mod_headers.c>
                        Header set ETag ""
                        Header set Cache-Control "max-age=2592000"
                        Header set Expires "01 Jan 2112 00:00:00 GMT"
                </IfModule>
        </FilesMatch>
        <IfModule mod_expires.c>
                ExpiresByType text/css "access plus 1 month"
                ExpiresByType text/javascript "access plus 1 month"
                ExpiresByType application/x-javascript "access plus 1 month"
                ExpiresByType image/gif "access plus 1 month"
                ExpiresByType image/jpg "access plus 1 month"
                ExpiresByType image/png "access plus 1 month"
        </IfModule>
        

        【讨论】:

        • 你能解释一下你的答案,而不是在这里转储代码吗?
        猜你喜欢
        • 2020-09-29
        • 2011-06-05
        • 1970-01-01
        • 1970-01-01
        • 2020-03-23
        • 2018-07-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多