# Nginx 手動 設置

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

### 1-1. nginx実行可否検査 <a href="#id-1-1" id="id-1-1"></a>

`# ps -ef|grep nginx`

{% hint style="info" %}

<pre><code>nginx 実行ファイルパス/ コマンドパラメータ確認(=readlink /proc/$(pid)/exe)
nginx 設定ファイルパス確認(nginx -t)
<strong>nginx process owner確認
</strong></code></pre>

{% endhint %}

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

`# service nginx status`

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

`# service nginx reload`

`# nginx -s`

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

{% hint style="info" %}

<pre><code>/etc/nginx/nginx.conf
http {
include conf.d/*.conf
…
<strong>→ include conf.d/*.confラインがない場合は追加 !!!
</strong>(nginx設定ファイルパス)/conf.d ディレクトリがない場合は生成!!!
</code></pre>

{% endhint %}

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

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

{% hint style="info" %}

<pre><code><strong>→ http {} ブロックにaccess_log指示語ラインが追加されウェブログが生成されます。
</strong></code></pre>

{% endhint %}

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

⭐注意 : server {}ブロックにaccess\_log指示語がある場合, 親ブロックhttp {} ブロックのaccess\_log 指示語が無視されます。よって下記の通り, 手動でaccess\_log指示語ラインを追加する必要があります。

{% hint style="info" %}

<pre><code>server {
<strong>access_log /var/log/plura/weblog.log mod_plura;
</strong></code></pre>

{% endhint %}

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

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

`# echo 5.5.0 >> /etc/modplura`

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

`# echo /etc/nginx >> /etc/modplura`

`# touch /etc/.modplura`

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

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

`# chown nginx /var/log/plura`


---

# 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/nginx.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.
