Answer the question
In order to leave comments, you need to log in
How to disable access to Apache from the Internet?
How to disable access to Apache from the Internet? To be able to work with it only on the local computer.
Answer the question
In order to leave comments, you need to log in
For example, listen 127.0.0.1:80
In general, many ways of access control are described in the documentation.
Usually the question is the opposite;) the
router listens to the local port, the domain is local through the host file,
There are just a million options
blockport_except_localhost()
{
iptables -A INPUT ! -s localhost -p tcp --dport "$1" -j DROP
iptables -A INPUT ! -s localhost -p udp --dport "$1" -j DROP
iptables -A OUTPUT ! -d localhost -p tcp --sport "$1" -j DROP
iptables -A OUTPUT ! -d localhost -p udp --sport "$1" -j DROP
}
blockport_except_localhost 80
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question