2014-09-11 55 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