# サーバセキュリティ

**URL:** https://forum.ficusonline.com/t/topic/355
**Category:** Server
**Created:** [2020 年 3 月 21 日午後 2:51 UTC](https://forum.ficusonline.com/t/topic/355 "2020-03-21T14:51:43Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2020 年 3 月 22 日午前 2:41 UTC](https://forum.ficusonline.com/t/topic/355/2 "2020-03-22T02:41:41Z")

</div>

**apacheユーザの変更**

apache2デフォルトユーザ **www-data** の変更

```auto
$ sudo pico /etc/apache2/envvars
.....
# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=apache_user
export APACHE_RUN_GROUP=apache_user
....

```

```auto
$ sudo chown -R apache_user:apache_user /var/www/html
$ sudo chmod -R 7XX /var/www/html

```

www-dataによるawstats等関連サービスのアクセス権も変更すること。

> [@アクセスログ解析AWStatsの導入](https://forum.ficusonline.com/t/awstats/27/4):
>
> 3. Crontabの設定 www-dataにApacheログファイルの読み取り権限を付与しても、新規ログファイルが作成されると無効になり統計データに反映されません。 [https://bugs.launchpad.net/ubuntu/+source/awstats/+bug/1252467](https://bugs.launchpad.net/ubuntu/+source/awstats/+bug/1252467) awstatsという新規ユーザを作成し、このユーザをwww-data,admグループに追加します。 …

---

_[View the full topic](https://forum.ficusonline.com/t/topic/355)._
