Apache PHP läuft nicht

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
Lockslay
Beiträge: 216
Registriert: 22.08.2002 17:51:19
Kontaktdaten:

Apache PHP läuft nicht

Beitrag von Lockslay » 10.02.2017 11:52:51

Hallo zusammen,

nachdem ich Probleme mit meinem LAMP Server hatte, habe ich den Apache2 Server gelöscht und neu installiert.
Problem an der Sache: Apache2 läuft PHP bekomme ich nicht zum laufen bzw. wenn ich eine PHP info Datei aufrufe wird diese Date heruntergeladen und nicht als PHP Datei angezeigt.
Ich habe jetzt einmal gestest lokaleIP/iredwas...

404 Not Found
nginx/1.6.2
Ist das mit nginx/ 1.6.2 ok ? Habe den apache installiert.

Die Neuinstallation lief so:

Code: Alles auswählen

apt-get remove --purge apache2
apt-get autoremove

Code: Alles auswählen

Installiere Apache2
apt-get install apache2
/etc/init.d/apache2 restart

Code: Alles auswählen

[ ok ] Restarting apache2 (via systemctl): apache2.service.
root@debianserver:/home/lockslay#
Apache läuft.
Ich habe versucht alle wichtigen Dateien / Dokumente herausszusuchen.
Wenn weiter Informationen benötigt werden, bitte melden!

systemctl status apache2.service

Code: Alles auswählen


● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─forking.conf
   Active: inactive (dead) since Fr 2017-02-10 11:56:09 CET; 1min 28s ago
  Process: 3909 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 3881 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Feb 10 11:56:09 debianserver apache2[3881]: Starting web server: apache2(98)...0
Feb 10 11:56:09 debianserver apache2[3881]: (98)Address already in use: AH00...0
Feb 10 11:56:09 debianserver apache2[3881]: no listening sockets available, ...n
Feb 10 11:56:09 debianserver apache2[3881]: AH00015: Unable to open logs
Feb 10 11:56:09 debianserver apache2[3881]: Action 'start' failed.
Feb 10 11:56:09 debianserver apache2[3881]: The Apache error log may have mo....
Feb 10 11:56:09 debianserver apache2[3881]: .
Feb 10 11:56:09 debianserver apache2[3909]: Stopping web server: apache2.
Feb 10 11:56:09 debianserver systemd[1]: Started LSB: Apache2 web server.
Hint: Some lines were ellipsized, use -l to show in full.
apache2 –t

Code: Alles auswählen


[Fri Feb 10 11:58:34.421711 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Fri Feb 10 11:58:34.421947 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Feb 10 11:58:34.422049 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Feb 10 11:58:34.422129 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Feb 10 11:58:34.422267 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Feb 10 11:58:34.525201 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Feb 10 11:58:34.526058 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Feb 10 11:58:34.526169 2017] [core:warn] [pid 6179] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}
journalctl -u apache2.service -p debug -n 30

Code: Alles auswählen


