[gelöst] apache2: Nur php-Dateien werden ausgeliefert (und durch php-fpm ausgeführt). Alle anderen Dateien Error 500

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
floogy
Beiträge: 125
Registriert: 19.04.2006 22:43:15

[gelöst] apache2: Nur php-Dateien werden ausgeliefert (und durch php-fpm ausgeführt). Alle anderen Dateien Error 500

Beitrag von floogy » 10.08.2020 20:37:39

Einer der Seiten, die ich lokal in virtual box buster betreibe verhält sich merkwürdig.

Es werden ausschließlich PHP-Dateien ausgeliefert und dann auch ausgeführt. *.css, *.png, *.ico und auch *.htm[l] Dateien werden mit einem Internal Server Error 500 quittiert.
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at g3@ggserve.de to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.
"GET /upgrade/index.php HTTP/1.1" 200
"GET /upgrade/upgrade.css HTTP/1.1" 500


pv10:~apache2# tail -n20 -f /var/log/{php7.0-fpm.log,php5.6-fpm.log,apache2/g2fc.ggserve.eu_error.log,apache2/g2fc.ggserve.eu_access.log}

Code: Alles auswählen

==> /var/log/php7.0-fpm.log <==
[10-Aug-2020 14:59:22] NOTICE: Terminating ...
[10-Aug-2020 14:59:22] NOTICE: exiting, bye-bye!
[10-Aug-2020 14:59:30] NOTICE: fpm is running, pid 19279
[10-Aug-2020 14:59:30] NOTICE: ready to handle connections
[10-Aug-2020 14:59:30] NOTICE: systemd monitor interval set to 10000ms
[10-Aug-2020 15:00:46] NOTICE: Terminating ...
[10-Aug-2020 15:00:46] NOTICE: exiting, bye-bye!
[10-Aug-2020 15:00:46] NOTICE: fpm is running, pid 20436
[10-Aug-2020 15:00:46] NOTICE: ready to handle connections
[10-Aug-2020 15:00:46] NOTICE: systemd monitor interval set to 10000ms
[10-Aug-2020 18:34:33] NOTICE: Terminating ...
[10-Aug-2020 18:34:33] NOTICE: exiting, bye-bye!
[10-Aug-2020 18:34:33] NOTICE: fpm is running, pid 4770
[10-Aug-2020 18:34:33] NOTICE: ready to handle connections
[10-Aug-2020 18:34:33] NOTICE: systemd monitor interval set to 10000ms
[10-Aug-2020 19:01:59] NOTICE: Terminating ...
[10-Aug-2020 19:01:59] NOTICE: exiting, bye-bye!
[10-Aug-2020 19:01:59] NOTICE: fpm is running, pid 11531
[10-Aug-2020 19:01:59] NOTICE: ready to handle connections
[10-Aug-2020 19:01:59] NOTICE: systemd monitor interval set to 10000ms

==> /var/log/php5.6-fpm.log <==
[10-Aug-2020 20:02:35] NOTICE: Terminating ...
[10-Aug-2020 20:02:35] NOTICE: exiting, bye-bye!
[10-Aug-2020 20:02:35] NOTICE: fpm is running, pid 26259
[10-Aug-2020 20:02:35] NOTICE: ready to handle connections
[10-Aug-2020 20:02:35] NOTICE: systemd monitor interval set to 10000ms
[10-Aug-2020 20:05:26] NOTICE: Terminating ...
[10-Aug-2020 20:05:26] NOTICE: exiting, bye-bye!
[10-Aug-2020 20:05:26] NOTICE: fpm is running, pid 27306
[10-Aug-2020 20:05:26] NOTICE: ready to handle connections
[10-Aug-2020 20:05:26] NOTICE: systemd monitor interval set to 10000ms
[10-Aug-2020 20:12:18] NOTICE: Terminating ...
[10-Aug-2020 20:12:18] NOTICE: exiting, bye-bye!
[10-Aug-2020 20:12:18] NOTICE: fpm is running, pid 28532
[10-Aug-2020 20:12:18] NOTICE: ready to handle connections
[10-Aug-2020 20:12:18] NOTICE: systemd monitor interval set to 10000ms
[10-Aug-2020 20:13:20] NOTICE: Terminating ...
[10-Aug-2020 20:13:20] NOTICE: exiting, bye-bye!
[10-Aug-2020 20:13:20] NOTICE: fpm is running, pid 28686
[10-Aug-2020 20:13:20] NOTICE: ready to handle connections
[10-Aug-2020 20:13:20] NOTICE: systemd monitor interval set to 10000ms

