WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Linux, UNIX, Open Source (http://www.wcm.at/forum/forumdisplay.php?f=13)
-   -   Apache mit PHP (http://www.wcm.at/forum/showthread.php?t=157095)

coolgreyhound 27.01.2005 14:14

Apache mit PHP
 
Hallo Linux-Freunde!

Habe eine Woody-Server bei dem ich eine LAMP-Konfiguration brauche. Nun, installiert und eingerichtet ist ja alles. Im Root-Verzeichnis (/var/www/) vom Apache funktioniert auch eine PHP-Script (habe dazu eine phpinfo gemacht). Nur wenn ich ein Verzeichnis mache und dort die Scripts reinstelle, funktionierts leider nicht mehr.Gebe ja zu das ich nicht gerade eine Apache-Gurou bin ;)

Verwende folgende Konfiguration:
Apache 1.3.26
PHP 4.1.2

Sloter 27.01.2005 14:48

Userrechte prüfen, chmod 755.......

Ein Königreich für eine Fehlermeldung :D

Sloter

coolgreyhound 27.01.2005 15:02

Habe deinen Rat befolgt, aber leider, das wars nicht. Fehlermeldung habe ich keine. Wenn ich so ein Script im Browser anspreche, fragt der Browser was er damit tun soll, öffnen mit oder speichern. Obwohl das File in der Meldung eindeutig als PHP file erkannt wird.

T.dot 27.01.2005 15:10

Das Problem hatte ich mal, weil ich zwar php installiert hatte aber in der httpd.conf (denke die wars) ned drinstand, was er mit PHP Dateien machen sollte - das trat aber bei allen PHP Dateien auf und nicht nur bei denen in Unterverzeichnissen.
Was genau eingetragen werden muss steht in der Step by Step Hilfe von der PHP Installation.

mfg Thomas

coolgreyhound 27.01.2005 15:20

Ja, denke ich habe alles Berücksichtigt.

Ausschnitte aus httpd.conf:
Zitat:


LoadModule php4_module /usr/lib/apache/1.3/libphp4.so

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.cgi index.php
</IfModule>

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

m@rio 27.01.2005 16:57

Zitat:

Original geschrieben von coolgreyhound
Ausschnitte aus httpd.conf:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Und wo in der httpd.conf hast du das hinzugefügt? Eventuell innerhalb von einem <Directory></Directory> Block?
Dann gilt der Eintrag nämlich nur für jeweilige Directory.

coolgreyhound 28.01.2005 10:41

Nein, leider nicht. Habe die Anweisungen nur auskommentiert welche innerhalb der mod_mime.c liegen. Dieses Modul wird auch geladen. Die Einzige Fehlermeldung im Apachelog ist, dass er das Magic-File nicht lesen kann. Dürfte aber eine andere Baustelle sein *g*

m@rio 28.01.2005 21:09

Poste mal deine httpd.conf. Am Besten ohne Leerzeilen und Comments.
Etwa so: cat httpd.conf |grep -v -e "#" -e ^$ > dateiname.txt
Domainnamen und IPs kannst du ja maskieren. Ich kann die Konfig dann mal an meinem Apache ausprobieren.

coolgreyhound 31.01.2005 12:08

Mache ich gerne :)

Teil1:
ServerType standalone
ServerRoot /etc/apache
LockFile /var/lock/apache.lock
PidFile /var/run/apache.pid
ScoreBoardFile /var/run/apache.scoreboard
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150
MaxRequestsPerChild 100
LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config.so
LoadModule mime_magic_module /usr/lib/apache/1.3/mod_mime_magic.so
LoadModule mime_module /usr/lib/apache/1.3/mod_mime.so
LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
LoadModule status_module /usr/lib/apache/1.3/mod_status.so
LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
LoadModule access_module /usr/lib/apache/1.3/mod_access.so
LoadModule auth_module /usr/lib/apache/1.3/mod_auth.so
LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
LoadModule unique_id_module /usr/lib/apache/1.3/mod_unique_id.so
LoadModule setenvif_module /usr/lib/apache/1.3/mod_setenvif.so
LoadModule perl_module /usr/lib/apache/1.3/mod_perl.so
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
ExtendedStatus On
Port 80
User www-data
Group www-data
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options SymLinksIfOwnerMatch
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
UserDir public_html
</IfModule>
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Order deny,allow
Deny from all
</Limit>
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.cgi index.php
</IfModule>
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
UseCanonicalName On
TypesConfig /etc/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile share/magic
</IfModule>
HostnameLookups Off
ErrorLog /var/log/apache/error.log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %v" f
ull
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %P %T" d
ebug
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combine
d
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog /var/log/apache/access.log combined

coolgreyhound 31.01.2005 12:09

Teil2:
ServerSignature On
Alias /icons/ /usr/share/apache/icons/
<Directory /usr/share/apache/icons>
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin/>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
<IfModule mod_autoindex.c>
IndexOptions FancyIndexing NameWidth=*
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/deb.gif .deb
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README
HeaderName HEADER
</IfModule>
<IfModule mod_mime.c>
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .ee
AddLanguage fr .fr
AddLanguage de .de
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddCharset ISO-2022-JP .jis
AddLanguage pl .po
AddCharset ISO-8859-2 .iso-pl
AddLanguage pt .pt
AddLanguage pt-br .pt-br
AddLanguage ltz .lu
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .se
AddLanguage cz .cz
<IfModule mod_negotiation.c>
LanguagePriority en da nl et fr de el it ja pl pt pt-br ltz ca es sv
</IfModule>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-tar .tgz
AddType image/bmp .bmp
AddType text/x-hdml .hdml
</IfModule>
AddDefaultCharset on
<IfModule mod_setenvif.c>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>
<IfModule mod_perl.c>
Alias /perl/ /var/www/perl/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>
Alias /doc/ /usr/share/doc/
<Location /doc>
order deny,allow
deny from all
allow from 127.0.0.0/255.0.0.0
Options Indexes FollowSymLinks MultiViews
</Location>
<IfModule mod_proxy.c>
</IfModule>


Alle Zeitangaben in WEZ +2. Es ist jetzt 12:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag