V
V
volersawns2016-02-03 17:02:04
linux
volersawns, 2016-02-03 17:02:04

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

4 answer(s)
S
Spetros, 2016-02-03
@Spetros

For example, listen 127.0.0.1:80
In general, many ways of access control are described in the documentation.

D
Denis Sechin, 2016-02-03
@tamogavk

Ept, close the port on the router

V
Victor Taran, 2016-02-03
@shambler81

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

A
abcd0x00, 2016-02-04
@abcd0x00

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 question

Ask a Question

731 491 924 answers to any question