==> /var/log/apache2/g2fc.ggserve.eu_error.log <==
[Mon Aug 10 20:14:45.398632 2020] [proxy:debug] [pid 28688:tid 140156812986112] proxy_util.c(2578): [client 172.16.240.37:1337] AH00947: connected /home/gerhard/www/docs/gallery2/gallery2/upgrade/index.php to httpd-UDS:0
[Mon Aug 10 20:14:45.398664 2020] [proxy:debug] [pid 28688:tid 140156812986112] proxy_util.c(2949): AH02823: FCGI: connection established with Unix domain socket /run/php/php5.6-fpm.sock (127.0.0.1)
[Mon Aug 10 20:14:45.413679 2020] [proxy:debug] [pid 28688:tid 140156812986112] proxy_util.c(2331): AH00943: FCGI: has released connection for (127.0.0.1)[Mon Aug 10 20:14:45.489532 2020] [core:alert] [pid 28688:tid 140156711458560] [client 172.16.240.37:1337] /home/gerhard/www/docs/gallery2/gallery2/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://g2fc.ggserve.eu:81/upgrade/index.php
[Mon Aug 10 20:14:45.514096 2020] [core:alert] [pid 28687:tid 140156669495040] [client 172.16.240.37:1338] /home/gerhard/www/docs/gallery2/gallery2/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://g2fc.ggserve.eu:81/upgrade/index.php
[Mon Aug 10 20:14:45.568901 2020] [core:alert] [pid 28688:tid 140156694673152] [client 172.16.240.37:1339] /home/gerhard/www/docs/gallery2/gallery2/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Mon Aug 10 20:16:44.425672 2020] [authz_core:debug] [pid 28688:tid 140156677887744] mod_authz_core.c(846): [client 172.16.240.37:1524] AH01628: authorization result: granted (no directives)
[Mon Aug 10 20:16:44.425727 2020] [proxy_fcgi:debug] [pid 28688:tid 140156677887744] mod_proxy_fcgi.c(109): [client 172.16.240.37:1524] AH01060: set r->filename to proxy:fcgi://127.0.0.1:9001/home/gerhard/www/docs/gallery2/gallery2/upgrade/index.php
[Mon Aug 10 20:16:44.425752 2020] [proxy:debug] [pid 28688:tid 140156677887744] mod_proxy.c(1249): [client 172.16.240.37:1524] AH01143: Running scheme fcgi handler (attempt 0)
[Mon Aug 10 20:16:44.425762 2020] [proxy_fcgi:debug] [pid 28688:tid 140156677887744] mod_proxy_fcgi.c(1021): [client 172.16.240.37:1524] AH01076: url: fcgi://127.0.0.1:9001/home/gerhard/www/docs/gallery2/gallery2/upgrade/index.php proxyname: (null) proxyport: 0
[Mon Aug 10 20:16:44.425773 2020] [proxy_fcgi:debug] [pid 28688:tid 140156677887744] mod_proxy_fcgi.c(1028): [client 172.16.240.37:1524] AH01078: serving
URL fcgi://127.0.0.1:9001/home/gerhard/www/docs/gallery2/gallery2/upgrade/index.php
[Mon Aug 10 20:16:44.425785 2020] [proxy:debug] [pid 28688:tid 140156677887744] proxy_util.c(2316): AH00942: FCGI: has acquired connection for (127.0.0.1)[Mon Aug 10 20:16:44.425796 2020] [proxy:debug] [pid 28688:tid 140156677887744] proxy_util.c(2369): [client 172.16.240.37:1524] AH00944: connecting fcgi://127.0.0.1:9001/home/gerhard/www/docs/gallery2/gallery2/upgrade/index.php to 127.0.0.1:9001
[Mon Aug 10 20:16:44.425808 2020] [proxy:debug] [pid 28688:tid 140156677887744] proxy_util.c(2406): [client 172.16.240.37:1524] AH02545: fcgi: has determined UDS as /run/php/php5.6-fpm.sock
[Mon Aug 10 20:16:44.425819 2020] [proxy:debug] [pid 28688:tid 140156677887744] proxy_util.c(2578): [client 172.16.240.37:1524] AH00947: connected /home/gerhard/www/docs/gallery2/gallery2/upgrade/index.php to httpd-UDS:0
[Mon Aug 10 20:16:44.425850 2020] [proxy:debug] [pid 28688:tid 140156677887744] proxy_util.c(2949): AH02823: FCGI: connection established with Unix domain socket /run/php/php5.6-fpm.sock (127.0.0.1)
[Mon Aug 10 20:16:44.432447 2020] [proxy:debug] [pid 28688:tid 140156677887744] proxy_util.c(2331): AH00943: FCGI: has released connection for (127.0.0.1)[Mon Aug 10 20:16:44.565959 2020] [core:alert] [pid 28688:tid 140156669495040] [client 172.16.240.37:1524] /home/gerhard/www/docs/gallery2/gallery2/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://g2fc.ggserve.eu:81/upgrade/index.php
[Mon Aug 10 20:16:44.589393 2020] [core:alert] [pid 28687:tid 140156677887744] [client 172.16.240.37:1526] /home/gerhard/www/docs/gallery2/gallery2/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://g2fc.ggserve.eu:81/upgrade/index.php
[Mon Aug 10 20:16:44.643463 2020] [core:alert] [pid 28688:tid 140156821387008] [client 172.16.240.37:1527] /home/gerhard/www/docs/gallery2/gallery2/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

