powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Настройка http.conf
6 сообщений из 6, страница 1 из 1
Настройка http.conf
    #32835554
ALex_hha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Подскажите пожайлуста как настроить апаче так чтобы он не отображал содержимое папок.
Т.е. сейчас когда набираю http://192.168.127.254/library/ он показывает ее содержимое.
У меня апаче 2.0.52.
...
Рейтинг: 0 / 0
Настройка http.conf
    #32835585
sky2k
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Options -Indexes
...
Рейтинг: 0 / 0
Настройка http.conf
    #32836157
ALex_hha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Все равно показует :(.
Вот мой текущий файл настройки. Может я что-то пропустил?
Код: plaintext
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.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
ServerRoot "/usr/local/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
<IfModule !mpm_winnt.c>
<IfModule !mpm_netware.c>
#LockFile logs/accept.lock
</IfModule>
</IfModule>

<IfModule !mpm_netware.c>
<IfModule !perchild.c>
#ScoreBoardFile logs/apache_runtime_status
</IfModule>
</IfModule>

<IfModule !mpm_netware.c>
PidFile logs/httpd.pid
</IfModule>

Timeout  300 

KeepAlive On

MaxKeepAliveRequests  100 

KeepAliveTimeout  15 

Listen  192 . 168 . 127 . 254 : 80 

#
# Dynamic Shared Object (DSO) Support
#
LoadModule php5_module modules/libphp5.so

ServerName SRV1

UseCanonicalName On

#
# 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.
#
DocumentRoot "/usr/local/apache2//htdocs"

<Directory />
    Order Deny,Allow
    Deny from All
    AllowOverride All
</Directory>

<Directory "/usr/local/apache2//htdocs">
    Options Indexes
    Order Allow,Deny
    Allow from  192 . 168 . 127 . 0 / 24 
</Directory>

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
UserDir public_html

DirectoryIndex index.php index.html

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

#
# TypesConfig describes where the mime.types file (or equivalent) is
# to be found.
#
TypesConfig conf/mime.types

DefaultType text/plain

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
<IfModule mod_mime_magic.c>
    MIMEMagicFile conf/magic
</IfModule>


HostnameLookups Off

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# You need to enable mod_logio.c to use %I and %O
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access_log common

ServerTokens Full

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature On
...
Рейтинг: 0 / 0
Настройка http.conf
    #32836819
Фотография Alex Rootoff
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Нужно запретить модуль индексирования содержимого. Просто закоментируй его.

With best regards Alex Rootoff
...
Рейтинг: 0 / 0
Настройка http.conf
    #32838279
ALex_hha
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Но мне нужно запретить просмотр только в определенных каталогах, а не в целом.
Например:
/usr/local/apache2/htdocs/ - запретить
/usr/local/apache2/htdocs/downloads/ - разрешить
/usr/local/apache2/htdocs/library/ - запретить
Ну и т.д.

А что это за прикол в пути например :DocumentRoot "/usr/local/apache2//htdocs" перед htdocs два слеша?
...
Рейтинг: 0 / 0
Настройка http.conf
    #32840363
DocAl
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ну вот для этих конкретных директорий и надо проставить строку
Options -Indexes
...
Рейтинг: 0 / 0
6 сообщений из 6, страница 1 из 1
Форумы / PHP, Perl, Python [игнор отключен] [закрыт для гостей] / Настройка http.conf
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]