-- Logs begin at Do 2017-02-09 10:56:39 CET, end at Fr 2017-02-10 11:59:31 CET.
Feb 09 14:20:43 debianserver systemd[1]: Starting LSB: Apache2 web server...
Feb 09 14:20:44 debianserver apache2[11467]: Starting web server: apache2(98)Add
Feb 09 14:20:44 debianserver apache2[11467]: (98)Address already in use: AH00072
Feb 09 14:20:44 debianserver apache2[11467]: no listening sockets available, shu
Feb 09 14:20:44 debianserver apache2[11467]: AH00015: Unable to open logs
Feb 09 14:20:44 debianserver apache2[11467]: Action 'start' failed.
Feb 09 14:20:44 debianserver apache2[11467]: The Apache error log may have more
Feb 09 14:20:44 debianserver apache2[11467]: .
Feb 09 14:20:44 debianserver apache2[11494]: Stopping web server: apache2.
Feb 09 14:20:44 debianserver systemd[1]: Started LSB: Apache2 web server.
Feb 09 14:34:17 debianserver systemd[1]: Starting LSB: Apache2 web server...
Feb 09 14:34:17 debianserver apache2[27223]: Starting web server: apache2(98)Add
Feb 09 14:34:17 debianserver apache2[27223]: (98)Address already in use: AH00072
Feb 09 14:34:17 debianserver apache2[27223]: no listening sockets available, shu
Feb 09 14:34:17 debianserver apache2[27223]: AH00015: Unable to open logs
Feb 09 14:34:17 debianserver apache2[27223]: Action 'start' failed.
Feb 09 14:34:17 debianserver apache2[27223]: The Apache error log may have more
Feb 09 14:34:17 debianserver apache2[27223]: .
Feb 09 14:34:17 debianserver apache2[27243]: Stopping web server: apache2.
Feb 09 14:34:17 debianserver systemd[1]: Started LSB: Apache2 web server.
Feb 10 11:56:08 debianserver systemd[1]: Starting LSB: Apache2 web server...
Feb 10 11:56:09 debianserver apache2[3881]: Starting web server: apache2(98)Addr
lines 1-23...skipping...
-- Logs begin at Do 2017-02-09 10:56:39 CET, end at Fr 2017-02-10 11:59:31 CET. --
Feb 09 14:20:43 debianserver systemd[1]: Starting LSB: Apache2 web server...
Feb 09 14:20:44 debianserver apache2[11467]: Starting web server: apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Feb 09 14:20:44 debianserver apache2[11467]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Feb 09 14:20:44 debianserver apache2[11467]: no listening sockets available, shutting down
Feb 09 14:20:44 debianserver apache2[11467]: AH00015: Unable to open logs
Feb 09 14:20:44 debianserver apache2[11467]: Action 'start' failed.
Feb 09 14:20:44 debianserver apache2[11467]: The Apache error log may have more information.
Feb 09 14:20:44 debianserver apache2[11467]: .
Feb 09 14:20:44 debianserver apache2[11494]: Stopping web server: apache2.
Feb 09 14:20:44 debianserver systemd[1]: Started LSB: Apache2 web server.
Feb 09 14:34:17 debianserver systemd[1]: Starting LSB: Apache2 web server...
Feb 09 14:34:17 debianserver apache2[27223]: Starting web server: apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Feb 09 14:34:17 debianserver apache2[27223]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Feb 09 14:34:17 debianserver apache2[27223]: no listening sockets available, shutting down
Feb 09 14:34:17 debianserver apache2[27223]: AH00015: Unable to open logs
Feb 09 14:34:17 debianserver apache2[27223]: Action 'start' failed.
Feb 09 14:34:17 debianserver apache2[27223]: The Apache error log may have more information.
Feb 09 14:34:17 debianserver apache2[27223]: .
Feb 09 14:34:17 debianserver apache2[27243]: Stopping web server: apache2.
Feb 09 14:34:17 debianserver systemd[1]: Started LSB: Apache2 web server.
Feb 10 11:56:08 debianserver systemd[1]: Starting LSB: Apache2 web server...
Feb 10 11:56:09 debianserver apache2[3881]: Starting web server: apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Feb 10 11:56:09 debianserver apache2[3881]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Feb 10 11:56:09 debianserver apache2[3881]: no listening sockets available, shutting down
Feb 10 11:56:09 debianserver apache2[3881]: AH00015: Unable to open logs
Feb 10 11:56:09 debianserver apache2[3881]: Action 'start' failed.
Feb 10 11:56:09 debianserver apache2[3881]: The Apache error log may have more information.
Feb 10 11:56:09 debianserver apache2[3881]: .
Feb 10 11:56:09 debianserver apache2[3909]: Stopping web server: apache2.
Feb 10 11:56:09 debianserver systemd[1]: Started LSB: Apache2 web server.


apache2ctl configtest

Code: Alles auswählen

Syntax OK
Da ich den Apache und PHP neu installiert habe dürfte nichts an den Datei sein ich habe aber einmal meine Conf Dateien zur Kontrolle hochgeladen:

cat apache2.conf | pastebinit
http://paste.debian.net/913662/
cat ports.conf | pastebinit
http://paste.debian.net/913663/



Kann mir eine helfen eine neue Apache2 Installation aufzusetzen ?

Gruß
Lockslay

thoerb
Beiträge: 1677
Registriert: 01.08.2012 15:34:53
Lizenz eigener Beiträge: MIT Lizenz

Re: Apache PHP läuft nicht

Beitrag von thoerb » 10.02.2017 13:31:59

Debianlibapache2-mod-php5 hast du auch installiert?

Ansonsten schau erst mal nach, ob du das alles so gemacht hast: https://wiki.debian.org/LaMp

thoerb
Beiträge: 1677
Registriert: 01.08.2012 15:34:53
Lizenz eigener Beiträge: MIT Lizenz

Re: Apache PHP läuft nicht

Beitrag von thoerb » 10.02.2017 13:43:15

