일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- FCM
- php 시큐어코딩
- android 효과음
- 안드로이드
- 안드로이드 gcm
- Mail Server
- soundpool
- xe
- roundcube
- 안드로이드 푸시
- C# IO
- curl
- 자동 생성
- mysql
- 우분투
- 폼메일
- PHP
- 자바스크립트
- UML
- not working
- html5
- Android
- chart.js
- WebView
- javascript
- 안드로이드 푸쉬
- dovecot
- php 취약점
- C#
- 설치
- Today
- Total
그러냐
아파치 디렉토리 리스트 보이게 하기 본문
Directory Listing Configuration
Here we describe various types of things that the server can send when you request a directory rather than an individual file.
Trailing Slash Redirection
If you request a directory without including the trailing slash in its name (i.e. http://example.com/dir rather than http://example.com/dir/), then Apache must send a redirect to add the trailing slash to the URL. This is necessary so relative hyperlinks will work in the resulting file.
For this to work, Apache must know the name of the server so that it can send a redirect back to itself. Normally, when UseCanonicalName is set off, the name supplied by the client in the Host HTTP request header is used. If UseCanonicalName is on, then you need to assure that ServerName is set correctly in order for this redirect to work.
Directory Indexes
When a directory is requested, Apache may be configured to send a particular file within that directory automatically. This is configured with the DirectoryIndex directive. It can list one or more files that Apache should search for in the directory, with the first existing file being returned to the client. For example:
DirectoryIndex index.html index.htm index.php welcome.html
Directory Listings
If no file from the DirectoryIndex directive can be located in the directory, then mod_autoindex can generate a listing of the directory contents. This is turned on and off using the Options directive. For example, to turn on directory listings for a particular directory, you can use:
<Directory /usr/local/apache2/htdocs/listme> Options +Indexes </Directory>
To prevent directory listings (for security purposes, for example), you should remove the Indexes keyword from every Options directive in your configuration file. Or to prevent them only for a single directory, you can use:
<Directory /usr/local/apache2/htdocs/dontlistme> Options -Indexes </Directory>
Excluding Files
If you would like listings to be enabled, but you want to omit particular files, you can use the IndexIgnore directive. For example, to omit any filename starting with tmp and also the parent directory link (..), you could use:
IndexIgnore tmp* ..
Some files aren't listed
When a directory listing is produced, certain files will not be shown, by default. Files and directories that have access restrictions placed on them, either by password or by address, will not be shown in a directory listing.
If you want these files to be listed, you will need to set IndexOptions ShowForbidden in the directory block in question. The ShowForbidden setting is only available in 2.2 and later.
Headers and Footers
The directives HeaderName and ReadmeName configure a file to be included, respectively, above and below the file listing. If no path is given, Apache will look for these files in the directory being listed. For example:
HeaderName header.html ReadmeName footer.html
A path starting in slash can be used if you want the same files included for all directories:
HeaderName /site/header.html ReadmeName /site/footer.html
Styling the listing
The directory listing is highly configurable. The IndexOptions directive gives lots of choices for different configurations and the IndexStyleSheet directive allows a CSS stylesheet to be specified. A typical configuration might look like:
IndexOptions FancyIndexing HTMLTable IndexStyleSheet /css/autoindex.css
Extended example
For a more complete example, including a configuration for the icons displayed with the files, see conf/extra/httpd-autoindex.conf as distributed with Apache httpd.
'Linux' 카테고리의 다른 글
우분투에 PHPMyAdmin 설치하기, 셋팅 (0) | 2016.08.22 |
---|---|
우분투 설치 직후 APM (Apache2, PHP, MySQL) 바로 설치 (0) | 2016.08.22 |
리눅스 기본명령어 (0) | 2016.01.28 |
리눅스 OS버젼 확인 명령어 (0) | 2016.01.28 |
[Linux] MySQL 시작/정지/재시작 방법 (0) | 2016.01.28 |