2014-09-11 28 views
2

我试图安装SugarCRM的企业7.2和系统检查期间,我不断收到此错误:试验的.htaccess重写失败

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

我运行Ubuntu 14.04与LAMP,和我试图糖业安装到本地路径

无功/ 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> 

,仍然一无所获。我究竟做错了什么?

+0

您是否在这些更改后重新启动或重新加载apache? – ovi 2014-09-11 11:04:31

+0

是的,每次更改后 – 2014-09-11 11:06:10

+0

这个“系统检查”是什么?验证你的'.htaccess'是否启用,通过在你的'.htaccess'上放置相同的垃圾(随机)文本,看看它是否会产生500(内部服务器)错误? – anubhava 2014-09-11 11:28:48

回答

4

在终端运行命令

a2enmod rewrite; 

,并重新启动你的Apache。
希望这会有所帮助。

1

我遇到了同样的问题。

其目的只是为了检查你的.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) {                     
.... 
-1
# 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> 
+1

你能解释一下你的答案,而不是只是在这里倾销代码吗? – Robert 2016-10-02 17:52:56

1

也(误导?)时,糖分会尝试在系统检查期间,以解决自身VI IP出现此错误。当配置虚拟主机时,它无法通过IP找到自己,因此通过hosts文件可以解决这个问题。在终端中输入:

vi /etc/hosts 

然后使用您引用的URL添加系统Sugar的IP,例如,:

123.234.123.234 subdomain.host.com