==> /var/log/apache2/g2fc.ggserve.eu_access.log <==
172.16.240.37 - - [10/Aug/2020:20:11:04 +0200] "GET /upgrade HTTP/1.1" 500 526 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:11:19 +0200] "GET /upgrade/index.php HTTP/1.1" 200 6972 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:11:19 +0200] "GET /upgrade/upgrade.css HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:11:19 +0200] "GET /upgrade/images/g2Logo_upgrade_head.png HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:12:21 +0200] "GET /upgrade/index.php HTTP/1.1" 404 16 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:12:30 +0200] "GET /upgrade HTTP/1.1" 500 526 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:13:15 +0200] "GET /upgrade/index.php HTTP/1.1" 404 16 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:13:24 +0200] "GET /upgrade/index.php HTTP/1.1" 200 6766 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:13:24 +0200] "GET /upgrade/images/g2Logo_upgrade_head.png HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:13:24 +0200] "GET /upgrade/upgrade.css HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:14:45 +0200] "GET /upgrade/index.php HTTP/1.1" 200 6972 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:14:45 +0200] "GET /upgrade/upgrade.css HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:14:45 +0200] "GET /upgrade/images/g2Logo_upgrade_head.png HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:14:45 +0200] "GET /favicon.ico HTTP/1.1" 500 526 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101
Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:16:44 +0200] "GET /upgrade/index.php HTTP/1.1" 200 6972 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:16:44 +0200] "GET /upgrade/upgrade.css HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:16:44 +0200] "GET /upgrade/images/g2Logo_upgrade_head.png HTTP/1.1" 500 526 "http://g2fc.ggserve.eu:81/upgrade/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:20:16:44 +0200] "GET /favicon.ico HTTP/1.1" 500 526 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101
Firefox/79.0"

pv10:~apache2# for i in {apache2.conf,conf-enabled/other-vhosts-access-log.conf,conf-available/php5.6-cgi.conf,conf-enabled/php5.6-fpm.conf,mods-enabled/fcgid.conf,mods-enabled/fcgid.load,mods-enabled/proxy.conf,mods-enabled/proxy.load,mods-enabled/proxy_fcgi.load,mods-enabled/vhost_alias.load,ports.conf,sites-enabled/g2fc.ggserve.eu.conf,sites-enabled/g2.ggserve.eu.conf,README}; do echo -e "___________________________________\n\n$(ls "$i";egrep -nv '#|^;|^ *$' "$i")"; done

