Ubuntu

Ubuntu 18.04Server へ gerberaをインストール


Ubuntu 18.04LTSgerberaをインストールした際のメモ

gerberaのインストール


$ sudo apt update

$ sudo apt install gerberasudo cp /etc/gerbera/config.xml /etc/gerbera/config.xml.bak

config.xmlの内容を環境に合わせて変更する。

初期状態のファイルはとりあえずバックアップしてから内容を変更。

$ sudo cp /etc/gerbera/config.xml /etc/gerbera/config.xml.bak

$ sudo vi /etc/gerbera/config.xml

mysqlとps3から利用したいので次の箇所を変更

変更箇所 変更前 変更後 内容
8行目 <ui enabled=”no” show-tooltips=”yes”> <ui enabled=”yes” show-tooltips=”yes”> gerberaWeb UIを有効化
28行目 <sqlite3 enabled=”yes”> <sqlite3 enabled=”no“> sqliteの無効化
31行目 <mysql enabled=”no”>

<host>localhost</host>

<username>gerbera</username>

<database>gerbera</database>

</MySQL>

<mysql enabled=”yes”>

<host>localhost</host>

<username>MYUSERNAME</username>

<database>MYDBNAME</database>

<password>MYPASSWORD</password>

</MySQL> 

mysqlを有効化
databaseのパスワードを追加
37行名 <protocolInfo extend=”no”/> <protocolInfo extend=”yes“/> PS3 support有効化

gerberaのサービス起動と初期設定


$ sudo service gerbera restart

WebUIにアクセスする為にPortを確認する。

$ sudo cat /var/log/syslog | grep gerbera

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Gerbera UPnP Server version 1.1.0 – http://gerbera.io/

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: ===============================================================================

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Gerbera is free software, covered by the GNU General Public License version 2

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Copyright 2016-2017 Gerbera Contributors.

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Gerbera is based on MediaTomb: Copyright 2005-2010 Gena Batsyan, Sergey Bostandzhyan, Leonhard Wimmer.

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: ===============================================================================

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Loading configuration from: /etc/gerbera/config.xml

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Checking configuration…

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Setting filesystem import charset to UTF-8

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Setting metadata import charset to UTF-8

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Setting playlist charset to UTF-8

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 WARNING: You enabled the YouTube feature, which allows you

Feb 3 08:59:22 server gerbera[2938]: to watch YouTube videos on your UPnP device!

Feb 3 08:59:22 server gerbera[2938]: Please check http://www.youtube.com/t/terms

Feb 3 08:59:22 server gerbera[2938]: By using this feature you may be violating YouTube

Feb 3 08:59:22 server gerbera[2938]: service terms and conditions!

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Configuration check succeeded.

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 WARNING: Sqlite3 database seems to be corrupt or doesn’t exist yet.

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: no sqlite3 backup is available or backup is corrupt. automatically creating database…

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: database created successfully.

Feb 3 08:59:22 server gerbera[2938]: 2019-02-03 08:59:22 INFO: Initialized port: 49152

portが49152と分かったのでWebブラウザーでアクセスしてgerberaからコンテンツにアクセスできるように設定する。


設定はmediatombと同じ

Ubuntu

Ubuntu18.04 でmediatombをソースからインストールする(その3)


Ubuntu 18.04LTSへ自前ビルドしたMediatombをシステム デーモンに登録した際のメモ

システムデーモン用にmediatomb設定ファイルを作成する


systemdへservice設定ファイルを作成する。

$ cd /etc/systemd/system/

$ sudo vi mediatomb.service

設定ファイルの内容は次の通り

[Unit]

Description = mediatomb

[Service]

ExecStart = /usr/local/bin/mediatomb

Restart = always

Type = simple

[Install]

WantedBy = multi-user.target

デーモン設定の有効化とサービスの開始


systemdへservice設定ファイルを作成する。

$ sudo systemctl enable mediatomb

Removed /etc/systemd/system/multi-user.target.wants/mediatomb.service.

Created symlink /etc/systemd/system/multi-user.target.wants/mediatomb.service /etc/systemd/system/mediatomb.service.

設定の確認。

$ sudo systemctl list-unit-files –type=service | grep mediatomb

mediatomb.service enabled

