Apachte dont start / fail

Hallo Apache dont work any more
www.martindoornbos.nl

Error: ERROR: Restart of apache2 failed.

What does apachectl -t say?

Hi @martindoornbos

nginx is down too… at least there is nothing listening on ports 80,443 on your server or the ports are filtered.

The first thing you must do is to check the status of the services.

systemctl status nginx --no-pager -l
systemctl status apache2 --no-pager -l

Yo should also take a look to these logs:

/var/log/nginx/error.log
/var/log/apache2/error.log
1 Like

i dont have e recent log

[Sun Nov 17 00:03:15.525533 2024] [ssl:warn] [pid 15022:tid 15022] AH01909: 192.168.18.4:443:0 server certificate does NOT include an ID which matches the server name
[Sun Nov 17 00:03:15.527319 2024] [mpm_prefork:notice] [pid 15022:tid 15022] AH00163: Apache/2.4.62 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Sun Nov 17 00:03:15.527336 2024] [core:notice] [pid 15022:tid 15022] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 17 02:01:04.178439 2024] [mpm_prefork:notice] [pid 15022:tid 15022] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using server5.anay.nl. Set the 'ServerName' directive globally to suppress this message
[Sun Nov 17 02:01:04.479685 2024] [ssl:warn] [pid 15022:tid 15022] AH01909: 192.168.18.4:443:0 server certificate does NOT include an ID which matches the server name
[Sun Nov 17 02:01:04.481620 2024] [mpm_prefork:notice] [pid 15022:tid 15022] AH00163: Apache/2.4.62 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Sun Nov 17 02:01:04.481640 2024] [core:notice] [pid 15022:tid 15022] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 17 18:01:04.557013 2024] [mpm_prefork:notice] [pid 15022:tid 15022] AH00170: caught SIGWINCH, shutting down gracefully
[Sun Nov 17 18:09:32.487686 2024] [ssl:warn] [pid 2762:tid 2762] AH01909: 192.168.18.4:443:0 server certificate does NOT include an ID which matches the server name
[Sun Nov 17 18:09:32.541305 2024] [suexec:notice] [pid 2762:tid 2762] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Sun Nov 17 18:09:33.557995 2024] [ssl:warn] [pid 6417:tid 6417] AH01909: 192.168.18.4:443:0 server certificate does NOT include an ID which matches the server name
[Sun Nov 17 18:09:33.567383 2024] [mpm_prefork:notice] [pid 6417:tid 6417] AH00163: Apache/2.4.62 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Sun Nov 17 18:09:33.567416 2024] [core:notice] [pid 6417:tid 6417] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 17 18:41:33.879614 2024] [mpm_prefork:notice] [pid 6417:tid 6417] AH00170: caught SIGWINCH, shutting down gracefully
[Sun Nov 17 18:41:34.211881 2024] [ssl:warn] [pid 17334:tid 17334] AH01909: 192.168.18.4:443:0 server certificate does NOT include an ID which matches the server name
[Sun Nov 17 18:41:34.212933 2024] [suexec:notice] [pid 17334:tid 17334] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Sun Nov 17 18:41:34.451118 2024] [ssl:warn] [pid 17341:tid 17341] AH01909: 192.168.18.4:443:0 server certificate does NOT include an ID which matches the server name
[Sun Nov 17 18:41:34.460730 2024] [mpm_prefork:notice] [pid 17341:tid 17341] AH00163: Apache/2.4.62 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Sun Nov 17 18:41:34.460769 2024] [core:notice] [pid 17341:tid 17341] AH00094: Command line: '/usr/sbin/apache2'
[Sun Nov 17 19:27:32.123682 2024] [mpm_prefork:notice] [pid 17341:tid 17341] AH00170: caught SIGWINCH, shutting down gracefully

maiby
2024/12/01 02:01:17 [emerg] 409411#409411: bind() to 192.168.18.4:80 failed (99: Cannot assign requested address)

