さくらVPSにNginxをインストールする
yum コマンドでインストールできる。
[takatoh@www2465uo ~]$ sudo -s
[sudo] password for takatoh:
[root@www2465uo takatoh]# yum install nginx
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
epel/metalink | 6.8 kB 00:00
* base: ftp.tsukuba.wide.ad.jp
* epel: ftp.kddilabs.jp
* extras: ftp.tsukuba.wide.ad.jp
* updates: ftp.tsukuba.wide.ad.jp
base | 3.7 kB 00:00
epel | 4.4 kB 00:00
http://ftp.kddilabs.jp/Linux/packages/fedora/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
Trying other mirror.
epel | 4.4 kB 00:00
epel/primary_db | 6.3 MB 00:28
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.0.15-5.el6 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: gd for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: GeoIP for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: libgd.so.2()(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: libexslt.so.0()(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Processing Dependency: libGeoIP.so.1()(64bit) for package: nginx-1.0.15-5.el6.x86_64
--> Running transaction check
---> Package GeoIP.x86_64 0:1.5.1-5.el6 will be installed
---> Package gd.x86_64 0:2.0.35-11.el6 will be installed
--> Processing Dependency: libXpm.so.4()(64bit) for package: gd-2.0.35-11.el6.x86_64
---> Package libxslt.x86_64 0:1.1.26-2.el6_3.1 will be installed
--> Running transaction check
---> Package libXpm.x86_64 0:3.5.10-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
nginx x86_64 1.0.15-5.el6 epel 397 k
Installing for dependencies:
GeoIP x86_64 1.5.1-5.el6 epel 21 M
gd x86_64 2.0.35-11.el6 base 142 k
libXpm x86_64 3.5.10-2.el6 base 51 k
libxslt x86_64 1.1.26-2.el6_3.1 base 452 k
Transaction Summary
================================================================================
Install 5 Package(s)
Total download size: 22 M
Installed size: 46 M
Is this ok [y/N]: y
Downloading Packages:
http://ftp.tsukuba.wide.ad.jp/Linux/fedora/epel/6/x86_64/GeoIP-1.5.1-5.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 18 - "transfer closed with 16094685 bytes remaining to read"
Trying other mirror.
(1/5): GeoIP-1.5.1-5.el6.x86_64.rpm | 21 MB 01:09
(2/5): gd-2.0.35-11.el6.x86_64.rpm | 142 kB 00:00
(3/5): libXpm-3.5.10-2.el6.x86_64.rpm | 51 kB 00:00
(4/5): libxslt-1.1.26-2.el6_3.1.x86_64.rpm | 452 kB 00:02
(5/5): nginx-1.0.15-5.el6.x86_64.rpm | 397 kB 00:01
--------------------------------------------------------------------------------
Total 224 kB/s | 22 MB 01:39
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6)
Package: epel-release-6-8.noarch (@epel/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : GeoIP-1.5.1-5.el6.x86_64 1/5
Installing : libXpm-3.5.10-2.el6.x86_64 2/5
Installing : gd-2.0.35-11.el6.x86_64 3/5
Installing : libxslt-1.1.26-2.el6_3.1.x86_64 4/5
Installing : nginx-1.0.15-5.el6.x86_64 5/5
Verifying : libxslt-1.1.26-2.el6_3.1.x86_64 1/5
Verifying : libXpm-3.5.10-2.el6.x86_64 2/5
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/5
Verifying : nginx-1.0.15-5.el6.x86_64 4/5
Verifying : gd-2.0.35-11.el6.x86_64 5/5
Installed:
nginx.x86_64 0:1.0.15-5.el6
Dependency Installed:
GeoIP.x86_64 0:1.5.1-5.el6 gd.x86_64 0:2.0.35-11.el6
libXpm.x86_64 0:3.5.10-2.el6 libxslt.x86_64 0:1.1.26-2.el6_3.1
Complete!
インストールができたら起動。ついでに、サーバ起動時に自動的に起動するように設定。
[root@www2465uo takatoh]# service nginx start
nginx を起動中: [ OK ]
[root@www2465uo takatoh]# chkconfig nginx on
[root@www2465uo takatoh]# chkconfig --list nginx
nginx 0:off 1:off 2:on 3:on 4:on 5:on 6:off