$ sudo systemctl start mediatomb

Ubuntu

Ubuntu18.04 でmediatombをソースからインストールする(その1)


MediatombDLNA Severを構築していたUbuntu 16.04LTS 18.04へアップグレードしたところ、Mediatombが消えてしまったので再構築した際の手順メモです。

Ubuntu 16.04LTSから18.04にアップグレードしたらMediatombが消えていた。


18.04へアップグレードするとmediatomb serverが起動してない?

とりあえず、サービスを手動で起動を試みるも、mediatobがサービスから消えて良いて起動なんかできない状態。

そもそも、mediatombのバイナリも存在してないし安易にサーバーをアップグレードしてはいけないと、後悔….

  • パッケージから再インストール 失敗

    気を取り直して再インストール。⇒失敗。

    $ sudo apt mediatomb
     E: Invalid operation mediatomb

    リポジトリーを検索すると何故か“gerbera”とか“minidlna”などの別のmedia serberがレコメンドされる結果。

    $ sudo apt search mediatomb
     Sorting... Done
     Full Text Search... Done
     gerbera/bionic 1.1.0+dfsg-2 amd64
      UPnP MediaServer
    	
     minidlna/bionic 1.2.1+dfsg-1 amd64
      lightweight DLNA/UPnP-AV server targeted at embedded systems

18.04では提供されてなく存在しないみたい。


 

Ubuntu · 仮想化

仮想HDDのHDD容量を拡張してUbuntuで利用できるようにする。


仮想マシン上のubuntuで容量が足りなくなったら?

 仮想マシン上でubuntuを使っているとうっかり HDD容量が足りなくなる事ありますよね。

そんな時は仮想HDDのHDD容量を増やしてあげれば良い訳ですが、増やしたHDD容量がubuntu上で利用できるまでの手順がややっこしいので整理してみました。

手順の全体の流れは次の通り。

◆ 仮想HDDのHDD容量を変更する。

◆ partition sizeを拡張する。(VM ubuntuでの操作。)

◆ (LVM) LVMを拡張する。(VM ubuntuでの操作。)

◆ 拡張した領域をFilesystemへ反映する。(VM ubuntuでの操作。)

上記はLVMを利用している環境での例となります。

また、LVMを利用していない場合はLVMの操作は省略してください。

LVM環境の場合、新規仮想HDDを追加してLVMを更新するのが一般的だと思います今回はLVMを利用してない環境と手順を合わせて整理したかったので上記のような手順となっております。

仮想HDDのHDD容量を変更する

 利用している仮想環境に合わせて仮想HDDの設定を変更してください。

例ではESXi v5.5環境での手順です。



partition sizeを拡張する。(VM ubuntuでの操作。)

 (parted) resizepart コマンドで partition size を拡張する。


手順の流れは次の通り。

  1. deviceの状態を確認する。 ⇒ (parted) print all
  2. 指定sizeの単位を設定する。⇒ (parted) unit
  3. sizeを拡張する。 ⇒ (parted) resizepart
  4. 拡張した結果を確認する。(parted)print all
	$ sudo parted /dev/sda
	GNU Parted 3.2
	Using /dev/sda
	Welcome to GNU Parted! Type 'help' to view a list of commands.
	(parted) print all
	Model: VMware Virtual disk (scsi)
	Disk /dev/sda: 34.4GB
	Sector size (logical/physical): 512B/512B
	Partition Table: gpt
	Disk Flags:
	
	Number  Start   End     Size    File system  Name  Flags
	 1      1049kB  2097kB  1049kB                     bios_grub
	 2      2097kB  1076MB  1074MB  ext4
	 3      1076MB  17.2GB  16.1GB
	
	
	Model: Linux device-mapper (linear) (dm)
	Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 4295MB
	Sector size (logical/physical): 512B/512B
	Partition Table: loop
	Disk Flags:
	
	Number  Start  End     Size    File system  Flags
	 1      0.00B  4295MB  4295MB  ext4
	
	
	(parted) unit
	Unit?  [compact]?
	(parted) help unit
	  unit UNIT                                set the default unit to UNIT
	
	        UNIT is one of: s, B, kB, MB, GB, TB, compact, cyl, chs, %, kiB, MiB, GiB, TiB
	(parted) unit GB
	(parted) resizepart 3 34.4GB
	(parted) print all
	Model: VMware Virtual disk (scsi)
	Disk /dev/sda: 34.4GB
	Sector size (logical/physical): 512B/512B
	Partition Table: gpt
	Disk Flags:
	
	Number  Start   End     Size    File system  Name  Flags
	 1      0.00GB  0.00GB  0.00GB                     bios_grub
	 2      0.00GB  1.08GB  1.07GB  ext4
	 3      1.08GB  34.4GB  33.3GB
	
	
	Model: Linux device-mapper (linear) (dm)
	Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 4.29GB
	Sector size (logical/physical): 512B/512B
	Partition Table: loop
	Disk Flags:
	
	Number  Start   End     Size    File system  Flags
	 1      0.00GB  4.29GB  4.29GB  ext4
	
	
	(parted)q

