Страница 1 из 2
apache mod_autoindex
Добавлено: 2010-10-25 8:19:06
DuoMorph
Alias /music "/torrents/music/"
<Directory "/torrents/music/">
Options Indexes MultiViews
AllowOverride None
Order Allow,Deny
Allow from all
ReadmeName README.html
HeaderName HEADER.html
</Directory>
так всё ок, вот только при переходе в подпапку - файлы не инклудятся. Думаю это исправится, если прописать полный путь до файлов. В итоге если его прописать - они вообще не инклудятся, не говоря уже о подпапках
возможно ли как нибудь обойтись без добавления файлов README.html и HEADER.html в каждую папку?
Re: apache mod_autoindex
Добавлено: 2010-10-25 15:11:29
Нефиг_чем_заняться
DuoMorph писал(а):Думаю это исправится, если прописать полный путь до файлов.
Нужно не полный путь, а от DocumentRoot, т.е. от корня веб
У меня вот так все нормально работает
Код: Выделить всё
Options Indexes FollowSymLinks
IndexOptions FancyIndexing
IndexOptions VersionSort
IndexOptions HTMLTable
IndexOptions FoldersFirst
IndexOptions IconsAreLinks
IndexOptions IgnoreCase
IndexOptions SuppressDescription
IndexOptions SuppressHTMLPreamble
IndexOptions XHTML
IndexOptions IconWidth=16
IndexOptions IconHeight=16
IndexOptions NameWidth=*
IndexOrderDefault Descending Name
HeaderName /sysop/logs/header.html
ReadmeName /sysop/logs/footer.html
Re: apache mod_autoindex
Добавлено: 2010-10-25 15:43:44
DuoMorph
не хочет он видеть его ни откуда, не хочет они ничего видеть...
он его конечно берёт, но применять к подпапкам не хочет
вот линк:
http://abadd0n.me/music/
Re: apache mod_autoindex
Добавлено: 2010-10-25 16:07:33
Нефиг_чем_заняться
DuoMorph писал(а):не хочет он видеть его ни откуда, не хочет они ничего видеть...
он его конечно берёт, но применять к подпапкам не хочет
template_css.css положите живьем в music, а не с удаленного сайта и если не хотите чтобы он был виден, есть опция по игнорированию.
Re: apache mod_autoindex
Добавлено: 2010-10-26 0:05:15
DuoMorph
зачем эти бессмысленные советы? проблема уменя совсем не в этом...
Re: apache mod_autoindex
Добавлено: 2010-10-26 2:44:18
Нефиг_чем_заняться
DuoMorph писал(а):зачем эти бессмысленные советы?
Бессмысленные??? Нет. Скорее телепатические

где содержимое header and footer? Нету...
А по ссылке у вас меняются
только свойства объектов хтмл-а при переходе по каталогам, а не сами обьекты, - отсюда вывод, что на это влияет css, который вы тянете с удаленного сервака...
DuoMorph писал(а):проблема уменя совсем не в этом...
А в чем ?

Re: apache mod_autoindex
Добавлено: 2010-10-26 9:15:36
DuoMorph
А в чем ?

В руках по видимому))))))))))
Бессмысленные??? Нет. Скорее телепатические

