htaccess Problem

AndréS

New Member
Hallo,

ich habe mir einen neuen SHop runtergeladen. Magento. Habe auch den Anweisungen strickte Folge geleistet.
Jetzt sagt er mir aber Fehler 500.
Ich glaube das hängt mit der .htaccess Datei zusammen.
Es gibt da zwei, einmal die im Hauptordner ist und einmal eine unter dem Ordner Var

Hauptordner:
Code:
<IfModule mod_php5.c>
    php_flag magic_quotes_gpc off
    php_flag short_open_tag on
</IfModule>

DirectoryIndex index.php

RewriteEngine on

#RewriteBase /

RewriteCond %{REQUEST_URI} !^/media/
RewriteCond %{REQUEST_URI} !^/skin/
RewriteCond %{REQUEST_URI} !^/js/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php

und die die im Ordner Var ist:
Code:
Order deny,allow
Deny from all

Ich weiß nicht, muss ich noch irgendwelche Direktiven aktivieren oder was da einstellen? Denn jedesmal wenn ich die URL www.xxx.de/mag/ aufrufe, kommt ein Fehler.

Ich danke euch für jede Hilfe.
 

Till

Administrator
Schau bitte mal in das error.log der betroffenen Webseite und poste die Fehelermeldung aus dem Log.
 

AndréS