(LVM) LVMを拡張する。(VM ubuntuでの操作。)

 拡張したpartition
sizeLVM で利用できるように設定する。

手順の流れは次の通り。

PV sizeの拡張

  1. PVの状態を確認する。 ⇒ pvdisplay
  2. PVのsizeを拡張する。 ⇒ pvresize
  3. 拡張した結果を確認する。pvdisplay

◆LV sizeの拡張

  1. LVの状態を確認する。 ⇒ lvdisplay
  2. LVのsizeを拡張する。 ⇒ lvextend
  3. 拡張した結果を確認する。lvdisplay


PV sizeの拡張

	$ sudo pvdisplay
	  --- Physical volume ---
	  PV Name               /dev/sda3
	  VG Name               ubuntu-vg
	  PV Size               <15.00 GiB / not usable 0
	  Allocatable           yes
	  PE Size               4.00 MiB
	  Total PE              3839
	  Free PE               2815
	  Allocated PE          1024
	  PV UUID               G4pi2r-wlRi-8t5Y-pcaF-H47v-3uX4-4ylWLd
	
	$ sudo pvresize /dev/sda3
	  Physical volume "/dev/sda3" changed
	  1 physical volume(s) resized / 0 physical volume(s) not resized
	
	$ sudo pvdisplay
	  --- Physical volume ---
	  PV Name               /dev/sda3
	  VG Name               ubuntu-vg
	  PV Size               <31.00 GiB / not usable 16.50 KiB
	  Allocatable           yes
	  PE Size               4.00 MiB
	  Total PE              7935
	  Free PE               6911
	  Allocated PE          1024
	  PV UUID               G4pi2r-wlRi-8t5Y-pcaF-H47v-3uX4-4ylWLd


もし、PVサイズを指定する場合は次のコマンドを利用すれば良い。

>pvresize –setphysicalvolumesize [size] [device]

$ sudo pvresize --setphysicalvolumesize 20G /dev/sda3

◆LV sizeの拡張

$ sudo lvdisplay
	  --- Logical volume ---
	  LV Path                /dev/ubuntu-vg/ubuntu-lv
	  LV Name                ubuntu-lv
	  VG Name                ubuntu-vg
	  LV UUID                H6hjX4-uFx2-HWxw-o7H3-rXDU-VI4a-lt4tL6
	  LV Write Access        read/write
	  LV Creation host, time ubuntu-server, 2018-09-23 23:10:39 +0000
	  LV Status              available
	  # open                 1
	  LV Size                4.00 GiB
	  Current LE             1024
	  Segments               1
	  Allocation             inherit
	  Read ahead sectors     auto
	  - currently set to     256
	  Block device           253:0
	
	$ sudo lvextend -l 100%FREE /dev/ubuntu-vg/ubuntu-lv
	  Size of logical volume ubuntu-vg/ubuntu-lv changed from 4.00 GiB (1024 extents) to <27.00 GiB (6911 extents).
	  Logical volume ubuntu-vg/ubuntu-lv successfully resized.
	
	$ sudo lvdisplay
	  --- Logical volume ---
	  LV Path                /dev/ubuntu-vg/ubuntu-lv
	  LV Name                ubuntu-lv
	  VG Name                ubuntu-vg
	  LV UUID                H6hjX4-uFx2-HWxw-o7H3-rXDU-VI4a-lt4tL6
	  LV Write Access        read/write
	  LV Creation host, time ubuntu-server, 2018-09-23 23:10:39 +0000
	  LV Status              available
	  # open                 1
	  LV Size                <27.00 GiB
	  Current LE             6911
	  Segments               1
	  Allocation             inherit
	  Read ahead sectors     auto
	  - currently set to     256
	  Block device           253:0

