peterla
Goto Top

PHP funktioniert nicht auf VirtualHosts

Hallo!

Ich kenne mich zwar grundsätzlich mit Linux aus, allerdings nicht so mit Apache.

Nun habe ich einen Apache aufgesetzt und auch phpmyadmin draufgetan, alles funktionierte gut. Dann habe ich Virtual Hosts eingerichtet, da dann die Webspaces mehrerer Domains auf diesem Server liegen sollen.
Nun funktioniert aber kein php-Skript mehr, und zwar auf keinem vHost, vorher ging noch alles. Ich hab dann durch Google herausgefunden, dass das PHP-Modul nicht aktiviert sein könnte, war es auch schinbar nicht, also flugs
sudo a2enmod php7.0 eingegeben
und jetzt startet Apache nicht mehr.

systemctl status apache2.service sagt:

Jan 20 08:09:25 srv-01 apache2[20984]:  * The apache2 configtest failed.
Jan 20 08:09:25 srv-01 apache2[20984]: Output of config test was:
Jan 20 08:09:25 srv-01 apache2[20984]: [Sat Jan 20 08:09:25.937907 2018] [:crit]
Jan 20 08:09:25 srv-01 apache2[20984]: AH00013: Pre-configuration failed
Jan 20 08:09:25 srv-01 apache2[20984]: Action 'configtest' failed.  
Jan 20 08:09:25 srv-01 apache2[20984]: The Apache error log may have more inform
Jan 20 08:09:25 srv-01 systemd[1]: apache2.service: Control process exited, code
Jan 20 08:09:25 srv-01 systemd[1]: Failed to start LSB: Apache2 web server.
Jan 20 08:09:25 srv-01 systemd[1]: apache2.service: Unit entered failed state.
Jan 20 08:09:25 srv-01 systemd[1]: apache2.service: Failed with result 'exit-cod  

Tja, und nun weiß ich nicht weiter. Die erste Seite der Google-Lösungen hab ich schon durch, und leider nichts gefunden, was funktioniert hat.

Falls ihr noch was braucht, gerne.

Grüße!

Content-Key: 361822

Url: https://administrator.de/contentid/361822

Printed on: April 25, 2024 at 11:04 o'clock

Member: maretz
maretz Jan 20, 2018 at 13:19:07 (UTC)
Goto Top
Nun - wenn du dich mit Linux auskennst sollte doch das "action 'configtest' failed" ins auge springen... Und dann könnte der nächste Weg ins Log-Verzeichnis führen, wo es (wie bei Linux üblich) auch gerne ne Error-Log gibt die man sich ja mal angucken könnte... Da steht normal drin was ihm an der Config nicht passt. Vom einfachen Typo bis hin zu fehlender Konfig ist ja alles möglich
Member: peterla
peterla Jan 20, 2018 updated at 13:48:54 (UTC)
Goto Top
Hallo!
Vielleicht sollte man doch von oben zu lesen anfangen - sorry, mein Fehler!

Hier die Apache-error.log (Ich hoffe, dass ich die richtige erwischt habe, sie ist ja relativ leer. Loglevel steht auf debug):
[Sat Jan 20 08:02:59.289160 2018] [mpm_event:notice] [pid 19359:tid 140295691949952] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat Jan 20 08:02:59.289350 2018] [core:notice] [pid 19359:tid 140295691949952] AH00094: Command line: '/usr/sbin/apache2'  
[Sat Jan 20 08:04:17.023603 2018] [mpm_event:notice] [pid 19359:tid 140295691949952] AH00491: caught SIGTERM, shutting down

Und hier ist nochwas nach einem Neustart:

[Sat Jan 20 08:46:31.925485 2018] [mpm_event:notice] [pid 21501:tid 140358839433088] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Sat Jan 20 08:46:31.925610 2018] [mpm_event:info] [pid 21501:tid 140358839433088] AH00490: Server built: 2017-09-18T15:09:02
[Sat Jan 20 08:46:31.925627 2018] [core:notice] [pid 21501:tid 140358839433088] AH00094: Command line: '/usr/sbin/apache2'  
[Sat Jan 20 08:46:31.925634 2018] [core:debug] [pid 21501:tid 140358839433088] log.c(1546): AH02639: Using SO_REUSEPORT: yes (1)
[Sat Jan 20 08:46:31.925844 2018] [mpm_event:debug] [pid 21504:tid 140358766094080] event.c(2094): AH02471: start_threads: Using epoll
[Sat Jan 20 08:46:31.925852 2018] [mpm_event:debug] [pid 21505:tid 140358766094080] event.c(2094): AH02471: start_threads: Using epoll
[Sat Jan 20 08:46:50.156928 2018] [core:info] [pid 21501:tid 140358839433088] AH00096: removed PID file /var/run/apache2/apache2.pid (pid=21501)
[Sat Jan 20 08:46:50.156974 2018] [mpm_event:notice] [pid 21501:tid 140358839433088] AH00491: caught SIGTERM, shutting down
Grüße!
Member: Pjordorf
Pjordorf Jan 20, 2018 at 17:36:11 (UTC)
Goto Top
Hallo,

Zitat von @peterla:
Hier die Apache-error.log (Ich hoffe, dass ich die richtige erwischt habe
Was genau willst du uns damit sagen? Das du hunderte Apache-error.log hast oder das diese im System verstreut sind oder oder oder?

Ich kenne mich zwar grundsätzlich mit Linux aus,
Und? Welche Linuxdistribution nutzt du denn überhaupt?

[Sat Jan 20 08:46:50.156974 2018] [mpm_event:notice] [pid 21501:tid 140358839433088] AH00491: caught SIGTERM, shutting down
Warum?

Gruß,
Peter
Member: NetzwerkDude
Solution NetzwerkDude Jan 20, 2018 at 18:11:10 (UTC)
Goto Top
der Apache bringt ein tool mit dem er seine eigene konfiguration auf fehler prüfen kann, der befehl da zu lautet:
apachectl configtest
mit etwas glück gibt es die betroffene datei und die fehlerhafte zeile aus

Mehr dazu in der Apache hilfe:
https://httpd.apache.org/docs/2.4/programs/apachectl.html