where can I find where this is
where can I change that IP address?

systemctl restart nginx
systemctl status nginx --no-pager -l

systemctl restart apache2
systemctl status apache2 --no-pager -l

First, you need to know the IP assigned to your server and the IPs added to Hestia.

ip a
v-list-sys-ips json | jq

It would be good to understand why the private IP changed.

root@server5:/home/martin# v-list-sys-ips json | jq
{
  "192.168.0.242": {
    "OWNER": "admin",
    "STATUS": "shared",
    "NAME": "",
    "U_SYS_USERS": "admin,anay,hosting",
    "U_WEB_DOMAINS": "21",
    "INTERFACE": "",
    "NETMASK": "",
    "NAT": "62.45.12.180",
    "TIME": "11:51:59",
    "DATE": "2024-12-03"
  }
}

I really want to help you but I need all the requested info.

Also, show the output of these commands:

ls -l /etc/nginx/conf.d/*conf
ls -l /etc/apache2/conf.d/*conf
grep -R '192.168.18.4' /etc/nginx/
grep -R '192.168.18.4' /etc/apache2/
1 Like
root@server5:/home/martin# ls -l /etc/nginx/conf.d/*conf
-rw-r--r-- 1 root root 1118 jul 12  2023 /etc/nginx/conf.d/0rtt-anti-replay.conf
-rw-r--r-- 1 root root  951 nov 13 17:18 /etc/nginx/conf.d/192.168.18.4.conf
-rw-r--r-- 1 root root  671 jun 25  2023 /etc/nginx/conf.d/agents.conf
-rw-r--r-- 1 root root   10 jul 12  2023 /etc/nginx/conf.d/http2-directive.conf
-rw-r--r-- 1 root root  205 jul 12  2023 /etc/nginx/conf.d/status.conf

root@server5:/home/martin# ls -l /etc/nginx/conf.d/*conf
-rw-r--r-- 1 root root 1118 jul 12  2023 /etc/nginx/conf.d/0rtt-anti-replay.conf
-rw-r--r-- 1 root root  951 nov 13 17:18 /etc/nginx/conf.d/192.168.18.4.conf
-rw-r--r-- 1 root root  671 jun 25  2023 /etc/nginx/conf.d/agents.conf
-rw-r--r-- 1 root root   10 jul 12  2023 /etc/nginx/conf.d/http2-directive.conf
-rw-r--r-- 1 root root  205 jul 12  2023 /etc/nginx/conf.d/status.conf
root@server5:/home/martin# ^C
root@server5:/home/martin# ls -l /etc/apache2/conf.d/*conf
-rw-r--r-- 1 root root 536 nov 13 17:18 /etc/apache2/conf.d/192.168.18.4.conf
-rw-r--r-- 1 root root 130 jun 25  2023 /etc/apache2/conf.d/hestia-event.conf
root@server5:/home/martin# grep -R '192.168.18.4' /etc/nginx/
/etc/nginx/conf.d/192.168.18.4.conf:    listen       192.168.18.4:80 default;
/etc/nginx/conf.d/192.168.18.4.conf:    #access_log  /var/log/nginx/192.168.18.4.log main;
/etc/nginx/conf.d/192.168.18.4.conf:        proxy_pass  http://192.168.18.4:8080;
/etc/nginx/conf.d/192.168.18.4.conf:    listen      192.168.18.4:443 ssl;
grep: /etc/nginx/modules-enabled/50-mod-http-xslt-filter.conf.removed: No such file or directory
grep: /etc/nginx/modules-enabled/50-mod-mail.conf.removed: No such file or directory
grep: /etc/nginx/modules-enabled/50-mod-http-geoip2.conf.removed: No such file or directory
grep: /etc/nginx/modules-enabled/70-mod-stream-geoip2.conf.removed: No such file or directory
grep: /etc/nginx/modules-enabled/50-mod-http-image-filter.conf.removed: No such file or directory
grep: /etc/nginx/modules-enabled/50-mod-stream.conf.removed: No such file or directory
root@server5:/home/martin# grep -R '192.168.18.4' /etc/apache2/
/etc/apache2/conf.d/192.168.18.4.conf:Listen 192.168.18.4:8443
/etc/apache2/conf.d/192.168.18.4.conf:Listen 192.168.18.4:8080
/etc/apache2/conf.d/192.168.18.4.conf:<VirtualHost 192.168.18.4:8080>
/etc/apache2/conf.d/192.168.18.4.conf:    ServerName 192.168.18.4
/etc/apache2/conf.d/192.168.18.4.conf:<VirtualHost 192.168.18.4:8443>
/etc/apache2/conf.d/192.168.18.4.conf:    ServerName 192.168.18.4
grep: /etc/apache2/conf-available/phpmyadmin.conf: No such file or directory
root@server5:/home/martin#

grep: /etc/apache2/conf-available/phpmyadmin.conf: No such file or directory
root@server5:/home/martin# ^C
root@server5:/home/martin# root@server5:/home/martin# ls -l /etc/nginx/conf.d/*conf
bash: root@server5:/home/martin#: No such file or directory
root@server5:/home/martin# -rw-r–r-- 1 root root 1118 jul 12 2023 /etc/nginx/conf.d/0rtt-anti-replay.conf
-rw-r–r--: command not found
root@server5:/home/martin# -rw-r–r-- 1 root root 951 nov 13 17:18 /etc/nginx/conf.d/192.168.18.4.conf
-rw-r–r--: command not found
in /etc/nginx/conf.d/192.168.18.4.conf
192.168.18.4.conf

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

server {
    listen       192.168.18.4:80 default;
    server_name  _;
    #access_log  /var/log/nginx/192.168.18.4.log main;
    location / {
        proxy_pass  http://192.168.18.4:8080;
   }
}

server {
    listen      192.168.18.4:443 ssl;
    server_name _;
    ssl_certificate      /usr/local/hestia/ssl/certificate.crt;
    ssl_certificate_key  /usr/local/hestia/ssl/certificate.key;

    return 301 http://$host$request_uri;

    location / {
        root /var/www/document_errors/;
    }

    location /error/ {
        alias /var/www/document_errors/;
    }
}

Execute these commands as root:

sudo su -
v-update-sys-ip && v-rebuild-users

Error: nginx restart failed
Error: ERROR: Restart of apache2 failed.
Error: apache2 restart failed

/usr/local/hestia/func/ip.sh: line 186: 5 - ( / 8): syntax error: operand expected (error token is “/ 8)”)

Show me whether it created the conf file for the new ip:

ls -l /etc/nginx/conf.d/*conf
ls -l /etc/apache2/conf.d/*conf

no new file

the apache 2 configD
Listen 192.168.18.4:8443
Listen 192.168.18.4:8080
<VirtualHost 192.168.18.4:8080>
ServerName 192.168.18.4
DocumentRoot /var/www/html/
Alias /error/ /var/www/document_errors/

<VirtualHost 192.168.18.4:8443>
ServerName 192.168.18.4
DocumentRoot /var/www/html/
Alias /error/ /var/www/document_errors/

SSLEngine on
SSLVerifyClient none
SSLCertificateFile         /usr/local/hestia/ssl/certificate.crt
SSLCertificateKeyFile      /usr/local/hestia/ssl/certificate.key

I will change the IP address

62.45.12.180

v-update-sys-ip and v-rebuild-users commands should solve the problem but v-update-sys-ip is failing because it doesn’t find an ip so it fails when executing function convert_cidr.

Show the output of these commands:

ip a
ip -4 -d -j addr show | jq 
ip -4 -d -j addr show | jq -r '.[] | select(length > 0) | .addr_info[] | if .scope == "global" then .local else empty end'