Lockslay hat geschrieben: 404 Not Found
nginx/1.6.2
Ist das mit nginx/ 1.6.2 ok ? Habe den apache installiert.
Dann schau doch mal nach, ob nginx installiert ist.

Code: Alles auswählen

dpkg -l | grep nginx

Lockslay
Beiträge: 216
Registriert: 22.08.2002 17:51:19
Kontaktdaten:

Re: Apache PHP läuft nicht

Beitrag von Lockslay » 10.02.2017 21:02:53

Hallo

dpkg -l | grep nginx

Code: Alles auswählen

ii  nginx-common                          1.6.2-5+deb8u4                       all          small, powerful, scalable web/proxy server - common files
ii  nginx-full                            1.6.2-5+deb8u4                       amd64        nginx web/proxy server (standard version)
apt-get remove nginx-common
apt-get remove nginx-ful
Apache neu gestartet.


dpkg -l | grep apache2

Code: Alles auswählen

ii  apache2                               2.4.10-10+deb8u7                     amd64        Apache HTTP Server
ii  apache2-bin                           2.4.10-10+deb8u7                     amd64        Apache HTTP Server (modules and other binary files)
ii  apache2-data                          2.4.10-10+deb8u7                     all          Apache HTTP Server (common files)
ii  apache2-doc                           2.4.10-10+deb8u7                     all          Apache HTTP Server (on-site documentation)
ii  apache2-mpm-prefork                   2.4.10-10+deb8u7                     amd64        transitional prefork MPM package for apache2
ii  apache2-utils                         2.4.10-10+deb8u7                     amd64        Apache HTTP Server (utility programs for web servers)
rc  apache2.2-bin                         2.4.10-10                            amd64        Transitional package for apache2-bin
rc  apache2.2-common                      2.4.10-10                            amd64        Transitional package for apache2
ii  libapache2-mod-dnssd                  0.6-3.1                              amd64        Zeroconf support for Apache 2 via avahi
ii  libapache2-mod-evasive                1.10.1-3                             amd64        evasive module to minimize HTTP DoS or brute force attacks
ii  libapache2-mod-perl2                  2.0.9~1624218-2+deb8u1               amd64        Integration of perl with the Apache2 web server
ii  libapache2-mod-php5                   5.6.30+dfsg-0+deb8u1                 amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-python                 3.3.1-11                             amd64        Python-embedding module for Apache 2
ii  libapache2-reload-perl                0.12-3                               all          module for reloading Perl modules when changed on disk

dpkg -l | grep php

Code: Alles auswählen

ii  libapache2-mod-php5                   5.6.30+dfsg-0+deb8u1                 amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-gettext                           1.0.11-1                             all          read gettext MO files directly, without requiring anything other than PHP
ii  php-tcpdf                             6.0.093+dfsg-1                       all          PHP class for generating PDF files on-the-fly
ii  php5                                  5.6.30+dfsg-0+deb8u1                 all          server-side, HTML-embedded scripting language (metapackage)
ii  php5-cli                              5.6.30+dfsg-0+deb8u1                 amd64        command-line interpreter for the php5 scripting language
ii  php5-common                           5.6.30+dfsg-0+deb8u1                 amd64        Common files for packages built from the php5 source
ii  php5-gd                               5.6.30+dfsg-0+deb8u1                 amd64        GD module for php5
ii  php5-json                             1.3.6-1                              amd64        JSON module for php5
ii  php5-mcrypt                           5.6.30+dfsg-0+deb8u1                 amd64        MCrypt module for php5
ii  php5-mysql                            5.6.30+dfsg-0+deb8u1                 amd64        MySQL module for php5
ii  php5-readline                         5.6.30+dfsg-0+deb8u1                 amd64        Readline module for php5
ii  phpmyadmin                            4:4.2.12-2+deb8u2                    all          MySQL web administration tool



apt-get install libapache2-mod-php5

Code: Alles auswählen

Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
libapache2-mod-php5 ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Danke für den Link, habe es soweit geprüft bis auf phpmyadmin lief alles durch.

Trotzdem php wird als Download angeboten :?:

Gruß Lockslay

thoerb
Beiträge: 1677
Registriert: 01.08.2012 15:34:53
Lizenz eigener Beiträge: MIT Lizenz

Re: Apache PHP läuft nicht

Beitrag von thoerb » 10.02.2017 21:26:36

Was passiert denn, wenn du das hier:

Code: Alles auswählen

<?PHP
phpinfo ();
als info.php in /var/www/html/ abspeicherst und dann im Browser aufrufst? Wird die Datei dann auch zum Download angeboten?

