Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Hallo zusammen!
Die Ausgabe von "ls -la /var/www/web999/web/info.php" ist:
---
-rw-rw-r-- 1 web999_info web999 17 2008-04-03 01:47 /var/www/web999/web/info.php
---
Es sind sogar beide Checkboxen für CGI im Web von ISPConfig aktiviert. Die beiden für PHP-Haken habe ich natürlich deaktiviert, da hier ja die CGI-Version zum Einsatz kommen soll und ich nur so Konflikte vermeiden kann!
Und noch der guten Ordnung halber die Apache-Direktiven dieses Webs:
---
<Directory /var/www/web999/cgi-bin/>
Options ExecCGI
AllowOverride None
</Directory>
<Directory /var/www/web999/web/>
AllowOverride All
</Directory>
---
Und so die ".htaccess"-Datei, die im "/web"-Ordner liegt:
---
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi
AddHandler php5-cgi .php
Action php5-cgi cgi-bin/php5-cgi
############################################
## this line is specific for 1and1 hosting
#AddType x-mapp-php5 .php
############################################
## default index file
<IfModule mod_php5.c>
############################################
## adjust memory limit
php_value memory_limit 32M
php_value max_execution_time 18000
############################################
## disable magic quotes for php request vars
php_flag magic_quotes_gpc off
############################################
## enable php short tags for templates
php_flag short_open_tag on
</IfModule>
DirectoryIndex /web/
<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 /
############################################
## 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
Order allow,deny
Allow from all
---
Beim Aufruf der Seite erscheint allerdings immer gem. error-log:
---
[Thu Apr 03 11:01:43 2008] [error] Directory index forbidden by rule: /var/www/web999/web/
---
was könnte das sein? und wie muss die htaccess konfiguriert sein?
vielen lieben dank!
Die Ausgabe von "ls -la /var/www/web999/web/info.php" ist:
---
-rw-rw-r-- 1 web999_info web999 17 2008-04-03 01:47 /var/www/web999/web/info.php
---
Es sind sogar beide Checkboxen für CGI im Web von ISPConfig aktiviert. Die beiden für PHP-Haken habe ich natürlich deaktiviert, da hier ja die CGI-Version zum Einsatz kommen soll und ich nur so Konflikte vermeiden kann!
Und noch der guten Ordnung halber die Apache-Direktiven dieses Webs:
---
<Directory /var/www/web999/cgi-bin/>
Options ExecCGI
AllowOverride None
</Directory>
<Directory /var/www/web999/web/>
AllowOverride All
</Directory>
---
Und so die ".htaccess"-Datei, die im "/web"-Ordner liegt:
---
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
## it might be /cgi-bin/php-cgi
AddHandler php5-cgi .php
Action php5-cgi cgi-bin/php5-cgi
############################################
## this line is specific for 1and1 hosting
#AddType x-mapp-php5 .php
############################################
## default index file
<IfModule mod_php5.c>
############################################
## adjust memory limit
php_value memory_limit 32M
php_value max_execution_time 18000
############################################
## disable magic quotes for php request vars
php_flag magic_quotes_gpc off
############################################
## enable php short tags for templates
php_flag short_open_tag on
</IfModule>
DirectoryIndex /web/
<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 /
############################################
## 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
Order allow,deny
Allow from all
---
Beim Aufruf der Seite erscheint allerdings immer gem. error-log:
---
[Thu Apr 03 11:01:43 2008] [error] Directory index forbidden by rule: /var/www/web999/web/
---
was könnte das sein? und wie muss die htaccess konfiguriert sein?
vielen lieben dank!
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Code: Select all
DirectoryIndex /web/PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
und nach dem entfernten eintrag "DirectoryIndex /web/" sollte es funktionieren? sollte ich nicht besser die komplette direktive ausblenden?
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
wenn ich die direktive ausblende (mit "#"), dann erscheint im logfile:
---
[Mon Apr 07 12:54:37 2008] [error] [client 91.67.128.94] Invalid URI in request GET / HTTP/1.1
---
---
[Mon Apr 07 12:54:37 2008] [error] [client 91.67.128.94] Invalid URI in request GET / HTTP/1.1
---
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
huhu,
das bedeutet doch aber, dass ich die direktory-index-direktive "nur" anpassen muss, richtig? :?:
das bedeutet doch aber, dass ich die direktory-index-direktive "nur" anpassen muss, richtig? :?:
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
wenn ich den eintrag
---
DirectoryIndex /web/index.php
---
eintrage, dann erhalte ich nach einige "ladezeit" dennoch wieder einen fehler:
---
[Mon Apr 07 16:04:47 2008] [error] [client 91.67.11.247] Directory index forbidden by rule: /var/www/web999/web/
---
---
DirectoryIndex /web/index.php
---
eintrage, dann erhalte ich nach einige "ladezeit" dennoch wieder einen fehler:
---
[Mon Apr 07 16:04:47 2008] [error] [client 91.67.11.247] Directory index forbidden by rule: /var/www/web999/web/
---
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Ist das so schwer die Doku richtig zu lesen?
Code: Select all
DirectoryIndex index.phpRe: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Sicherlich nicht! ich habe den kasten unten drunter auch gelesen! aber das ergebnis ist in beiden fällen identisch!
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Kannst du direkt auf die index.php Zugreifen?
Wie ist der DocumentRoot?
Wie ist der DocumentRoot?
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
wenn ich direkt darauf zugreife, kommt unmittelbar ein 404er!
der dokument-root ist "/var/www/web999/web/"
der jetzt aufgetretene fehler laut log:
---
[Mon Apr 07 16:59:12 2008] [error] [client 91.67.11.247] Invalid URI in request GET / HTTP/1.1
[Mon Apr 07 17:06:01 2008] [error] [client 91.67.11.247] Invalid URI in request GET /index.php HTTP/1.1
---
der dokument-root ist "/var/www/web999/web/"
der jetzt aufgetretene fehler laut log:
---
[Mon Apr 07 16:59:12 2008] [error] [client 91.67.11.247] Invalid URI in request GET / HTTP/1.1
[Mon Apr 07 17:06:01 2008] [error] [client 91.67.11.247] Invalid URI in request GET /index.php HTTP/1.1
---
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
versuchs mal ohne rewrite
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
also ohne
---
RewriteBase /
---
?
---
RewriteBase /
---
?
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Am besten den ganzen <IfModule> block rausnehmen.
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
nix zu machen :(
---
[Mon Apr 07 17:15:20 2008] [error] [client 66.249.70.72] Invalid URI in request GET /index.php?cPath=1_9 HTTP/1.1
[Mon Apr 07 17:16:53 2008] [error] [client 66.249.70.72] Invalid URI in request GET /index.php?cPath=1_9 HTTP/1.1
[Mon Apr 07 17:30:10 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_info.php?cPath=&products_id=14 HTTP/1.1
[Mon Apr 07 17:36:42 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_reviews.php?products_id=17 HTTP/1.1
[Mon Apr 07 18:02:44 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_info.php?products_id=23&language=de HTTP/1.1
[Mon Apr 07 18:15:46 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_reviews.php?cPath=3_15&products_id=14 HTTP/1.1
[Mon Apr 07 18:22:14 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_reviews.php?products_id=14&language=es HTTP/1.1
[Mon Apr 07 18:27:27 2008] [error] [client 91.67.11.247] Invalid URI in request GET / HTTP/1.1
---
---
[Mon Apr 07 17:15:20 2008] [error] [client 66.249.70.72] Invalid URI in request GET /index.php?cPath=1_9 HTTP/1.1
[Mon Apr 07 17:16:53 2008] [error] [client 66.249.70.72] Invalid URI in request GET /index.php?cPath=1_9 HTTP/1.1
[Mon Apr 07 17:30:10 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_info.php?cPath=&products_id=14 HTTP/1.1
[Mon Apr 07 17:36:42 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_reviews.php?products_id=17 HTTP/1.1
[Mon Apr 07 18:02:44 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_info.php?products_id=23&language=de HTTP/1.1
[Mon Apr 07 18:15:46 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_reviews.php?cPath=3_15&products_id=14 HTTP/1.1
[Mon Apr 07 18:22:14 2008] [error] [client 66.249.70.72] Invalid URI in request GET /product_reviews.php?products_id=14&language=es HTTP/1.1
[Mon Apr 07 18:27:27 2008] [error] [client 91.67.11.247] Invalid URI in request GET / HTTP/1.1
---
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Und du bekommst wirklich ein 404er, "Invalid URI in request" kenne ich eigentlich nur in Zusammenhang mit 400 oder 500.
Was steht dazu im access log?
Funktioniert es ganz ohne .htaccess?
Was steht dazu im access log?
Funktioniert es ganz ohne .htaccess?
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
na klar, denn die fehlermeldung wird ja auch ausgegeben :(
stimmen überhaupt die apache-direktiven, die ich direkt im web angegeben habe?
---
<Directory /var/www/web999/cgi-bin/>
Options ExecCGI
AllowOverride None
</Directory>
<Directory /var/www/web999/web/>
AllowOverride All
</Directory>
---
da es sich um cgi-php handelt, glaube ich nicht, dass magento ohne htaccess funktionieren würde. ich habe ja extra die datei von denen selbst angepasst (scheinbar falsch oder unvollständig)!
stimmen überhaupt die apache-direktiven, die ich direkt im web angegeben habe?
---
<Directory /var/www/web999/cgi-bin/>
Options ExecCGI
AllowOverride None
</Directory>
<Directory /var/www/web999/web/>
AllowOverride All
</Directory>
---
da es sich um cgi-php handelt, glaube ich nicht, dass magento ohne htaccess funktionieren würde. ich habe ja extra die datei von denen selbst angepasst (scheinbar falsch oder unvollständig)!
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Einfach mal fleißig ausprobieren woran es hängt...
Ohne htaccess müsste er dir ja die index.php zum downloaden anbieten.
Hast du mal die komplette vhost config?
Ohne htaccess müsste er dir ja die index.php zum downloaden anbieten.
Hast du mal die komplette vhost config?
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
vielen dank, dass du dich meiner so annimmst!
in jedem fall ist es jetzt OHNE htaccess so, dass die datei nicht zum download angeboten wird, sondern im browser angezeigt. es wird also der quelltext der php angezeigt und nicht - wie von mir gewünscht - ausgeführt!
in jedem fall ist es jetzt OHNE htaccess so, dass die datei nicht zum download angeboten wird, sondern im browser angezeigt. es wird also der quelltext der php angezeigt und nicht - wie von mir gewünscht - ausgeführt!
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Dann liegt das Problem offensichtlich an der .htaccess
Minimal htaccess:
Sehr ungewöhnlich ;)
ScriptAlias ?
Minimal htaccess:
"cgi-bin/php5-cgi" relativer Pfad?AddHandler php5-cgi .php
Action php5-cgi cgi-bin/php5-cgi
Sehr ungewöhnlich ;)
ScriptAlias ?
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
alles ohne erfolg, denn ich habe "cgi-bin, "/cgi-bin" und auch "/var/www/web999/cgi-bin" probiert.
der error-log auszug:
---
[Mon Apr 07 19:52:29 2008] [error] [client 91.67.129.214] File does not exist: /var/www/web999/cgi-bin/php5-cgi/index.php
[Mon Apr 07 19:52:48 2008] [error] [client 91.67.129.214] Invalid URI in request GET / HTTP/1.1
[Mon Apr 07 19:53:12 2008] [error] [client 91.67.129.214] client denied by server configuration: /var/www/web999/web/var/www
---
also stimmt doch vermutlich die direktive im hauptweb nicht! oder die verzeichnisstruktur wird nicht richtig abgebildet.
"/cgi-bin" liegt auf der gleichen ebene wie "/web"!
der error-log auszug:
---
[Mon Apr 07 19:52:29 2008] [error] [client 91.67.129.214] File does not exist: /var/www/web999/cgi-bin/php5-cgi/index.php
[Mon Apr 07 19:52:48 2008] [error] [client 91.67.129.214] Invalid URI in request GET / HTTP/1.1
[Mon Apr 07 19:53:12 2008] [error] [client 91.67.129.214] client denied by server configuration: /var/www/web999/web/var/www
---
also stimmt doch vermutlich die direktive im hauptweb nicht! oder die verzeichnisstruktur wird nicht richtig abgebildet.
"/cgi-bin" liegt auf der gleichen ebene wie "/web"!
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
"/var/www/web999/cgi-bin/php5-cgi/index.php"
Wo kommt das den her?!?
Hast du php da in dein cgi-bin rein kopiert? irgendwelchen ScriptAliases's?
Gibt garantiert einige HowTos wie man php als cgi installiert. Guck dir die mal an...
Wo kommt das den her?!?
Hast du php da in dein cgi-bin rein kopiert? irgendwelchen ScriptAliases's?
Gibt garantiert einige HowTos wie man php als cgi installiert. Guck dir die mal an...
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
genau! in diesem verzeichnis liegt die php-cgi-binary! natürlich mit 0755!
soll ja auch nur für dieses web gelten! und die empfehlung habe ich so gemacht, wie es magento vorgegeben hat. allerdings ohne erfolg!
soll ja auch nur für dieses web gelten! und die empfehlung habe ich so gemacht, wie es magento vorgegeben hat. allerdings ohne erfolg!
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Hallo zusammen,
folgendes .htaccess wird für den Betrieb von Magento in Verbindung mit php-cgi empfohlen (mit von mir angepassten Pfaden):
---
<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
php_flag short_open_tag on
</IfModule>
Action php5-cgi cgi-bin/php5-cgi
AddHandler php5-cgi .php
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
---
Das Binary liegt im Verzeichnis "/cgi-bin" der Webpräsenz und die eigentlichen PHP-Skripte im Verzeichnis "/web"! Fehlermeldung: 400 (ungültige Syntax)!
Muss denn tatsächlich in den Direktiven der Webseite folgendes stehen oder sorgt dies gar für Probleme:
---
<Directory /var/www/web999/cgi-bin/>
Options ExecCGI
AllowOverride None
</Directory>
<Directory /var/www/web999/web/>
AllowOverride All
</Directory>
---
Vielen Dank für Eure Mithilfe
Hahni
folgendes .htaccess wird für den Betrieb von Magento in Verbindung mit php-cgi empfohlen (mit von mir angepassten Pfaden):
---
<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
php_flag short_open_tag on
</IfModule>
Action php5-cgi cgi-bin/php5-cgi
AddHandler php5-cgi .php
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
---
Das Binary liegt im Verzeichnis "/cgi-bin" der Webpräsenz und die eigentlichen PHP-Skripte im Verzeichnis "/web"! Fehlermeldung: 400 (ungültige Syntax)!
Muss denn tatsächlich in den Direktiven der Webseite folgendes stehen oder sorgt dies gar für Probleme:
---
<Directory /var/www/web999/cgi-bin/>
Options ExecCGI
AllowOverride None
</Directory>
<Directory /var/www/web999/web/>
AllowOverride All
</Directory>
---
Vielen Dank für Eure Mithilfe
Hahni
Re: Magento als php-cgi auf ISPConfig-System (htaccess-Probleme)
Übernehme bitte die mitgelieferte .htaccess und unkommentiere nur die ersten drei Optionen, nicht mehr. Wenn es dann widerum nicht funktionieren sollte, setze bitte die Loglevel hoch und poste die relevanten Logzeilen.
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
