ブログ - Raspberry Pi3のApache2でDirectoryIndexを変更する
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#