2

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

Ryan
  • 23
  • 1
  • 1
  • 5
  • look for ports.conf – djdomi Feb 02 '20 at 08:52
  • @djdomi I took a screenshot of ports.conf and included it in the post. Do I need to change the "Listen 80" to "Listen 443" or is there more to it than that? – Ryan Feb 02 '20 at 08:54

1 Answers1

1

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

Talal Al-Khalifa
  • 668
  • 5
  • 12
  • 1
    exactly - thump up you may see apachectl -t to check out the config – djdomi Feb 02 '20 at 09:01
  • I'll try this out in just a minute and keep you posted! – Ryan Feb 02 '20 at 09:08
  • When I do this and restart apache I get an error. I edited my post to include it – Ryan Feb 02 '20 at 09:12
  • @Ryan you should also be sure that you have a valid ssl certificate on your default-ssl.conf – Talal Al-Khalifa Feb 02 '20 at 09:13
  • @TalalAl-Khalifa I forgot to enable the included self-signed certificated and used the command "a2enmod ssl" which enabled the ssl. Restarted apache and now it's working. Thank you! – Ryan Feb 02 '20 at 09:19