# Apache手動インストール

## 1. 事前調査 <a href="#id-1" id="id-1"></a>

`# ps -ef|grep httpd`

`# ps -ef|grep apache`

{% hint style="info" %}

```
 → apache実行ファイルパス/ コマンドパラメータ確認(=readlink /proc/$(pid)/exe)
 apache process owner確認
```

{% endhint %}

`httpd|apache2 -V` → apache設定ファイルパス確認

`httpd|apache2 -v` → apacheバージョン確認

### 1-1. サービス登録確認 <a href="#id-1-1" id="id-1-1"></a>

`# service httpd|apache2 status`

### 1-2. 再設定テスト <a href="#id-1-2" id="id-1-2"></a>

`# service httpd|apache2 reload`

`${apache2dir}/bin/apachectl graceful`

`${apache2dir}/bin/httpd -k graceful`<br>

### 1-3. 設定ファイル確認 <a href="#id-1-3" id="id-1-3"></a>

標準インストール = /etc/httpd/conf.d/

{% hint style="info" %}

```
/etc/httpd/conf/httpd.conf
IncludeOptional conf.d/*.conf
```

{% endhint %}

カスタマイズインストール = /usr/local/apache2/conf/extra/

{% hint style="info" %}

```
/usr/local/apache2/conf/httpd.conf
Include conf/extra/plura.conf
→ 最後のラインに追加!!!
```

{% endhint %}

## 2. 標準インストール <a href="#id-2" id="id-2"></a>

`# curl https://repo.plura.io/v4/module/apache/centos/plura.conf -o /etc/httpd/conf.d/plura.conf`

`# curl https://repo.plura.io/v4/module/apache/centos/x86_64/7/2.4/mod_plura_module.so -o /etc/httpd/modules/mod_plura_module.so`

## 3. カスタマイズインストール <a href="#id-3" id="id-3"></a>

`# curl https://repo.plura.io/v4/module/apache/centos/plura.conf -o /usr/local/apache2/conf/extra/plura.conf`

`# curl https://repo.plura.io/v4/module/apache/centos/x86_64/7/2.4/mod_plura_module.so -o /usr/local/apache2/modules/mod_plura_module.so`<br>

plura.confファイル内容

{% hint style="info" %}

```
LoadModule mod_plura_module modules/mod_plura_module.so
mp_log /var/log/plura/weblog.log
```

{% endhint %}

## 4. 情報登録 <a href="#id-4" id="id-4"></a>

`# echo ModPlura-Apache > /etc/modplura`

`# echo 5.5.3 >> /etc/modplura`

`# echo /usr/sbin/httpd >> /etc/modplura`

`# echo /etc/httpd >> /etc/modplura`

`# echo /etc/httpd >> /etc/modplura`

`# echo centos/x86_64/7/2.4 >> /etc/modplura`

`# touch /etc/.modplura`

## 5. カスタマイズインストール <a href="#id-5" id="id-5"></a>

`# echo /usr/local/apache2/bin/httpd >> /etc/modplura`

`# echo /usr/local/apache2 >> /etc/modplura`

`# echo /usr/local/apache2 >> /etc/modplura`

## 6. 権限イシュー <a href="#id-6" id="id-6"></a>

⭐注意 : PLURAウェブログ生成ディレクトリのownerをapache worker processのownerで変更します。

`# chown apache /var/log/plura`

`# chmod 755 /var/log/plura`

`# chmod +x /etc/httpd/modules/mod_plura_module.so`

⭐selinux オブジェクトの設定

`# chcon -h system_u:object_r:httpd_sys_content_t:s0 /etc/httpd/conf.d/plura.conf`

`# chcon -h system_u:object_r:httpd_sys_content_t:s0 /etc/httpd/modules/mod_plura_module.so`

`# restorecon /etc/httpd/conf.d/plura.conf`

`# restorecon /etc/httpd/modules/mod_plura_module.so`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plura.io/ja/faq/siem/modplura/apache.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