Lockslay
Beiträge: 216
Registriert: 22.08.2002 17:51:19
Kontaktdaten:

Re: Apache PHP läuft nicht

Beitrag von Lockslay » 10.02.2017 21:30:18

Hallo,

ja wird sie.

Habe aber eben

Code: Alles auswählen

dpkg-reconfigure phpmyadmin
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
Replacing config file /etc/phpmyadmin/config-db.php with new version
apache2_invoke: Enable configuration phpmyadmin
root@debianserver:/home/lockslay# dpkg-reconfigure libapache2-mod-php5
apache2_invoke php5: already enable
Auf phpmyadmin komme ich aber das ist doch in PHP geschrieben :wink:
Wenn ich IP/info.php gehe kommt den Download

schwedenmann
Beiträge: 5528
Registriert: 30.12.2004 15:31:07
Wohnort: Wegberg

Re: Apache PHP läuft nicht

Beitrag von schwedenmann » 10.02.2017 21:32:27

Hallo


Du mußt doch afaik auch php5-fpm installieren und dann

systemctl enable php5-fpm
systemctl start php5-fpm.service ausführen.

Dann kannst du die info.php im Browser aufrufen und solltest die entsprechenden infos angezeigt bekommen.

mfg
schwedenmann

Lockslay
Beiträge: 216
Registriert: 22.08.2002 17:51:19
Kontaktdaten:

Re: Apache PHP läuft nicht

Beitrag von Lockslay » 10.02.2017 21:40:23

Hallo,

danke es läuft :THX: :hail:
Frage mich nur warum
systemctl enable php5-fpm
apt-get install php5-fpm

nicht in den Anleitungen steht ?

Gruß
Lockslay

Lockslay
Beiträge: 216
Registriert: 22.08.2002 17:51:19
Kontaktdaten:

Re: Apache PHP läuft nicht

Beitrag von Lockslay » 10.02.2017 21:58:22

Hallo,

Apache ist ofline :oops:
Habe eben noch eine ssl Installation nachgelegt.
Nach dieser Anleitung:
https://www.linuxmuster.net/wiki/dokume ... -ssl-setup

Habe die ganze Installation hier :

http://nopaste.debianforum.de/39741

/etc/init.d/apache2 restart

Code: Alles auswählen

[....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
 failed!
Ich kann nicht mehr :(

thoerb
Beiträge: 1677
Registriert: 01.08.2012 15:34:53
Lizenz eigener Beiträge: MIT Lizenz

Re: Apache PHP läuft nicht

Beitrag von thoerb » 10.02.2017 21:59:41

Lockslay hat geschrieben: Frage mich nur warum
systemctl enable php5-fpm
apt-get install php5-fpm
nicht in den Anleitungen steht ?
Auf meinem Homeserver ist es nicht installiert und darauf laufen einige PHP-Web-Awendungen. Ich denke eher, der Fehler lag bei dir irgendwo in der Konfiguration.

Lockslay
Beiträge: 216
Registriert: 22.08.2002 17:51:19
Kontaktdaten:

Re: Apache PHP läuft nicht

Beitrag von Lockslay » 11.02.2017 11:49:10

Hallo,
/etc/init.d/apache2 restart

Code: Alles auswählen

[....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
 failed!
Habe jetzt die systemctl status apache2.service und journalctl -xn gepostet.

systemctl status apache2

Code: Alles auswählen

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─forking.conf
   Active: failed (Result: exit-code) since Fr 2017-02-10 22:09:38 CET; 13h ago
  Process: 2229 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 2192 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
  Process: 4123 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Feb 10 22:09:17 debianserver apache2[4123]: Starting web server: apache2(98)...3
Feb 10 22:09:38 debianserver apache2[4123]: failed!
Feb 10 22:09:38 debianserver apache2[4123]: The apache2 instance did not sta....
Feb 10 22:09:38 debianserver systemd[1]: apache2.service: control process ex...1
Feb 10 22:09:38 debianserver systemd[1]: Failed to start LSB: Apache2 web se....
Feb 10 22:09:38 debianserver systemd[1]: Unit apache2.service entered failed....
Hint: Some lines were ellipsized, use -l to show in full.

systemctl status journalctl

Code: Alles auswählen

● journalctl.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
Kann aber leider nichts finden, was wo falsch läuft bzw. was ich ändern muss.
Kann mir hier einer helfen ?

Gruß
Lockslay

Antworten