Problem z przeładowaniem apache2

Pytania i problemy
zarządzanie, www
MastereQ
MastereQ
root@vps16365:/etc/nginx/sites-enabled# sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

Jak chce przeładować apache wyskakuje taki błąd. Chcę to naprawić by pterodactyl działał z phpmyadmin

KrEdEnS
KrEdEnS Moderator Freebies

Chcesz używać apache2, używając jednocześnie nginxa? Tak się nie da, albo ogórki albo ogrodnika córki ;)

KMatuszak
KMatuszak Weteran

KrEdEnS:

Tak się nie da

Dlaczego nie? Nie widzę przeszkód, wystarczy w jednym z nich zmienić domyślne porty na inne.

W ogóle skąd pewność że problemem są dwie usługi działające na tym samym porcie? Równie dobrze ten problem może wynikać z błędnej konfiguracji serwera.

KrEdEnS
KrEdEnS Moderator Freebies

KMatuszak:

Dlaczego nie? Nie widzę przeszkód, wystarczy w jednym z nich zmienić domyślne porty na inne. Oczywiście, że się da ale po zadanym pytaniu, wątpię że używa obu, raczej przez przypadek zainstalował oba i boryka się z problemem używając preinstalowanych konfiguracji tych serwerów WWW.

@MastereQ wpisz i pokaż co pokazuje systemctl status apache2.service

MastereQ
MastereQ

KrEdEnS:

systemctl status apache2.service root@vps14645:~# systemctl status apache2.service ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: Drop-In: /lib/systemd/system/apache2.service.d └─apache2-systemd.conf Active: failed (Result: exit-code) since Tue 2021-07-20 15:54:45 UTC; 2h 13mi Process: 30201 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCES Process: 30822 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAIL Main PID: 10062 (code=exited, status=0/SUCCESS)

Jul 20 15:54:45 vps14645 apachectl[30822]: AH00558: apache2: Could not reliably
Jul 20 15:54:45 vps14645 apachectl[30822]: (98)Address already in use: AH00072:
Jul 20 15:54:45 vps14645 apachectl[30822]: (98)Address already in use: AH00072:
Jul 20 15:54:45 vps14645 apachectl[30822]: no listening sockets available, shutt
Jul 20 15:54:45 vps14645 apachectl[30822]: AH00015: Unable to open logs
Jul 20 15:54:45 vps14645 apachectl[30822]: Action 'start' failed.
Jul 20 15:54:45 vps14645 apachectl[30822]: The Apache error log may have more in
Jul 20 15:54:45 vps14645 systemd[1]: apache2.service: Control process exited, co
Jul 20 15:54:45 vps14645 systemd[1]: apache2.service: Failed with result 'exit-c
Jul 20 15:54:45 vps14645 systemd[1]: Failed to start The Apache HTTP Server.
lines 1-19/19 (END)...skipping...
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Tue 2021-07-20 15:54:45 UTC; 2h 13min ago
  Process: 30201 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 30822 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
 Main PID: 10062 (code=exited, status=0/SUCCESS)

Jul 20 15:54:45 vps14645 apachectl[30822]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Jul 20 15:54:45 vps14645 apachectl[30822]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Jul 20 15:54:45 vps14645 apachectl[30822]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Jul 20 15:54:45 vps14645 apachectl[30822]: no listening sockets available, shutting down
Jul 20 15:54:45 vps14645 apachectl[30822]: AH00015: Unable to open logs
Jul 20 15:54:45 vps14645 apachectl[30822]: Action 'start' failed.
Jul 20 15:54:45 vps14645 apachectl[30822]: The Apache error log may have more information.
Jul 20 15:54:45 vps14645 systemd[1]: apache2.service: Control process exited, code=exited status=1
Jul 20 15:54:45 vps14645 systemd[1]: apache2.service: Failed with result 'exit-code'.
Jul 20 15:54:45 vps14645 systemd[1]: Failed to start The Apache HTTP Server.
KrEdEnS
KrEdEnS Moderator Freebies

MastereQ:

Jul 20 15:54:45 vps14645 apachectl[30822]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 Jul 20 15:54:45 vps14645 apachectl[30822]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80


