Answer the question
In order to leave comments, you need to log in
How can I disable http access and close port 80 on Apache (Linux)?
In a situation where only SSL connections are used, I don’t think it makes much sense to keep one more port.
Answer the question
In order to leave comments, you need to log in
If there is a chance that someone will forget about HTTPS and go by simply entering the site address, then out of love for users, it makes sense to redirect.
In general:
1. Edit ports in /etc/apache2/ports.conf:
#Listen 80
<IfModule mod_ssl.c> <VirtualHost example.com:443> ... </VirtualHost> </IfModule>
leave port 80 open, but make an unconditional redirect:
Redirect permanent / https://your.domain.ru/
This will be more convenient, you will not need to type https:// in front of the address.
If hosting on ispmanager, then add port 8080 to the firewall/firewall section.
If not, then google iptables yourself, or something else that is on the server. This is in the case of nginx with 8080.
For all other cases, as amario rightly pointed out, # listen 80
And in a situation where nginx hangs on port 80, and Apache on 8080, how to close the Apache port for everyone from the outside, leaving it only for nginx?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question