New Member
[Tue Oct 30 09:36:04 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:36:05 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://duwarstdabei.de/magento/install
[Tue Oct 30 09:36:58 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:37:24 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:37:28 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:37:31 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:38:49 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:38:49 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://duwarstdabei.de/magento/install/
[Tue Oct 30 09:38:51 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:38:55 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:38:55 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/magento/install/
[Tue Oct 30 09:38:56 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:38:56 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/magento/install/
[Tue Oct 30 09:38:58 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:38:59 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/magento/install/
[Tue Oct 30 09:38:59 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:38:59 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/magento/install/
[Tue Oct 30 09:39:00 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:39:00 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/magento/install/
[Tue Oct 30 09:39:01 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:39:01 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/magento/install/
[Tue Oct 30 09:41:30 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:43:07 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:43:08 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:43:09 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/magento
[Tue Oct 30 09:43:13 2007] [alert] [client 77.133.32.84] /var/www/web1/web/magento/.htaccess: php_flag not allowed here
[Tue Oct 30 09:44:02 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:44:04 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:44:04 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/mag
[Tue Oct 30 09:44:04 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:44:04 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/mag
[Tue Oct 30 09:44:08 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/images/spc.gif, referer: http://www.duwarstdabei.de/
[Tue Oct 30 09:55:07 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:55:09 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:55:09 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/mag
[Tue Oct 30 09:55:09 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:55:10 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/mag
[Tue Oct 30 09:55:10 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:55:10 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/mag
[Tue Oct 30 09:55:10 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here
[Tue Oct 30 09:55:11 2007] [error] [client 77.133.32.84] File does not exist: /var/www/web1/web/favicon.ico, referer: http://www.duwarstdabei.de/mag
[Tue Oct 30 09:55:11 2007] [alert] [client 77.133.32.84] /var/www/web1/web/mag/.htaccess: php_flag not allowed here

Hier das log, scheint als wenn das nicht erlaubt ist. Was mache ich denn da?
 

Till

Administrator
Entferne die Zeilen:

<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
php_flag short_open_tag on

</IfModule>

aus der .htaccess datei und füge sie stattdessen in das apache direktiven feld der webseite ein.
 

AndréS

New Member
Super, danke funktioniert.
Also aufruf funktioniert ohne probleme.

Jetzt lädt er aber stundenlang und kommt nicht zum ende :-( Na ja, mal sehn was das ist :)


Danke dir nochmal
 

hahni

Active Member
Ich setze ISPConfig 2.2.31 ein und habe folgende .htaccess für Magento:

---
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi

# Action php5-cgi /cgi-bin/php5-cgi
# AddHandler php5-cgi .php

############################################
## GoDaddy specific options

# Options -MultiViews

## you might also need to add this line to php.ini
## cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

#AddType x-mapp-php5 .php
#AddHandler x-mapp-php5 .php

############################################
## default index file

DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

# php_value memory_limit 64M
# php_value memory_limit 128M
# php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

# php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

# php_flag session.auto_start off

############################################
## enable resulting html compression

#php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

# php_flag suhosin.session.cryptua off

###########################################
# turn off compatibility with PHP4 when dealing with objects

# php_flag zend.ze1_compatibility_mode Off

</IfModule>

<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

<IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# Insert filter on all content
###SetOutputFilter DEFLATE
# Insert filter on selected content types only
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

# Netscape 4.x has some problems...
#BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
#BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
#SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary

</IfModule>

<IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

# SSLOptions StdEnvVars

</IfModule>

<IfModule mod_rewrite.c>

############################################
## enable rewrites

Options +FollowSymLinks
RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

#RewriteBase /magento/

############################################
## workaround for HTTP authorization
## in CGI environment

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## always send 404 on missing files in these folders

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

RewriteRule .* index.php [L]

</IfModule>


############################################
## Prevent character encoding issues from server overrides
## If you still have problems, use the second line instead

AddDefaultCharset Off
#AddDefaultCharset UTF-8

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/rules.html#expires

ExpiresDefault "access plus 1 year"

</IfModule>

############################################
## By default allow all access

Order allow,deny
Allow from all

############################################
## If running in cluster environment, uncomment this
## http://developer.yahoo.com/performance/rules.html#etags

#FileETag none

---

Es kommen immer 500ter...

---
[Sun Apr 05 20:16:54 2009] [alert] [client 95.90.52.175] /var/www/web999/web/.htaccess: Options not allowed here
[Sun Apr 05 20:16:54 2009] [alert] [client 95.90.52.175] /var/www/web999/web/.htaccess: Options not allowed here
---

In die VHost-Einstellung von ISPConfig habe ich nichts reingeschrieben...
 

hahni

Active Member
Habe die folgende Direktive im entsprechenden Feld von ISPConfig eingetragen (auch ohne den gewünschten Erfolg):

---
<Directory /var/www/web999/web/>
AllowOverride All
</Directory>
---
 

Till

Administrator
Lass mal in der Directory Directive den Slash am Ende weg. Wenn das auch nichts hilft dann liegt es zumindest nicht an ISPConfig.
 

hahni

Active Member
Guten Morgen Till,

grundsätzlich gehe ich IMMER davon aus, dass es kein Problem von ISPConfig ist. Alle Anwendungen laufen, nur mit Magento gibt es Probleme. Das spricht dafür, dass es nicht an ISPConfig liegen kann.

Ich habe zahlreiche Beiträge hier gefunden, die sich mit Magento und ISPConfig beschäftigen. Sogar ein Howto war dabei. Allerdings hat mir all das nichts geholfen.

Wie gehe ich nun strukturiert vor, um den Fehler herauszufinden und Magento lauffähig hinzubkeommen? Habe die Daten auf den Webspace übertragen.

Teilweise auch die .htaccess angepasst, weil es hieß, dass "php_flag" etc. auskommentiert werden soll. Doch all das hat nichts bewirkt...

Viele Grüße

Hahni
 

hahni

Active Member
Wenn ich im VHost-Eintrag wie von dir angesprochen die Werte abändere, gibt es trotzdem den gleichen Fehler:

---
<Directory /var/www/web999/web>
AllowOverride All
</Directory>
---

Und zwar den:

---
Fatal error: Uncaught exception 'Exception' with message 'Warning: file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/tmp/magento/var) is not within the allowed path(s): (/var/www/web999/) in /var/www/web999/web/app/code/core/Mage/Core/Model/Config.php on line 745' in /var/www/web999/web/app/code/core/Mage/Core/functions.php:246 Stack trace: #0 [internal function]: mageCoreErrorHandler(2, 'file_exists() [...', '/var/www/web999/...', 745, Array) #1 /var/www/web999/web/app/code/core/Mage/Core/Model/Config.php(745): file_exists('/tmp/magento/va...') #2 /var/www/web999/web/app/code/core/Mage/Core/Model/Config/Options.php(101): Mage_Core_Model_Config->createDirIfNotExists('/tmp/magento/va...') #3 /var/www/web999/web/app/code/core/Mage/Core/Model/Config/Options.php(39): Mage_Core_Model_Config_Options->getVarDir() #4 /var/www/web999/web/app/Mage.php(205): Mage_Core_Model_Config_Options->getDir('var') #5 /var/www/web999/web/app/Mage.php(641): Mage::getBaseDir('var') #6 /var/ in /var/www/web999/web/app/code/core/Mage/Core/functions.php on line 246
---
 

hunter999

New Member
Hallo Hahni,

nimm mal

Options +FollowSymLinks

raus. Dann sollte es gehen. Ansonsten kann ich auch mal meine htaccess posten, bei mir läuft der Shop.
Danach auf jeden Fall auch etwas warten!
Bei mir übernimmt der Server änderungen an der htaccess Datei erst nach ca. 5 min (gefühlt eine halbe Stunde ;-))


Generell muss ich hingegen sagen das die Sache mit der htaccess immer wieder, ich will mal sagen unschön ist. Warum funktionieren anscheind "normale" htaccess Dateien nie auf Anhieb richtig? Irgendwo muss doch ISPConfig seine Finger drin haben, oder sehe ich das falsch?
Ist das in der 3´er Version auch noch so?
 

fuxifux

Member
Hi,

Kann es sein, dass es daran liegt, dass Magneto versucht Zugriff auf: /tmp/magento/var zu bekommen, und das durch: open_basedir verhindert wird?
 

hahni

Active Member
Mahlzeit fuxifux,

sehr schön, dass du mich an deinen Erfahrungen teilhaben lässt. Also du hast folgende Arbeitsschritte durchgeführt:

1. ZIP entpackt und Inhalt auf Server übertragen
2. KEINE Änderungen an den Apache-Direktiven des Webs vorgenommen
3. .htaccess-Eintrag wie oben beschrieben geändert?

Mehr nicht? Oder fehlt noch ein Arbeitsschritt, den ich nicht erwähnt hatte?

Viele Grüße

Hahni
 

Till

Administrator
Dein Problem hat mit .htaccess überhaupt nichts zu tun, das allow override funktioniert also einwandfrei. Du hast Dein Magneto system falsch konfiguriert so dass es auf einen Ordner (/tmp/magento/var) zugreifen will auf den es natürlich garnicht zugreifen darf da er nicht innerhalb des Webs liegt. Du musst Deinen hop so umkonfigurieren dass er den temp Ordner inerhalb des web root Ordners benutzt und nict den globalen /tmp Ordner.
 

hahni

Active Member
Aber ich bin doch gar nicht der, der die Probleme mit dem "tmp"-Verzeichnis hat. Du meinst foxifux. Oder steht bei mir auch etwas von "tmp" und ich habe es nur übersehen?
 

hahni

Active Member
Hallo Till und Fuxifux,

leider habe ich keinerlei Einstellungen gefunden, wo man dies umsetzen kann. Dass zumindest dieser Fehler in keinem Zusammenhang mit ISPConfig steht, glaube ich gern. Würde sonst dieser Pfad von ISPConfig als TMP-Pfad vorgeschlagen?

Viele Grüße

Hahni
 

Werbung

Top