メインメニューを開く

差分

Nginxのインストール

927 バイト追加, 2019年10月29日 (火) 14:38
【変更後】
<syntaxhighlight lang="text">user [useerid];</syntaxhighlight>
 
 
変更したら以下のコマンドでnginxを再起動します。
<syntaxhighlight lang="bash">systemctl restart nginx</syntaxhighlight>
 
== ルートディレクトリの変更 ==
次にルートディレクトリの変更を行います。<br/>
今回は仮に「/share/www」ディレクトリに変更すると仮定して、手順を挙げます。<br/>
 
 
以下のコマンドを実行して、nginxの設定ファイルを開きます。
<syntaxhighlight lang="bash">nano /etc/nginx/nginx.conf</syntaxhighlight>
 
 
ファイル内のルートディレクトリの設定をしている個所を、以下のように修正します。
 
 
【修正前】
<syntaxhighlight lang="text">location / {
root /usr/share/nginx/html;
index index.html index.htm;
}</syntaxhighlight>
 
 
【修正後】
<syntaxhighlight lang="text">location / {
root /share/www;
index index.html index.htm;
}</syntaxhighlight>