[Apache] Lokaal directory openzetten

Pagina: 1
Acties:

  • yohan
  • Registratie: April 2002
  • Laatst online: 29-08 14:37
Ik draai hier een webservertje die op het thuisnetwerk bereikbaar is onder 10.0.0.153.

Ik wil 1 map vullen met mp3's en die openzetten voor het hele netwerk. Standaard staat dit uit, want ik wil geen open-file server hebben. Hoe stel ik in dat gebruikers vanaf bepaalde IP's toegang hebben tot de inhoud van de map 'mp3'?

"I'm not a cynic. I get up every morning hoping to find an honest man." - [Jack McCoy, Law & Order]


Verwijderd

Order deny,allow
Deny from all
Allow from 10.0.0

Bovenstaande dus in een .htaccess file, of in een Directory of Files directive in httpd.conf

[ Voor 49% gewijzigd door Verwijderd op 04-10-2003 21:41 ]


  • yohan
  • Registratie: April 2002
  • Laatst online: 29-08 14:37
ben n00b

Dit stond er al:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
    Options -Indexes -FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>

Dit heb ik toegevoegd:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<Directory "C:/Program Files/Apache Group/Apache2/htdocs/mp3">


#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
    Options Indexes -FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride None

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Deny from all
    Allow from 10.0.0

</Directory>


Resultaat bij http://10.0.0.153/mp3 :
U bent niet gemachtigd om deze pagina te bekijken.

"I'm not a cynic. I get up every morning hoping to find an honest man." - [Jack McCoy, Law & Order]


  • Vae Victis
  • Registratie: April 2001
  • Laatst online: 09:26

Vae Victis

Dark Lord of the Sith

Order allow,deny
Deny from all
Allow from 10.0.0
Kijk eens naar de volgorde (order).

[edit]
Net getest.
Maak er eens:
code:
1
2
3
Order deny,allow    
Deny from all    
Allow from 10.0.0

Van, dan moet het werken.

[ Voor 41% gewijzigd door Vae Victis op 04-10-2003 22:31 ]


Verwijderd

Misschien blokkeert de AllowOverride None directive in de bovenliggende directory de boel een beetje.
( in <Directory "C:/Program Files/Apache Group/Apache2/htdocs"> dus)

Probeer daar eens AllowOverride Limit van te maken, en restart Apache.

  • Xandrios
  • Registratie: Februari 2001
  • Laatst online: 22:31
==> SA :)

  • yohan
  • Registratie: April 2002
  • Laatst online: 29-08 14:37
Got it working!

Cheatah en Vae Victis, jullie komen in m'n testament!

"I'm not a cynic. I get up every morning hoping to find an honest man." - [Jack McCoy, Law & Order]

Pagina: 1