1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DirectoryIndex出力のカスタマイズ

Last updated at Posted at 2017-06-04

apache

httpd.conf

/etc/apache2/apache2.conf
  <Directory /var/www/html/>
  	Options Indexes FollowSymLinks
  	AllowOverride None
  	Require all granted
  	#
+ 	IndexOptions +FoldersFirst
+ 	IndexOptions +NameWidth=*
  </Directory>
  • フォルダを最初に表示
  • フォルダ名が長くても表示

mod.png

nginx

/etc/nginx/sites-available/default

  server {
  	listen 80 default_server;
  	root /var/www/html/;
  	index index.html index.htm index.nginx-debian.html;
  	server_name _;
  	location / {
+ 		autoindex on;
+ 		autoindex_localtime on;
+ 		charset UTF-8;
  		try_files $uri $uri/ =404;
  	}
  	location ~ \.php$ {
  		root           /usr/share/nginx/html;
  		fastcgi_pass   127.0.0.1:9000;
  		fastcgi_index  index.php;
  		fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
  		include        fastcgi_params;
  	}
  }
  • DirectoryIndex を有効
  • サーバーのタイムゾーンを使用

nginx.png

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?