On Sat, 10 Dec 2005 13:20:37 +0100, Kees Nuyt
<k.nuyt@nospam.demon.nl> wrote:
>On 9 Dec 2005 18:36:52 -0800, userdear@gmail.com wrote:
>
>>I want my Apache server to refuse all connections except localhost ,
>>and make http service invisible to other machine in case to be hacked.
>>
>>Can anyon me ? Thanks in advance!
>
>Listen 127.0.0.1:80
>
>and define for the webroot directory:
>
>Deny From All
>Allow From 127.0.0.1
To be a bit more explicit, make that:
#
# DocumentRoot: The directory out of which you will serve
# your documents. By default, all requests are taken from
# this directory, but symbolic links and aliases may be
# used to point to other locations.
#
# Default at installation
# DocumentRoot "installdrive:/installpath/htdocs"
DocumentRoot "yourdrive:/yourdocumentroot"
:
:
#
# First, we configure the "default" to
# be a very restrictive set of features.
# This lets no one in.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
:
:
# Later we can use more specific
# settings per directory served.
# It doesn't harm to repeat the
# Options and Deny directives.
#
<Directory "yourdrive:/yourdocumentroot">
AllowOverride None
Options None
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
#
# you may want to be less restrictive
# for other specific directories.
#
<Directory "yourdrive:/yourdocumentroot/public">
Order Allow,Deny
Allow from All
Deny from blacklisted.domain.com
Deny from msn.com aol.net
</Directory>
....
See also:
http://httpd.apache.org/docs/2.0/mod/mod_access.html
Hope this s.
--
( Kees
)
c[_] What's the point in running when the light at
the end of the tunnel iz just another train... (#261)