| | 516 | |
| | 517 | === サブドメインごとの設定 === |
| | 518 | |
| | 519 | ==== www.harapeko.jp ==== |
| | 520 | |
| | 521 | `/var/www/html` の権限が root:root になっているのを修正する。 |
| | 522 | |
| | 523 | Ubuntu での apache の実行ユーザーは `/etc/apache2/envvars` に `APACHE_RUN_USER` および `APACHE_RUN_GROUP` として設定されている。 |
| | 524 | |
| | 525 | {{{ |
| | 526 | #!console |
| | 527 | # less /etc/apache2/envvars |
| | 528 | }}} |
| | 529 | |
| | 530 | {{{ |
| | 531 | # Since there is no sane way to get the parsed apache2 config in scripts, some |
| | 532 | # settings are defined via environment variables and then used in apache2ctl, |
| | 533 | # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc. |
| | 534 | export APACHE_RUN_USER=www-data |
| | 535 | export APACHE_RUN_GROUP=www-data |
| | 536 | }}} |
| | 537 | |
| | 538 | そこで、ドキュメントディレクトリの権限を `murachi:www-data` に変更する。 |
| | 539 | |
| | 540 | {{{ |
| | 541 | #!console |
| | 542 | # cd /var/www/html |
| | 543 | # ls -la |
| | 544 | total 20 |
| | 545 | drwxr-xr-x 2 root root 4096 May 27 2017 . |
| | 546 | drwxr-xr-x 3 root root 4096 May 27 2017 .. |
| | 547 | -rw-r--r-- 1 root root 11321 May 27 2017 index.html |
| | 548 | # chown -R murachi:www-data . |
| | 549 | # ls -la |
| | 550 | total 20 |
| | 551 | drwxr-xr-x 2 murachi www-data 4096 May 27 2017 . |
| | 552 | drwxr-xr-x 3 root root 4096 May 27 2017 .. |
| | 553 | -rw-r--r-- 1 murachi www-data 11321 May 27 2017 index.html |
| | 554 | # |
| | 555 | }}} |