Apache2 – How to Disable Port 80 and Enable Port 443 for HTTPS on Debian

Apache2debianhttpsssl

I installed apache2 on my Debian server, and I want to completely disable HTTP over port 80 and only have https over port 443.

This is my current ports.conf file

ports.conf

This is my 000-default.conf file

000-default.conf

and this is my default-ssl.conf file

default-ssl.conf

Basically my end goal is to be able to do an nmap scan of the server and have https over port 443 show up and not have http over port 80 show up at all.


Edit: Tried commenting out Listen 80 and everything in the 000-default.conf filed and got the following errors when I tried to restart apache

Errors

Best Answer

Comment the Listen 80 also comment out all lines on the 000-default.conf and restart