View
367
Download
0
Category
Preview:
Citation preview
FreeBSD under DigitalOcean VPS
Ryo ONODERA
<ryo_on@yk.rim.or.jp>
<ryoon@NetBSD.org>
DigitalOcean とは
● 固定ディスクに、 SSD を採用した VPS サービス
● 仮想マシン = Droplet● 単純な OS のみのセットアップ以外にも、 Ruby on
Rails や CMS 、リレーショナル・データベース・サー
バー等がセットアップ済みの環境も Droplet として用意されている。
DigitalOcean の料金
● 標準で提案されるコースでは、 10 USD/ 月 (0.015 USD/ 時 )● 最近の為替レートだと、 1,194 JPY/ 月くらい。
● 仕様 (10 USD/ 月コース )– CPU * 1– RAM: 1 GB– SSD: 30 GB– 転送量 : 2 TB
● 最も高いコースで640 USD/ 月 (0.952 USD/ 時 ) = 764,160 JPY/ 月 (1,137 JPY/ 時 )– CPU * 20– RAM: 64 GB– SSD: 640 GB– 転送量 : 9TB
DigitalOcean と FreeBSD
● 以前から、ユーザーフォーラムには、 FreeBSD の
Droplet を作れるようにして欲しいとの要望は挙がっていた。
● 2015-01-14 に FreeBSD 10.1 の Droplet を作れるようになった。https://www.digitalocean.com/community/tutorials/a-comparative-introduction-to-freebsd-for-linux-users
● FreeBSD 10.1 単体の Droplet 以外に、「 FreeBSD AMP 10.1 」という環境も作ることができる。
FreeBSD 10.1 単体の Droplet
FreeBSD AMP 10.1 の Droplet
疑問
● FreeBSD 10.1 しか書いていないが、 amd64 なのか
i386 なのか ? 当然 amd64 だと思うが…
● FreeBSD AMP 10.1 と書いてあるが、 FreeBSD Portsから Apache httpd/MySQL/PHP がインストールされ
ているのか ? バージョンはどうなのか ?
● dmesg とかも気になる。
● 試してみました。
FreeBSD 10.1 Droplet
● $ ssh freebsd@IPAddr● > uname -a
FreeBSD tritium 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
● amd64 だった。そして、何故かプロンプトが「 > 」。
● root@IPAddr で ssh login しようとすると、 freebsd 。アカウントを
使うようにメッセージが出るので、 freebsd@ を使うべきと分かる。
Please use the freebsd@ user to access thisdroplet.Connection to IPAddr closed.
●
dmesg
Copyright (c) 1992-2014 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
CPU: Intel(R) Xeon(R) CPU E5-2630L v2 @ 2.40GHz (2400.01-MHz K8-class CPU)
Origin = "GenuineIntel" Id = 0x306e4 Family = 0x6 Model = 0x3e Stepping =4
Features=0xf83fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,SS>
Features2=0xffba2223<SSE3,PCLMULQDQ,VMX,SSSE3,CX16,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND,HV>
AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
AMD Features2=0x1<LAHF>
Structured Extended Features=0x202<TSCADJ,ERMS>
VT-x: (disabled in BIOS) PAT,HLT,PAUSE,EPT,UG
real memory = 1073741824 (1024 MB)
avail memory = 1010630656 (963 MB)
dmesg
Event timer "LAPIC" quality 400
ACPI APIC Table: <BOCHS BXPCAPIC>
ioapic0 <Version 1.1> irqs 0-23 on motherboard
kbd1 at kbdmux0
random: <Software, Yarrow> initialized
acpi0: <BOCHS BXPCRSDT> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71,0x72-0x77 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 100000000 Hz quality 950
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
isab0: <PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX3 WDMA2 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc0a0-0xc0af at device 1.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
dmesg
uhci0: <Intel 82371SB (PIIX3) USB controller> port 0xc040-0xc05f irq 11 at device 1.2 on pci0
usbus0: controller did not stop
usbus0 on uhci0
pci0: <bridge> at device 1.3 (no driver attached)
vgapci0: <VGA-compatible display> mem 0xfc000000-0xfdffffff,0xfebf0000-0xfebf0fff at device 2.0 on pci0
vgapci0: Boot video device
virtio_pci0: <VirtIO PCI Network adapter> port 0xc060-0xc07f mem 0xfebf1000-0xfebf1fff irq 11 at device 3.0 on pci0
vtnet0: <VirtIO Networking Adapter> on virtio_pci0
virtio_pci0: host features: 0x719fffe7 <EventIdx,RingIndirect,NotifyOnEmpty,SetMacAddress,RxModeExtra,VLanFilter,RxMode,ControlVq,Status,MrgRxBuf,TxUFO,TxTSOECN,TxTSOv6,TxTSOv4,RxUFO,RxECN,RxTSOv6,RxTSOv4,TxAllGSO,MacAddress,0x4,RxChecksum,TxChecksum>
virtio_pci0: negotiated features: 0x308fbbe3 <EventIdx,RingIndirect,SetMacAddress,VLanFilter,RxMode,ControlVq,Status,MrgRxBuf,TxTSOECN,TxTSOv6,TxTSOv4,RxECN,RxTSOv6,RxTSOv4,TxAllGSO,MacAddress,RxChecksum,TxChecksum>
vtnet0: Ethernet address: 04:01:41:5f:ab:01
virtio_pci1: <VirtIO PCI Block adapter> port 0xc000-0xc03f mem 0xfebf2000-0xfebf2fff irq 11 at device 4.0 on pci0
vtblk0: <VirtIO Block Adapter> on virtio_pci1
dmesg
virtio_pci1: host features: 0x71000cd4 <EventIdx,RingIndirect,NotifyOnEmpty,ConfigWCE,Topology,SCSICmds,BlockSize,DiskGeometry,MaxNumSegs>
virtio_pci1: negotiated features: 0x10000854 <RingIndirect,ConfigWCE,BlockSize,DiskGeometry,MaxNumSegs>
vtblk0: 30720MB (62914560 512 byte sectors)
virtio_pci2: <VirtIO PCI Balloon adapter> port 0xc080-0xc09f irq 10 at device 5.0 on pci0
vtballoon0: <VirtIO Balloon Adapter> on virtio_pci2
virtio_pci2: host features: 0x71000002 <EventIdx,RingIndirect,NotifyOnEmpty,StatsVq>
virtio_pci2: negotiated features: 0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model IntelliMouse Explorer, device ID 4
fdc0: <floppy drive controller> port 0x3f2-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: does not respond
device_attach: fdc0 attach returned 6
dmesg
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (9600,n,8,1)
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc8fff,0xeb800-0xeffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
attimer0: <AT timer> at port 0x40 on isa0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
fdc0: No FDOUT register!
ppc0: cannot reserve I/O port range
Timecounters tick every 10.000 msec
usbus0: 12Mbps Full Speed USB v1.0
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
random: unblocking device.
GEOM: vtbd0: the secondary GPT header is not in the last LBA.
Timecounter "TSC-low" frequency 1200006519 Hz quality 800
Root mount waiting for: usbus0
uhub0: 2 ports with 2 removable, self powered
Trying to mount root from ufs:/dev/gpt/rootfs [rw]...
pkg info
arping-2.14_1 ARP level "ping" utility
avahi-app-0.6.31_3 Service discovery on a local network
avahi-autoipd-0.6.31 IPv4LL network address configuration daemon
ca_root_nss-3.17.3_1 The root certificate bundle from the Mozilla Project
curl-7.40.0 Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
dbus-1.8.12 Message bus system for inter-application communication
dbus-glib-0.100.2_1 GLib bindings for the D-BUS messaging system
expat-2.1.0_2 XML 1.0 parser written in C
gdbm-1.11_2 GNU database manager
gettext-runtime-0.19.3 GNU gettext runtime libraries and programs
glib-2.42.1 Some useful routines of C programming (current stable version)
gnome_subr-1.0 Common startup and shutdown subroutines used by GNOME scripts
gobject-introspection-1.42.0 Generate interface introspection data for GObject libraries
indexinfo-0.2.2 Utility to regenerate the GNU info page index
kbproto-1.0.6 KB extension headers
libICE-1.0.9,1 Inter Client Exchange library for X11
libSM-1.2.2_2,1 Session Management library for X11
pkg info
libX11-1.6.2_2,1 X11 library
libXau-1.0.8_2 Authentication Protocol library for X11
libXdmcp-1.1.1_2 X Display Manager Control Protocol library
libdaemon-0.14_1 Lightweight C library that eases the writing of UNIX daemons
libffi-3.2.1 Foreign Function Interface
libiconv-1.14_6 Character set conversion library
libnet-1.1.6_2,1 C library for creating IP packets
libpthread-stubs-0.3_6 This library provides weak aliases for pthread functions
libxcb-1.11 The X protocol C-language Binding (XCB) library
libxml2-2.9.2_2 XML parser library for GNOME
pcre-8.35_2 Perl Compatible Regular Expressions library
perl5-5.18.4_11 Practical Extraction and Report Language
pkg-1.4.4 Package manager
py27-pip-1.5.6 Tool for installing and managing Python packages
py27-setuptools27-5.5.1 Python packages installer
python2-2_3 The "meta-port" for version 2 of the Python interpreter
python27-2.7.9 Interpreted object-oriented programming language
rsync-3.1.1_3 Network file distribution/synchronization utility
sudo-1.8.11.p1 Allow others to run commands as root
xproto-7.0.26 X11 protocol headers
FreeBSD AMP 10.1 Droplet
● freebsd@ で login すると、
Thank you for using DigitalOcean's FreeBSD-AMP (FreeBSD, Apache, MySQL PHP) Application.Your web root is located at /usr/local/www/apache24/data/ and can be seen from http://IPAddr/The details of your PHP installation can be seen at http://IPAddr/info.phpYour MySQL root user's password is **********You are encouraged to run mysql_secure_installation to ready your server for production.
pkg
● Apache httpd 2.4.10● MySQL 5.6.22● PHP 5.6.4
● 全て FreeBSD Ports で入っていた。
pkg
apache24-2.4.10_2 Version 2.4.x of Apache web server
apr-1.5.1.1.5.4 Apache Portability Library
arping-2.14_1 ARP level "ping" utility
avahi-app-0.6.31_3 Service discovery on a local network
avahi-autoipd-0.6.31 IPv4LL network address configuration daemon
ca_root_nss-3.17.3_1 The root certificate bundle from the Mozilla Project
curl-7.40.0 Non-interactive tool to get files from FTP, GOPHER, HTTP(S) servers
db5-5.3.28_2 The Oracle Berkeley DB, revision 5.3
dbus-1.8.12 Message bus system for inter-application communication
dbus-glib-0.100.2_1 GLib bindings for the D-BUS messaging system
expat-2.1.0_2 XML 1.0 parser written in C
freetype2-2.5.5 Free and portable TrueType font rendering engine
gdbm-1.11_2 GNU database manager
gettext-runtime-0.19.3 GNU gettext runtime libraries and programs
glib-2.42.1 Some useful routines of C programming (current stable version)
gnome_subr-1.0 Common startup and shutdown subroutines used by GNOME scripts
gobject-introspection-1.42.0 Generate interface introspection data for GObject libraries
pkg
indexinfo-0.2.2 Utility to regenerate the GNU info page index
jpeg-8_6 IJG's jpeg compression utilities
kbproto-1.0.6 KB extension headers
libICE-1.0.9,1 Inter Client Exchange library for X11
libSM-1.2.2_2,1 Session Management library for X11
libX11-1.6.2_2,1 X11 library
libXau-1.0.8_2 Authentication Protocol library for X11
libXaw-1.0.12_2,2 X Athena Widgets library
libXdmcp-1.1.1_2 X Display Manager Control Protocol library
libXext-1.3.3,1 X11 Extension library
libXmu-1.1.2_2,1 X Miscellaneous Utilities libraries
libXp-1.0.2_2,1 X print library
libXpm-3.5.11_2 X Pixmap library
libXt-1.1.4_2,1 X Toolkit library
libdaemon-0.14_1 Lightweight C library that eases the writing of UNIX daemons
libffi-3.2.1 Foreign Function Interface
libiconv-1.14_6 Character set conversion library
libltdl-2.4.2.418 System independent dlopen wrapper
libmcrypt-2.5.8_2 Multi-cipher cryptographic library (used in PHP)
libnet-1.1.6_2,1 C library for creating IP packets
libpthread-stubs-0.3_6 This library provides weak aliases for pthread functions
pkg
libxcb-1.11 The X protocol C-language Binding (XCB) library
libxml2-2.9.2_2 XML parser library for GNOME
mod_php56-5.6.4 PHP Scripting Language
mysql56-client-5.6.22 Multithreaded SQL database (client)
mysql56-server-5.6.22 Multithreaded SQL database (server)
pcre-8.35_2 Perl Compatible Regular Expressions library
perl5-5.18.4_11 Practical Extraction and Report Language
php56-5.6.4 PHP Scripting Language
php56-gd-5.6.4 The gd shared extension for php
php56-mcrypt-5.6.4_1 The mcrypt shared extension for php
php56-mysql-5.6.4 The mysql shared extension for php
php56-mysqli-5.6.4 The mysqli shared extension for php
pkg-1.4.4 Package manager
png-1.6.16 Library for manipulating PNG images
printproto-1.0.5 Print extension headers
py27-pip-1.5.6 Tool for installing and managing Python packages
py27-setuptools27-5.5.1 Python packages installer
python2-2_3 The "meta-port" for version 2 of the Python interpreter
python27-2.7.9 Interpreted object-oriented programming language
rsync-3.1.1_3 Network file distribution/synchronization utility
sudo-1.8.11.p1 Allow others to run commands as root
t1lib-5.1.2_4,1 Type 1 font rasterization library for Unix/X11
xextproto-7.3.0 XExt extension headers
xproto-7.0.26 X11 protocol headers
その他 pkg これは何なのか ?
● /usr/local/bsd-cloudinit● LICENSE● openstack-common.conf● setup.py● cloudbaseinit● requirements.txt● test-requirements.txt● cloudinit● run.py● tools● doc● setup.cfg● tox.ini
Fin.
Recommended