Просто по барабану есть там тот ксс или нет, суть в том что в подпапках ничего не меняется и ни хедер, ни футер не прикрепляются...
Да ситуация согласен... аномальная %)
Код: Выделить всё
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://www.gorodbereza.ru/templates/akogreenportal/css/template_css.css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'ЧЧЧЧЧЧЧ']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
Re: apache mod_autoindex
Добавлено: 2010-10-26 9:27:34
DuoMorph
общий конфиг мод_индекса
Код: Выделить всё
IndexOptions Charset=UTF-8 NameWidth=* FancyIndexing SuppressHTMLPreamble
IndexOptions HTMLTable IgnoreCase XHTML IconsAreLinks FoldersFirst
IndexOptions SuppressDescription VersionSort
Alias /icons/ "/usr/local/www/apache22/icons/"
<Directory "/usr/local/www/apache22/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/movie.gif .mkv
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
Re: apache mod_autoindex
Добавлено: 2010-10-26 21:05:32
BSD_daemon
Попробуйте так
Код: Выделить всё
Alias /icons/ "/usr/local/www/apache22/icons/"
<Directory "/usr/local/www/apache22/icons/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
# copy file 'template_css.css' to directory ..../music
# it would work much faster
Alias /music "/usr/local/www/path_to_music_directory/" # Change "path_to_music_directory" to directory where is 'music' lives !!!!!!!!!!!!!
<Directory "/usr/local/www/path_to_music_directory/"> # Change "path_to_music_directory" to directory where is 'music' lives !!!!!!!!!!!!!
Options +Indexes SymLinksIfOwnerMatch
AllowOverride None # Disable .htaccess. If you will use .htaccess inside the 'music' directory then change it to 'AllowOverride FileInfo'
Order allow,deny
Allow from all
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
</Files>
<IfModule mod_autoindex.c>
IndexOptions Charset=UTF-8
IndexOptions NameWidth=*
IndexOptions FancyIndexing
IndexOptions SuppressHTMLPreamble
IndexOptions HTMLTable
IndexOptions IgnoreCase
IndexOptions XHTML
IndexOptions IconsAreLinks
IndexOptions FoldersFirst
IndexOptions SuppressDescription
IndexOptions VersionSort
DefaultIcon /icons/unknown.gif
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/movie.gif .mkv
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
ReadmeName /music/README.html
HeaderName /music/HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t template_css.css
</IfModule>
</Directory>
Re: apache mod_autoindex
Добавлено: 2010-10-26 21:13:20
BSD_daemon
P.S.
Кстати, не вы могли бы вы архивчик с иконками пристегнуть, давно собираюсь поменять famfamfam-ие поменять на покрупней, но руки опускаются от многообразия в гугле
Re: apache mod_autoindex
Добавлено: 2010-10-26 23:43:29
DuoMorph
BSD_daemon
к сожалению, ничего не получилось, после установки этого скрипта, даже в корневой дирректории хедер не аттачился...
Re: apache mod_autoindex
Добавлено: 2010-10-27 1:33:54
BSD_daemon
DuoMorph писал(а):к сожалению, ничего не получилось, после установки этого скрипта, даже в корневой дирректории хедер не аттачился...
Чудеса...
Попробуйте закоментить
IndexIgnore
У вас точно README и HEADER большими буквами?
Re: apache mod_autoindex
Добавлено: 2010-10-27 12:46:25
DuoMorph
Вот сейчас стоит такой конфиг, а его результат
http://abadd0n.me/music/
Код: Выделить всё
root:/usr/local/etc/apache22/Includes/> cat bhttpd-ai.conf
Alias /icons/ "/usr/local/www/apache22/icons/"
<Directory "/usr/local/www/apache22/icons/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /music /torrents/music/
<Directory "/torrents/misic/">
Options +Indexes SymLinksIfOwnerMatch
AllowOverride None
Order allow,deny
Allow from all
<Files ~ "^.*\.([Hh][Tt][Aa])">
order allow,deny
deny from all
</Files>
<IfModule mod_autoindex.c>
IndexOptions Charset=UTF-8
IndexOptions NameWidth=*
IndexOptions FancyIndexing
IndexOptions SuppressHTMLPreamble
IndexOptions HTMLTable
IndexOptions IgnoreCase
IndexOptions XHTML
IndexOptions IconsAreLinks
IndexOptions FoldersFirst
IndexOptions SuppressDescription
IndexOptions VersionSort
DefaultIcon /icons/unknown.gif
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/movie.gif .mkv
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
ReadmeName README.html
HeaderName HEADER.html
# IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t template_css.css
</IfModule>
</Directory>
листинг дирректории /torrents
Код: Выделить всё
root:/usr/local/etc/apache22/Includes/> ll /torrents/
total 640990
drwxrwxr-x 2 rtorrent www 512B 13 сен 21:47 .snap/
drwxr-x--x 2 rtorrent www 512B 23 сен 21:43 1221313/
drwxr-x--- 107 rtorrent www 4,0K 24 окт 18:34 anime/
drwxr-x--x 19 rtorrent www 4,0K 26 окт 17:38 complete/
drwxr-x--x 4 root www 512B 17 окт 23:22 doc/
drwxr-x--x 2 rtorrent www 512B 26 окт 07:40 downloads/
-rw-r----- 1 root www 544M 4 окт 18:06 httpd-access.log
-rw-r----- 1 root www 81M 4 окт 18:06 httpd-error.log
drwxr-x--x 21 rtorrent www 1,5K 24 окт 18:40 movie/
drwxr-xr-x 19 rtorrent www 512B 26 окт 06:04 music/
drwxr-x--x 2 rtorrent www 5,0K 27 окт 06:22 sessions/
drwxr-x--x 16 rtorrent www 2,5K 21 окт 20:28 upload/
листинг директории /torrents/music
Код: Выделить всё
root:/usr/local/etc/apache22/Includes/> ll /torrents/music/
total 3278
drwxr-xr-x 163 rtorrent www 4,5K 24 окт 16:04 Alternative/
drwxr-xr-x 41 rtorrent www 2,5K 24 окт 16:05 D'n'B/
drwxr-xr-x 40 rtorrent www 2,5K 24 окт 16:06 DrumnBass_DarkSide_Break/
drwxr-xr-x 116 rtorrent www 8,0K 24 окт 16:08 Electro/
drwxr-xr-x 26 rtorrent www 1,0K 24 окт 16:09 Enigma[tfile.ru]/
drwxr-xr-x 9 rtorrent www 512B 24 окт 16:09 Folck/
drwxr-xr-x 17 rtorrent www 512B 24 окт 16:10 Games/
-rw-r--r-- 1 rtorrent www 3,1M 24 окт 15:56 Gimn Pankov.mp3
-rwxr-xr-x 1 www www 574B 26 окт 06:06 HEADER.html*
drwxr-xr-x 99 rtorrent www 6,5K 24 окт 16:11 Hardcore_Hardstyle_Other/
drwxr-xr-x 87 rtorrent www 6,5K 24 окт 16:14 House/
drwxr-xr-x 26 rtorrent www 1,0K 24 окт 16:16 OST/
drwxr-xr-x 423 rtorrent www 15K 24 окт 16:43 Psyhodelic-Trance/
drwxr-xr-x 8 rtorrent www 512B 24 окт 16:44 RAP/
-rwxr-xr-x 1 www www 17B 24 окт 18:23 README.html*
drwxr-xr-x 43 rtorrent www 1,5K 24 окт 16:54 ROCK/
drwxr-xr-x 59 rtorrent www 4,5K 24 окт 16:56 Techno/
drwxr-xr-x 5 rtorrent www 512B 24 окт 16:56 comp/
-rw-r--r-- 1 root www 8,4K 26 окт 06:03 file_list_style.css
drwxr-xr-x 15 rtorrent www 12K 24 окт 16:57 misc/
drwxr-xr-x 15 rtorrent www 10K 24 окт 16:58 music_mamich/
Re: apache mod_autoindex
Добавлено: 2010-10-27 12:54:11
DuoMorph
ну и собственно сам конфиг апача
Код: Выделить всё
ServerRoot "/usr/local"
Listen 80 8080
LoadModule .....
LoadModule autoindex_module libexec/apache22/mod_autoindex.so
LoadModule ....
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/home/www/cgi-bin/"
</IfModule>
<IfModule mime_module>
AddHandler cgi-script .cgi .pl .py
</IfModule>
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User www
Group www
</IfModule>
</IfModule>
ServerAdmin you@example.com
ServerName abadd0n.me:80
DocumentRoot "/home/www/"
<Directory />
# Options FollowSymLinks
AllowOverride None
# Options -Indexes
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
#ErrorLog "|/usr/local/sbin/logrotate -l /var/log/apache/httpd-error.%Y.%m.%d.log"
ErrorLog "/var/log/apache/httpd-error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
# CustomLog "|/usr/local/sbin/logrotate -l /var/log/apache/httpd-access.%Y.%m.%d.log" combined
CustomLog "/var/log/apache/httpd-access.log" combined
</IfModule>
<IfModule cgid_module>
</IfModule>
DefaultType text/html
<IfModule mime_module>
TypesConfig etc/apache22/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-python .py
</IfModule>
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset UTF-8 .utf8
AddCharset utf-8 .utf8
Include etc/apache22/Includes/*.conf
Re: apache mod_autoindex
Добавлено: 2010-10-27 19:26:54
Нефиг_чем_заняться
[quote="DuoMorph"]
Код: Выделить всё
Alias /music /torrents/music/
<Directory "/torrents/misic/">
Это не хорошо, надо
Alias [виртуальный путь веб сервака] [реальный путь в файловой системе]
то же самое и с Directory, надо показывать [реальный путь в файловой системе], такой же как прописан в Alias.
Код: Выделить всё
ReadmeName README.html
HeaderName HEADER.html
надо
Код: Выделить всё
ReadmeName [виртуальный путь]README.html
HeaderName [виртуальный путь]HEADER.html
иначе без путей сервак будет искать эти файлы в каждой директории
и уберите бит на исполнение у файлов
README.html и HEADER.html, - стремно.
P.S.
За иконки спасибо, но дефолтовые у меня тоже есть, показалось что у вас какие-то другие
Re: apache mod_autoindex
Добавлено: 2010-10-27 20:26:11
DuoMorph
ну дык так и есть
Код: Выделить всё
[adm@serv ~]$ mount |grep torrents
/dev/ad8s1d on /torrents (ufs, local, soft-updates)
дело ещё в том, что по тому конфу который ты мне дал, эти файлы не аттачатся вообще...
Re: apache mod_autoindex
Добавлено: 2010-10-27 21:14:10
Нефиг_чем_заняться
DuoMorph писал(а):ну дык так и есть
Код: Выделить всё
[adm@serv ~]$ mount |grep torrents
/dev/ad8s1d on /torrents (ufs, local, soft-updates)
Э, блин листинги ls не смотрел
попробуйте
Alias /music/ /torrents/music/
и
Код: Выделить всё
HeaderName /music/HEADER.html
ReadmeName /music/README.html
Собака где то здесь, сервак не видит правильных полных виртуальных путей к HEADER.html и README.html, поэтому не может найти их, когда он в других директориях.
Re: apache mod_autoindex
Добавлено: 2010-10-27 22:37:30
DuoMorph
нет, ситуация всё, та же...
кстати ещё такая штука - при установке +Indexes
Options +Indexes SymLinksIfOwnerMatch
серв выдаёт
Forbidden
You don't have permission to access /music/ on this server.
а когда просто Indexes
Options Indexes SymLinksIfOwnerMatch
то всё ок
Re: apache mod_autoindex
Добавлено: 2010-10-31 22:18:16
DuoMorph
up.......................
Re: apache mod_autoindex
Добавлено: 2010-11-06 21:30:59
BSD_daemon
DuoMorph писал(а):up.......................
попробуйте убрать Include etc/apache22/Includes/*.conf
и вообще все лишнее, пока не заработает как должно быть, у вас явно где то перезаписываются правила
попробуйте еще разрешить htaccess на директорию которую шарите через мод_индекс [Options FileInfo AuthConfig Limit]
и перебросьте правила в него.
На счет + и - у Index они очень хитро обьединяются проходя по дереву правил, не так как основные директивы.
Re: apache mod_autoindex
Добавлено: 2011-05-19 13:20:18
gyurza2000
...никак не могу добиться вывода HEADER.html...каких записей достаточно и каких быть не должно, что бы HEADER.html выводился в шапке автоиндекса?
Re: apache mod_autoindex
Добавлено: 2011-05-19 15:36:04
gyurza2000
блин...крутил крутил настройки, теперь вообще перестал работать Autoindex...вроде вернул всё обратно, а не работает - пустой листинг
Re: apache mod_autoindex
Добавлено: 2011-05-19 19:19:47
gyurza2000
IgnoreCase в паре с XHTML так влиял в IndexOptions...убрал XHTML всё вроде работает...что даёт этот XHTML?
Re: apache mod_autoindex
Добавлено: 2011-05-20 1:17:22
gyurza2000
блин...я запарился, не могу заставить работать mod_autoindex...какие условия должны быть соблюдены что бы он заработал?
Content negotiation will be performed if Options MultiViews is in effect. If filename resolves to a static text/html document (not a CGI script) and either one of the options Includes or IncludesNOEXEC is enabled, the file will be processed for server-side includes (see the mod_include documentation).
написано на сайте
http://httpd.apache.org/docs/2.2/mod/mo ... name...всё вроде бы есть, но не пашет. Может кинет хотя бы кто свой httpd.conf у кого autoindex работает?
Re: apache mod_autoindex
Добавлено: 2011-05-23 10:16:18
gyurza2000
разобрался с автоиндексом, всё работает...есть ещё вопрос:):
на каталог стоит IndexOptions Charset=UTF-8, и апач исправно отдаёт в этой кодировке имена файлов, содержащихся в данном каталоге, НО, при открытии текстового файла в браузере, апач отдаёт содержимое файла в Windows-1251. Откуда он это берёт?в httpd.conf таких директив у меня нет.htaccess не существует