UJP - Raspberry Pi3のApache2でDirectoryIndexを変更する

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

ブログ - Raspberry Pi3のApache2でDirectoryIndexを変更する

Raspberry Pi3のApache2でDirectoryIndexを変更する

カテゴリ : 
PC » Raspberry Pi
ブロガー : 
ujpblog 2017/10/19 1:32
 PHPを入れているのにデフォルトアクセスがindex.htmlになるので,これをindex.phpに変更する.
 設定されているファイルはこれ.
root@commet:/etc/apache2# cat mods-available/dir.conf🆑
<IfModule mod_dir.c>
	DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
root@commet:/etc/apache2#
 次のように変更.
root@commet:/etc/apache2# cp mods-available/dir.conf mods-available/dir.conf.20171019🆑
root@commet:/etc/apache2# vi mods-available/dir.conf🆑
root@commet:/etc/apache2# diff mods-available/dir.conf.20171019 mods-available/dir.conf🆑
2c2
< 	DirectoryIndex index.html index.cgi index.pl index.php🈁 index.xhtml index.htm
---
> 	DirectoryIndex index.php🈁 index.html index.cgi index.pl index.xhtml index.htm
root@commet:/etc/apache2#
 変更したら文法チェックして再起動.
root@commet:/etc/apache2# apachectl configtest🆑
Syntax OK🈁
root@commet:/etc/apache2# apachectl stop🆑
root@commet:/etc/apache2# apachectl start🆑
root@commet:/etc/apache2#
 これで反映される.

トラックバック


広告スペース
Google