拡張した領域をFile systemへ反映する。(VM ubuntuでの操作。)

 拡張した領域をFile systemへ反映する。


手順の流れは次の通り。

  1. File systemのチェック。 ⇒ e2fsck
  2. File systemへ反映する。 ⇒ resize2fe
  3. 反映した結果を確認する。df
$ sudo e2fsck -f /dev/ubuntu-vg/ubuntu-lv
	e2fsck 1.44.1 (24-Mar-2018)
	/dev/ubuntu-vg/ubuntu-lv is mounted.
	e2fsck: Cannot continue, aborting.
	
	
	$ sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
	resize2fs 1.44.1 (24-Mar-2018)
	Filesystem at /dev/ubuntu-vg/ubuntu-lv is mounted on /; on-line resizing required
	old_desc_blocks = 1, new_desc_blocks = 4
	The filesystem on /dev/ubuntu-vg/ubuntu-lv is now 7076864 (4k) blocks long.
	
	$ df -h
	Filesystem                         Size  Used Avail Use% Mounted on
	udev                               464M     0  464M   0% /dev
	tmpfs                               99M  1.1M   98M   2% /run
	/dev/mapper/ubuntu--vg-ubuntu--lv   27G  3.6G   22G  14% /
	tmpfs                              493M     0  493M   0% /dev/shm
	tmpfs                              5.0M     0  5.0M   0% /run/lock
	tmpfs                              493M     0  493M   0% /sys/fs/cgroup
	/dev/loop0                          88M   88M     0 100% /snap/core/5548
	/dev/loop1                          88M   88M     0 100% /snap/core/5328
	/dev/loop2                          87M   87M     0 100% /snap/core/4917
	/dev/loop3                          58M   58M     0 100% /snap/powershell/11
	/dev/sda2                          976M  209M  701M  23% /boot
	tmpfs                               99M     0   99M   0% /run/user/1000

 

Ubuntu

Ubuntu でのリポジトリの追加手順

aptで見つからないパッケージあった場合に、リポジトリへ追加する手順のメモです。(ubuntu18.04)

Ubuntuパッケージ検索でリポジトリ情報を調べる。

http://packages.ubuntu.com/ja/

上記ページの検索窓にキーワードを入れて検索。(例はffmpeg)


[検索結果]


bionic (18.04LTS) (video): Tools for transcoding, streaming and playing of multimedia files [universe]

7:3.4.4-0ubuntu0.18.04.1 [security]: amd64 i386

7:3.4.2-2 [ports]: arm64 armhf ppc64el s390x

amd64, i386[universe] に含まれていることがわかる。

repositoryの追加

とりあえず、現在のrepository情報を確認する。

$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

情報が無いようなので追加する。

