ブログ - Raspberry Pi 3にWebページを作成する
デフォルトでは/var/wwwがDocumentRootだというので,何が入っているか移動して確認する.
さらにhtmlディレクトリ配下を確認.
index.htmlをバックアップして,Helloという文字だけのファイルを作成.
これで,デフォルトページにアクセスすると,Helloと表示される.
http://ipaddress/index.html
次に,PHPが動作するか確認する.こんなファイルを作成.
http://ipaddress/index.phpにアクセス

これで動作していることが確認できた.
root@commet:~# cd /var/www🆑
root@commet:/var/www# ls -la🆑
合計 12
drwxr-xr-x 3 root root 4096 9月 13 01:14 .
drwxr-xr-x 12 root root 4096 9月 13 01:14 ..
drwxr-xr-x 2 root root 4096 9月 13 01:15 html🈁
root@commet:/var/www#
root@commet:/var/www# cd html🆑
root@commet:/var/www/html# ls -la🆑
合計 20
drwxr-xr-x 2 root root 4096 9月 13 01:15 .
drwxr-xr-x 3 root root 4096 9月 13 01:14 ..
-rw-r--r-- 1 root root 10701 9月 13 01:15 index.html🈁
root@commet:/var/www/html#
root@commet:/var/www/html# mv index.html index.html.org🆑
root@commet:/var/www/html# ls -la🆑
合計 20
drwxr-xr-x 2 root root 4096 9月 26 00:59 .
drwxr-xr-x 3 root root 4096 9月 13 01:14 ..
-rw-r--r-- 1 root root 10701 9月 13 01:15 index.html.org🈁
root@commet:/var/www/html# echo Hello > index.html🆑
root@commet:/var/www/html# ls -la🆑
合計 24
drwxr-xr-x 2 root root 4096 9月 26 01:00 .
drwxr-xr-x 3 root root 4096 9月 13 01:14 ..
-rw-r--r-- 1 root root 6 9月 26 01:00 index.html🈁
-rw-r--r-- 1 root root 10701 9月 13 01:15 index.html.org🈁
root@commet:/var/www/html#
http://ipaddress/index.html
次に,PHPが動作するか確認する.こんなファイルを作成.
root@commet:/var/www/html# cat index.php
<?php
phpinfo();
?>
root@commet:/var/www/html#

これで動作していることが確認できた.