VirtualMin Apache Failed to Start

That wouldn’t result in that error. There is something competing for 443 (maybe just an old Apache process), but the same Apache process configured with two competing Listen directives would give an error about the config, it wouldn’t start the first and the try to start another.

I added 2 listen statements to my test system and it failed with the same error as the OP I came to that conclusion from the OP’s netstat output not returning anything listening on port 443

1 Like

Huh…that’s very surprising. I didn’t actually test, so I’ll defer to you. I’m shocked that Apache would try to start two processes with conflicting configuration.

So what do you suggest now , how should i proceed to fix this

I looked on the net after I did tests and found this ubuntu - "make_sock: could not bind to address [::]:443" when restarting apache (installing trac and mod_wsgi) - Stack Overflow which a near simular issue so it’s not just me !
@letsconnect check all your apache config files for ‘Listen’ statements it should only appear once
a useful way to do that is

grep -Rnw /etc/apache2 -e “Listen”
the output should be like this
image

1 Like

Only once per port (or IP:port combo, if IP is specified). So, two in the usual case (80 and 443, as you’ve shown).

image

You’ve copy-pasted nonsense. Those are smart quotes, which will never appear in any config file.

1 Like

try the following

cat /etc/apache2/ports.conf

is there any config in there ? if the file is empty add the 2 lines from the post above

Listen 80
Listen 443

and restart apache

your right never noticed that I guess the code should have been encapsulated in backticks

root@hosts:~# cat /etc/apache2/ports.conf

If you just change the port or add more ports here, you will likely also

have to change the VirtualHost statement in

/etc/apache2/sites-enabled/000-default.conf

Listen 80
Listen 194.XXX.XXX.XXX:443

Listen 443 Listen 443

root@hosts:~# grep -Rnw /etc/apache2 -e “Listen”
/etc/apache2/ports.conf:5:Listen 80
/etc/apache2/ports.conf:6:Listen 194.XXX.XXX.XXX:443
/etc/apache2/ports.conf:9: Listen 443
/etc/apache2/ports.conf:13: Listen 443
root@hosts:~#

just change it to

Listen 80
Listen 443

just the 2 lines remove all other lines from the file and enable ssl & restart apache

1 Like

from ports.conf I have to remove ?

Yes remove everything from ports.conf
it should read

Listen 80
Listen 443

and nothing else

done

Enabled the SSL from modules and restarted apache2.

image

now can i try creating a new domain in the virtualmin ? and see if php8 works !

Add apache is now running in ssl mode ?
last check

service apache2 status

root@hosts:/etc/apache2# service apache2 status
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor prese>
Active: active (running) since Thu 2023-12-14 13:39:05 IST; 1min 28s ago
Docs: Apache HTTP Server Version 2.4 Documentation - Apache HTTP Server Version 2.4
Process: 3130633 ExecStart=/usr/sbin/apachectl start (code=exited, status=0>
Main PID: 3130636 (apache2)
Tasks: 55 (limit: 72258)
Memory: 9.6M
CGroup: /system.slice/apache2.service
├─3130636 /usr/sbin/apache2 -k start
├─3130637 /usr/sbin/apache2 -k start
└─3130638 /usr/sbin/apache2 -k start

Dec 14 13:39:05 hosts.tag4track.com systemd[1]: Starting The Apache HTTP Server>
Dec 14 13:39:05 hosts.tag4track.com systemd[1]: Started The Apache HTTP Server.

Currently it is using this path
(located at /var/www/html/index.html)

but I want to use my old path /home/tag4track/public_html/

you need to reconfigure your domains … this thread is now way to long open another thread with this issue

1 Like