$ sudo apt-add-repository universe
'universe' distribution component enabled for all sources.
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:4 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [8,570 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/universe Translation-en [4,941 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [74.7 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic-security/universe Translation-en [42.3 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [214 kB]
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [101 kB]
Fetched 13.9 MB in 15s (960 kB/s)

追加したリポジトリーの確認。

$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe

 

(参考情報)apt-add-repositoryの追加方法


もし、apt-add-repositoryが無い場合は次のコマンドでインストールする。

$ sudo apt apt-add-repository

 

Ubuntu

Ubuntuのバージョン確認

Ubuntuのバージョン情報は“/etc/os-release”にある。

$ cat /etc/os-release

NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Ubuntu

Ubuntu 18.04 Serverへ開発環境をセットアップ

Ubuntu18.04でgccやmakeが利用できるように開発環境のセットアップ手順のメモです。

ビルドツールのインストール

$ sudo apt-get install build-essential


gcc
makeのバージョン確認


$ gcc --version
gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Ubuntu

Ubuntu Server18.04へアップデートした際に発生した nginxのエラー対処

nginxを導入しているUbuntu Server 16.04から18.04へアップグレードした際に次のようなエラーが発生。


その時の対処方法について、メモを記録として残す。

Error 内容を logから確認する。

$ cat /var/log/nginx/error.log
2018/09/23 11:11:44 [crit] 2871#2871: *1 connect() to unix:run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, 

どうもUpgreadeした際にphpupdateされてphp7.0が使えなくなった模様。

どのバージョンのphpに更新されたか確認すると。

php7.2に更新されているみたい。

$ dpkg -l | grep php
rc  libapache2-mod-php7.0                 7.0.32-0ubuntu0.16.04.1            amd64        server-side, HTML-embedded scripting language (Apache 2 module)
rc  libapache2-mod-php7.2                 7.2.10-0ubuntu0.18.04.1            amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                            1:60ubuntu1                        all          Common files for PHP packages
ii  php-mysql                             1:7.2+60ubuntu1                    all          MySQL module for PHP [default]
ii  php-pear                              1:1.10.5+submodules+notgz-1ubuntu1 all          PEAR Base System
rc  php7.0-cgi                            7.0.32-0ubuntu0.16.04.1            amd64        server-side, HTML-embedded scripting language (CGI binary)
rc  php7.0-cli                            7.0.32-0ubuntu0.16.04.1            amd64        command-line interpreter for the PHP scripting language
ii  php7.0-common                         7.0.32-0ubuntu0.16.04.1            amd64        documentation, examples and common module for PHP
rc  php7.0-fpm                            7.0.32-0ubuntu0.16.04.1            amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
rc  php7.0-json                           7.0.32-0ubuntu0.16.04.1            amd64        JSON module for PHP
rc  php7.0-mbstring                       7.0.32-0ubuntu0.16.04.1            amd64        MBSTRING module for PHP
rc  php7.0-mysql                          7.0.32-0ubuntu0.16.04.1            amd64        MySQL module for PHP
rc  php7.0-opcache                        7.0.32-0ubuntu0.16.04.1            amd64        Zend OpCache module for PHP
rc  php7.0-readline                       7.0.32-0ubuntu0.16.04.1            amd64        readline module for PHP
ii  php7.0-xml                            7.0.32-0ubuntu0.16.04.1            amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii  php7.2-cli                            7.2.10-0ubuntu0.18.04.1            amd64        command-line interpreter for the PHP scripting language
ii  php7.2-common                         7.2.10-0ubuntu0.18.04.1            amd64        documentation, examples and common module for PHP
ii  php7.2-fpm                            7.2.10-0ubuntu0.18.04.1            amd64        server-side, HTML-embedded scripting language (FPM-CGI binary)
ii  php7.2-json                           7.2.10-0ubuntu0.18.04.1            amd64        JSON module for PHP
ii  php7.2-mbstring                       7.2.10-0ubuntu0.18.04.1            amd64        MBSTRING module for PHP
ii  php7.2-mysql                          7.2.10-0ubuntu0.18.04.1            amd64        MySQL module for PHP
ii  php7.2-opcache                        7.2.10-0ubuntu0.18.04.1            amd64        Zend OpCache module for PHP
ii  php7.2-readline                       7.2.10-0ubuntu0.18.04.1            amd64        readline module for PHP
ii  php7.2-xml                            7.2.10-0ubuntu0.18.04.1            amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP

nginx default.confを修正してServiceを再起動する。

古い情報をコメントアウトして、新たにphp7.2-fpm.sockを追加する。

#fastcgi_pass unix:run/php/php7.0-fpm.sock;

fastcgi_pass unix:run/php/php7.2-fpm.sock;

$ sudo vi /etc/nginx/conf.d/default.conf
server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/log/host.access.log  main;

    location / {
        #root   /usr/share/nginx/html;
        root   /var/www/html;
        #index  index.html index.htm;
        index  index.html index.htm index.php;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
    #    root           html;
        root /var/www/html;
    #    fastcgi_pass   127.0.0.1:9000;
        #fastcgi_pass unix:run/php/php7.0-fpm.sock;
        fastcgi_pass unix:run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

nginx serviceを再起動する。

$ sudo service nginx restart

まとめ

 これでnginxも問題なく利用できるようになりました。