Code: Alles auswählen

___________________________________

apache2.conf
50:ServerRoot "/etc/apache2"
66:PidFile ${APACHE_PID_FILE}
71:Timeout 300
77:KeepAlive On
84:MaxKeepAliveRequests 100
90:KeepAliveTimeout 15
102:<IfModule mpm_prefork_module>
103:    StartServers          1
104:    MinSpareServers       1
105:    MaxSpareServers      2
106:    MaxClients          150
107:    MaxRequestsPerChild   0
108:</IfModule>
117:<IfModule mpm_worker_module>
118:    StartServers          1
119:    MaxClients          150
120:    MinSpareThreads      1
121:    MaxSpareThreads      2
122:    ThreadsPerChild       2
123:    MaxRequestsPerChild   0
124:</IfModule>
127:User ${APACHE_RUN_USER}
128:Group ${APACHE_RUN_GROUP}
136:AccessFileName .htaccess
142:<Files ~ "^\.ht">
143:    Order allow,deny
144:    Deny from all
145:</Files>
167:HostnameLookups Off
175:ErrorLog /var/log/apache2/error.log
183:LogLevel debug
186:Include /etc/apache2/mods-enabled/*.load
187:Include /etc/apache2/mods-enabled/*.conf
193:Include /etc/apache2/ports.conf
200:LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
201:LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
202:LogFormat "%h %l %u %t \"%r\" %>s %b" common
203:LogFormat "%{Referer}i -> %U" referer
204:LogFormat "%{User-agent}i" agent
208:CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined
279:Include /etc/apache2/conf.d/
282:Include /etc/apache2/sites-enabled/
___________________________________

conf-enabled/other-vhosts-access-log.conf
2:CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined
___________________________________

conf-available/php5.6-cgi.conf
8:<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
9:    SetHandler application/x-httpd-php
10:</FilesMatch>
12:<FilesMatch ".+\.phps$">
13:    SetHandler application/x-httpd-php-source
17:    Require all denied
18:</FilesMatch>
20:<FilesMatch "^\.ph(p[3457]?|t|tml|ps)$">
21:    Require all denied
22:</FilesMatch>
___________________________________

conf-enabled/php5.6-fpm.conf
2:<IfModule !mod_php5.c>
3:<IfModule proxy_fcgi_module>
5:    <IfModule setenvif_module>
6:    SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
7:    </IfModule>
9:    <FilesMatch ".+\.ph(p[3457]?|t|tml)$">
10:        SetHandler "proxy:unix:/run/php/php5.6-fpm.sock|fcgi://localhost"
11:    </FilesMatch>
12:    <FilesMatch ".+\.phps$">
16:        Require all denied
17:    </FilesMatch>
19:    <FilesMatch "^\.ph(p[3457]?|t|tml|ps)$">
20:        Require all denied
21:    </FilesMatch>
22:</IfModule>
23:</IfModule>
___________________________________

mods-enabled/fcgid.conf
1:<IfModule mod_fcgid.c>
2:  FcgidConnectTimeout 20
4:  <IfModule mod_mime.c>
5:    AddHandler fcgid-script .fcgi
6:  </IfModule>
7:</IfModule>
___________________________________

mods-enabled/fcgid.load
1:LoadModule fcgid_module /usr/lib/apache2/modules/mod_fcgid.so
___________________________________

mods-enabled/proxy.conf
1:<IfModule mod_proxy.c>
25:</IfModule>
___________________________________

mods-enabled/proxy.load
1:LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
___________________________________

mods-enabled/proxy_fcgi.load
2:LoadModule proxy_fcgi_module /usr/lib/apache2/modules/mod_proxy_fcgi.so
___________________________________

mods-enabled/vhost_alias.load
1:LoadModule vhost_alias_module /usr/lib/apache2/modules/mod_vhost_alias.so
___________________________________

ports.conf
6:Listen 81
8:<IfModule ssl_module>
9:      Listen 443
10:</IfModule>
12:<IfModule mod_gnutls.c>
13:     Listen 443
14:</IfModule>
___________________________________

sites-enabled/g2fc.ggserve.eu.conf
1:<VirtualHost *:81>
9:      ServerName g2fc.ggserve.eu
11:     ServerAdmin g3@ggserve.de
12:     DocumentRoot /home/gerhard/www/docs/gallery2/gallery2/
31:     ErrorLog ${APACHE_LOG_DIR}/g2fc.ggserve.eu_error.log
32:     CustomLog ${APACHE_LOG_DIR}/g2fc.ggserve.eu_access.log combined
45:    ProxyPassMatch ^/(.*.php(/.*)?)$ unix:/run/php/php5.6-fpm.sock|fcgi://127.0.0.1:9001/home/gerhard/www/docs/gallery2/gallery2
55:<Directory /home/gerhard/www/docs/gallery2/gallery2>
56:    AllowOverride FileInfo Options
57:</Directory>
59:</VirtualHost>
___________________________________

sites-enabled/g2.ggserve.eu.conf
1:<VirtualHost *:81>
9:      ServerName g2fc.ggserve.eu
11:     ServerAdmin g3@ggserve.de
12:     DocumentRoot /home/gerhard/www/docs/gallery2/gallery2/
31:     ErrorLog ${APACHE_LOG_DIR}/g2fc.ggserve.eu_error.log
32:     CustomLog ${APACHE_LOG_DIR}/g2fc.ggserve.eu_access.log combined
45:    ProxyPassMatch ^/(.*.php(/.*)?)$ unix:/run/php/php5.6-fpm.sock|fcgi://127.0.0.1:9001/home/gerhard/www/docs/gallery2/gallery2
55:<Directory /home/gerhard/www/docs/gallery2/gallery2>
56:    AllowOverride FileInfo Options
57:</Directory>
59:</VirtualHost>
___________________________________

README
1:Apache2 Configuration under Debian GNU/Linux
2:============================================
4:Debian's default Apache2 installation attempts to make adding and
5:removing modules, virtual hosts, and extra configuration directives as
6:flexible is possible, in order to make automating the changes and
7:administering the server as easy as possible.
9:Files and Directories in /etc/apache2:
10:-------------------------------------
12:apache2.conf
14:     This is the main configuration file.
16:conf.d/
18:     Files in this directory are included by this line in
19:     apache2.conf:
22:     Include /etc/apache2/conf.d
24:     This is a good place to add additional configuration
25:     directives.
27:httpd.conf
29:     Empty file.
31:magic
33:     Magic data for mod_mime_magic Apache module, documented in
34:     htdocs/manual/mod/mod_mime_magic.html.  You probably don't
35:     need to touch this.
37:mods-available/
39:     This directory contains a series of .load and .conf files.
40:     The .load files contain the Apache configuration directive
41:     necessary to load the module in question.  The respective
42:     .conf files contain configuration directives necessary to
43:     utilize the module in question.
45:mods-enabled/
47:     To actually enable a module for Apache2, it is necessary to
48:     create a symlink in this directory to the .load (and .conf, if
49:     it exists) files associated with the module in
50:     mods-available/.  For example:
52:     cgi.load -> /etc/apache2/mods-available/cgi.load
54:ports.conf
56:     Configuration directives for which ports and IP addresses to
57:     listen to.
59:sites-available/
61:     Like mods-available/, except it contains configuration
62:     directives for different virtual hosts that might be used with
63:     apache2.  Note that the hostname doesn't have to correspond
64:     exactly with the filename.  'default' is the default host.
66:sites-enabled/
68:     Similar in functionality to mods-enabled/, sites-enabled
69:     contains symlinks to sites in sites-available/ that the
70:     admnistrator wishes to enable.
72:     Example:
73:     dedasys -> /etc/apache2/sites-available/dedasys
75:Tools
76:-----
78:Currently, a2enmod and a2dismod are available for enabling and
79:disabling modules utilizing the above configuration system.
81:a2ensite and a2dissite have been added, which do essentially the
82:same thing as the above tools, but for sites rather than modules.
Zuletzt geändert von floogy am 11.08.2020 03:44:08, insgesamt 1-mal geändert.

floogy
Beiträge: 125
Registriert: 19.04.2006 22:43:15

Re: apache2: Nur php-Dateien werden ausgeliefert (und durch php-fpm ausgeführt). Alle anderen Dateien ergeben einen 500

Beitrag von floogy » 10.08.2020 20:44:04

Ooops, da ich den Symlink aus sites-enabled kopiert habe, nutzen beide die gleiche Konfiguration. Es liegt wohl eher an der PHP-Anwendung(?) (gallery2 aus Fedora core 25, mit Patches, um es angeblich für PHP 7.0 ausführbar zu machen. Ich habe die web application aus einer fc25 virtualbox herüberkopiert).

Code: Alles auswählen

pv10:~apache2# ls -l  /etc/apache2/sites-available/g2fc.ggserve.eu.conf
lrwxrwxrwx 1 root root 37 Aug  6 15:18 /etc/apache2/sites-available/g2fc.ggserve.eu.conf -> ../sites-available/g2.ggserve.eu.conf
Okay, hab's nun überarbeitet: Zum Vergleich nun die g2.3.1.ggserve.eu (diese funktioniert normal).
pv10:~apache2# egrep -nv '#|^;|^ *$' /etc/apache2/sites-available/g2.3.1.ggserve.eu.conf

Code: Alles auswählen

1:<VirtualHost *:81>
9:      ServerName g2.3.1.ggserve.eu
11:     ServerAdmin g3@ggserve.de
12:     DocumentRoot /home/gerhard/www/docs/gallery2.3.1_functional/
31:     ErrorLog ${APACHE_LOG_DIR}/g2.3.1.ggserve.eu_error.log
32:     CustomLog ${APACHE_LOG_DIR}/g2.3.1.ggserve.eu_access.log combined
44:     ProxyPassMatch ^/(.*.php(/.*)?)$ unix:/run/php/php5.6-fpm.sock|fcgi://127.0.0.1:9001/home/gerhard/www/docs/gallery2.3.1_functional
55:<Directory /home/gerhard/www/docs/gallery2.3.1_functional>
56:    AllowOverride FileInfo Options
57:</Directory>
59:</VirtualHost>
g2fc.ggserve.eu (alles zum Test lesbar 777 und www-data:www-data)

Code: Alles auswählen

pv10:~apache2# egrep -nv '#|^;|^ *$' /etc/apache2/sites-available/g2fc.ggserve.eu.conf
1:<VirtualHost *:81>
9:      ServerName g2fc.ggserve.eu
11:     ServerAdmin g3@ggserve.de
12:     DocumentRoot /home/gerhard/www/docs/gallery2/gallery2/
31:     ErrorLog ${APACHE_LOG_DIR}/g2fc.ggserve.eu_error.log
32:     CustomLog ${APACHE_LOG_DIR}/g2fc.ggserve.eu_access.log combined
46:    ProxyPassMatch ^/(.*.php(/.*)?)$ unix:/run/php/php7.0-fpm.sock|fcgi://127.0.0.1:9002/home/gerhard/www/docs/gallery2/gallery2
55:<Directory /home/gerhard/www/docs/gallery2/gallery2>
56:    AllowOverride FileInfo Options
57:</Directory>
59:</VirtualHost>

Code: Alles auswählen

pv10:~apache2# tail -f /var/log/apache2/g2.3.1.ggserve.eu_{error,access}.log
==> /var/log/apache2/g2.3.1.ggserve.eu_error.log <==
[Mon Aug 10 21:03:17.774794 2020] [proxy:debug] [pid 5592:tid 139892050818816] proxy_util.c(2406): [client 172.16.240.37:7010] AH02545: fcgi: has determined UDS as /run/php/php5.6-fpm.sock, referer: http://g2.3.1.ggserve.eu:81/main.php
[Mon Aug 10 21:03:17.774805 2020] [proxy:debug] [pid 5592:tid 139892050818816] proxy_util.c(2578): [client 172.16.240.37:7010] AH00947: connected /home/gerhard/www/docs/gallery2.3.1_functional/main.php to httpd-UDS:0, referer: http://g2.3.1.ggserve.eu:81/main.php
[Mon Aug 10 21:03:17.774836 2020] [proxy:debug] [pid 5592:tid 139892050818816] proxy_util.c(2949): AH02823: FCGI: connection established with Unix domain
socket /run/php/php5.6-fpm.sock (127.0.0.1)
[Mon Aug 10 21:03:17.778844 2020] [authz_core:debug] [pid 5593:tid 139892034033408] mod_authz_core.c(846): [client 172.16.240.37:7007] AH01628: authorization result: granted (no directives), referer: http://g2.3.1.ggserve.eu:81/main.php
[Mon Aug 10 21:03:17.797791 2020] [proxy:debug] [pid 5593:tid 139892050818816] proxy_util.c(2331): AH00943: FCGI: has released connection for (127.0.0.1)
[Mon Aug 10 21:03:17.814808 2020] [proxy:debug] [pid 5592:tid 139892075996928] proxy_util.c(2331): AH00943: FCGI: has released connection for (127.0.0.1)
[Mon Aug 10 21:03:17.857456 2020] [proxy:debug] [pid 5592:tid 139892159923968] proxy_util.c(2331): AH00943: FCGI: has released connection for (127.0.0.1)
[Mon Aug 10 21:03:17.965981 2020] [authz_core:debug] [pid 5593:tid 139892176709376] mod_authz_core.c(846): [client 172.16.240.37:7006] AH01628: authorization result: granted (no directives), referer: http://g2.3.1.ggserve.eu:81/main.php
[Mon Aug 10 21:03:17.966679 2020] [authz_core:debug] [pid 5592:tid 139892101175040] mod_authz_core.c(846): [client 172.16.240.37:7008] AH01628: authorization result: granted (no directives), referer: http://g2.3.1.ggserve.eu:81/main.php
[Mon Aug 10 21:03:18.413902 2020] [proxy:debug] [pid 5592:tid 139892050818816] proxy_util.c(2331): AH00943: FCGI: has released connection for (127.0.0.1)

==> /var/log/apache2/g2.3.1.ggserve.eu_access.log <==
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /main.php?g2_view=core.DownloadItem&g2_itemId=1834&g2_serialNumber=8 HTTP/1.1" 200 8621 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /main.php?g2_view=core.DownloadItem&g2_itemId=3068&g2_serialNumber=6 HTTP/1.1" 200 11166 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /themes/ajaxian/images/missing.png HTTP/1.1" 200 433 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /images/xhtml10.png HTTP/1.1" 200 321 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT
10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /main.php?g2_view=core.DownloadItem&g2_itemId=1453&g2_serialNumber=6 HTTP/1.1" 200 13837 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /main.php?g2_view=core.DownloadItem&g2_itemId=1631&g2_serialNumber=6 HTTP/1.1" 200 8621 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /main.php?g2_view=core.DownloadItem&g2_itemId=1627&g2_serialNumber=6 HTTP/1.1" 200 8621 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /modules/albumselect/images/join.gif HTTP/1.1" 200 69 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /modules/albumselect/images/plus.gif HTTP/1.1" 200 89 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"
172.16.240.37 - - [10/Aug/2020:21:03:17 +0200] "GET /main.php?g2_view=core.DownloadItem&g2_itemId=48&g2_serialNumber=3237 HTTP/1.1" 200 8091 "http://g2.3.1.ggserve.eu:81/main.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0"

floogy
Beiträge: 125
Registriert: 19.04.2006 22:43:15

Re: apache2: Nur php-Dateien werden ausgeliefert (und durch php-fpm ausgeführt). Alle anderen Dateien ergeben einen 500

Beitrag von floogy » 11.08.2020 03:42:42

Es gab eine .htaccess Datei im Root der webapp (gallery2) mit folgendem Eintrag:

Code: Alles auswählen

php_value memory_limit 24M
php_value error_reporting 30719
Möglicherweise noch von gallery1.5?

Jedenfalls findet sich dazu im log

Code: Alles auswählen

==> /var/log/apache2/g2fc.ggserve.eu_error.log <==
[Tue Aug 11 02:59:08.160040 2020] [core:alert] [pid 15737:tid 140333492991744] [client 172.16.240.37:19375] /home/gerhard/www/docs/gallery2fc/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://g2fc.ggserve.eu:81/install/index.php?step=7

Antworten