Prawdopodobnie używasz już nginxa i port 80 zajmuje właśnie on.
MastereQ
MastereQ

ta mam nginxa

KrEdEnS
KrEdEnS Moderator Freebies

Ok, i tu pojawia się pytanie po co Ci apache, skoro możesz używać nginxa. Jeżeli faktycznie chcesz dodatkowo używać apache (ze względu np na htaccess) to zmień port na vhoście w apache i zrób revers proxy na nginx, żeby serwować WWW na 80 i 443. Jeżeli chcesz zostać na nginx i używać htaccessa zainteresuj się https://github.com/e404/htaccess-for-nginx

W sumie to wait, pterodactyla masz na nginx czy apache2

MastereQ
MastereQ

nginxa jednak nie potrzebuje bo panel moge miec na apache2 ale gdy wpisuje "systemctl restart apache2" to wywala erora:

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

nginxa odinstalowalem za pomoca "sudo apt purge nginx"

KrEdEnS
KrEdEnS Moderator Freebies

Spróbuj zrestartować vpsa i luknij na logi apache2 systemctl status apache2.service

MastereQ
MastereQ

jak to zrobic XD

KrEdEnS
KrEdEnS Moderator Freebies

reboot -n - zrestartuje serwer (wyłączy i włączy) potem sprawdź czy apache2 się włączy, jak nie no to pokaż logi dodatkowo po restarcie profilaktycznie wpisz service nginx status

MastereQ
MastereQ

KrEdEnS:

service nginx status

root@vps14645:~# service nginx status
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: en
   Active: failed (Result: exit-code) since Tue 2021-07-20 19:25:59 UTC; 1min 19
     Docs: man:nginx(8)
  Process: 803 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process o

Jul 20 19:25:59 vps14645 systemd[1]: Starting A high performance web server and
Jul 20 19:25:59 vps14645 nginx[803]: nginx: [emerg] open() "/etc/nginx/sites-ena
Jul 20 19:25:59 vps14645 nginx[803]: nginx: configuration file /etc/nginx/nginx.
Jul 20 19:25:59 vps14645 systemd[1]: nginx.service: Control process exited, code
Jul 20 19:25:59 vps14645 systemd[1]: nginx.service: Failed with result 'exit-cod
Jul 20 19:25:59 vps14645 systemd[1]: Failed to start A high performance web serv
lines 1-12/12 (END)...skipping...
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2021-07-20 19:25:59 UTC; 1min 19s ago
     Docs: man:nginx(8)
  Process: 803 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Jul 20 19:25:59 vps14645 systemd[1]: Starting A high performance web server and a reverse proxy server...
Jul 20 19:25:59 vps14645 nginx[803]: nginx: [emerg] open() "/etc/nginx/sites-enabled/pterodactyl.conf" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
Jul 20 19:25:59 vps14645 nginx[803]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jul 20 19:25:59 vps14645 systemd[1]: nginx.service: Control process exited, code=exited status=1
Jul 20 19:25:59 vps14645 systemd[1]: nginx.service: Failed with result 'exit-code'.
Jul 20 19:25:59 vps14645 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
KrEdEnS
KrEdEnS Moderator Freebies

Usuń nginx będą na roocie apt purge nginx

MastereQ
MastereQ

mam usuniete bo wyskakuje 0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

KrEdEnS
KrEdEnS Moderator Freebies

Ok, spróbuj service nginx stop service apache2 restart

MastereQ
MastereQ

KrEdEnS:

service apache2 restart

root@vps14645:# service nginx stop Failed to get properties: Unit name mariadb-extra@.socket is neither a valid invocation ID nor unit name. Failed to get properties: Unit name mariadb@.socket is neither a valid invocation ID nor unit name. root@vps14645:# service apache2 restart

teraz jak chce wejsc do pterodaktyla to wywala blad: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0".

psycha siada

dobra ogarnalem to z apache2

system
system

Ten temat został automatycznie zamknięty 32 dni po ostatnim wpisie. Tworzenie nowych odpowiedzi nie jest już możliwe.