V-update-web-domain-ssl not working

I’m trying to update SSL with this command
v-update-web-domain-ssl user domain.com /home/admin/web/domain.com/public_html/var/apps/certificates/domain.com/
and getting this error
Error: apache2 restart failed

Show the output of these commands:

apache2ctl configtest
systemctl status apache2 --no-pager -l

admin@abc:/# apache2ctl configtest
bash: apache2ctl: command not found

admin@abc:/# systemctl status apache2 --no-pager -l
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2024-06-01 01:10:03 -09; 2h 36min ago
Docs: Apache HTTP Server Version 2.4 Documentation - Apache HTTP Server Version 2.4
Process: 31711 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Process: 21542 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 31717 (apache2)
Tasks: 10 (limit: 4915)
Memory: 50.4M
CGroup: /system.slice/apache2.service
├─21584 /usr/sbin/apache2 -k start
├─21586 /usr/sbin/apache2 -k start
├─21587 /usr/sbin/apache2 -k start
├─21588 /usr/sbin/apache2 -k start
├─21589 /usr/sbin/apache2 -k start
├─21590 /usr/sbin/apache2 -k start
├─21919 /usr/sbin/apache2 -k start
├─21948 /usr/sbin/apache2 -k start
├─22338 /usr/sbin/apache2 -k start
└─31717 /usr/sbin/apache2 -k start

Jun 01 01:10:03 domain.com systemd[1]: Started The Apache HTTP Server.
Jun 01 03:35:10 domain.com systemd[1]: Reloading The Apache HTTP Server.
Jun 01 03:35:10 domain.com apachectl[20927]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using domain.com. Set the ‘ServerName’ directive globally to suppress this message
Jun 01 03:35:10 domain.com systemd[1]: Reloaded The Apache HTTP Server.
Jun 01 03:35:12 domain.com systemd[1]: Reloading The Apache HTTP Server.
Jun 01 03:35:12 domain.com apachectl[21187]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using domain.com. Set the ‘ServerName’ directive globally to suppress this message
Jun 01 03:35:12 domain.com systemd[1]: Reloaded The Apache HTTP Server.
Jun 01 03:35:14 domain.com systemd[1]: Reloading The Apache HTTP Server.
Jun 01 03:35:14 domain.com apachectl[21542]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using domain.com. Set the ‘ServerName’ directive globally to suppress this message
Jun 01 03:35:14 domain.com systemd[1]: Reloaded The Apache HTTP Server.

v-restart-web uses apache2ctl command to test the config and that seems the reason you get the error.

Well, why you don’t have apache2ctl in your path? Try to find it:

find / -type f -name apache2ctl

Also, show your PATH

echo "$PATH"

root@abc:/# find / -type f -name apache2ctl
/usr/sbin/apache2ctl
/usr/share/bash-completion/completions/apache2ctl
root@abc:/# echo “$PATH”
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/hestia/bin
root@abc:/#

root@abc:/# v-restart-web admin apache2ctl
Error: apache2 restart failed

How do you login as root?

by bitvise ssh client, i sued to SU command for root password

Login again but now use sudo su - the last dash is the important one, once logged echo $PATH and if you see the sbin directories in your PATH, then you could execute the command v-update-web-domain-ssl

1 Like

Thank you so much SIR, now it’s working.

1 Like