FreeBSD on さくらVPS

ちょっと stable にするのに手間取ったので、とりあえず FreeBSD 8.1R i386 を入れなおして環境を構築してみた。

インターネット上のサーバとしてとりあえず最小限

  • bind (OS標準)
  • mysql-server-5.1.51_1 and mysql-client-5.1.51_1
  • cyrus-sasl-2.1.23
  • cyrus-sasl-saslauthd-2.1.23
  • postfix-2.7.1,1
  • courier-imap-4.8.0,2
  • courier-authlib-base-0.63.0_1
  • clamav-0.96.3_2
  • clamsmtp-1.10_3
  • apache-2.2.16_2
  • php5-5.3.3_2
  • php5-extensions-1.4
  • pf + bruteforceblocker-1.2.3

辺りを入れてみた。当然 ports から入れているので、その過程で他の ports も幾つかインストールされているけれど。

以下、pkg_infoの結果

apache-2.2.16_2     Version 2.2.x of Apache web server with prefork MPM.
apr-ipv6-devrandom-gdbm-db42-mysql51-1.4.2.1.3.10 Apache Portability Library
arc-5.21o_1         Create & extract files from DOS .ARC files
arj-3.10.22_4       Open-source ARJ
autoconf-2.67       Automatically configure source code on many Un*x platforms
autoconf-2.68       Automatically configure source code on many Un*x platforms
autoconf-wrapper-20071109 Wrapper script for GNU autoconf
automake-1.11.1     GNU Standards-compliant Makefile generator (1.11)
automake-wrapper-20071109 Wrapper script for GNU automake
bigreqsproto-1.1.0  BigReqs extension headers
bruteforceblocker-1.2.3 Checks for SSH bruteforce and blocks given IPs
ca_root_nss-3.12.6  The root certificate bundle from the Mozilla Project
cclient-2007e,1     Mark Crispin's C-client mail access routines
clamav-0.96.3_2     Command line virus scanner written entirely in C
clamsmtp-1.10_3     An ClamAV anti-virus SMTP Filter
courier-authlib-base-0.63.0_1 Courier authentication library base
courier-imap-4.8.0,2 IMAP (and POP3) server that provides access to Maildir mail
curl-7.21.1         Non-interactive tool to get files from FTP, GOPHER, HTTP(S)
cyrus-sasl-2.1.23   RFC 2222 SASL (Simple Authentication and Security Layer)
cyrus-sasl-saslauthd-2.1.23 SASL authentication server for cyrus-sasl2
db41-4.1.25_4       The Berkeley DB package, revision 4.1
db42-4.2.52_5       The Berkeley DB package, revision 4.2
en-freebsd-doc-20100625 Documentation from the FreeBSD Documentation Project
expat-2.0.1_1       XML 1.0 parser written in C
freetype2-2.4.2     A free and portable TrueType font rendering engine
gdbm-1.8.3_3        The GNU database manager
gettext-0.18.1.1    GNU gettext package
gmake-3.81_4        GNU version of 'make' utility
help2man-1.38.2_1   Automatically generating simple manual pages from program o
inputproto-2.0      Input extension headers
ja-freebsd-doc-20100625 Japanese translation of the FreeBSD Documentation Project
jpeg-8_3            IJG's jpeg compression utilities
kbproto-1.0.4       KB extension headers
lha-1.14i_6         Archive files using LZSS and Huffman compression (.lzh file
libICE-1.0.6,1      Inter Client Exchange library for X11
libSM-1.1.1_3,1     Session Management library for X11
libX11-1.3.3_1,1    X11 library
libXau-1.0.5        Authentication Protocol library for X11
libXaw-1.0.7,1      X Athena Widgets library
libXdmcp-1.0.3      X Display Manager Control Protocol library
libXext-1.1.1,1     X11 Extension library
libXmu-1.0.5,1      X Miscellaneous Utilities libraries
libXp-1.0.0,1       X print library
libXpm-3.5.7        X Pixmap library
libXt-1.0.7         X Toolkit library
libcheck-0.9.8      A unit test framework for C
libgcrypt-1.4.6     General purpose crypto library based on code used in GnuPG
libgpg-error-1.8    Common error values for all GnuPG components
libiconv-1.13.1_1   A character set conversion library
libltdl-2.2.10      System independent dlopen wrapper
libmcrypt-2.5.8     Multi-cipher cryptographic library (used in PHP)
libpthread-stubs-0.3_3 This library provides weak aliases for pthread functions
libtool-2.2.10      Generic shared library support script
libxcb-1.7          The X protocol C-language Binding (XCB) library
libxml2-2.7.7       XML parser library for GNOME
libxslt-1.1.26_2    The XSLT C library for GNOME
m4-1.4.15,1         GNU m4
mysql-client-5.1.51_1 Multithreaded SQL database (client)
mysql-server-5.1.51_1 Multithreaded SQL database (server)
oniguruma-4.7.1     A BSDL Regular Expressions library compatible with POSIX/GN
p5-Digest-HMAC-1.02 Perl5 interface to HMAC Message-Digest Algorithms
p5-Digest-SHA1-2.13 Perl interface to the SHA-1 Algorithm
p5-HTML-Parser-3.68 Perl5 module for parsing HTML documents
p5-HTML-Tagset-3.20 Some useful data table in parsing HTML
p5-IO-Socket-INET6-2.65 Perl module with object interface to AF_INET6 domain socket
p5-Locale-gettext-1.05_3 Message handling functions
p5-Net-DNS-0.66_1   Perl5 interface to the DNS resolver, and dynamic updates
p5-Net-IP-1.25_2    Perl extension for manipulating IPv4/IPv6 addresses
p5-Socket6-0.23     IPv6 related part of the C socket.h defines and structure m
p5-Sys-Hostname-Long-1.4 Try every conceivable way to get full hostname
p5-URI-1.56         Perl5 interface to Uniform Resource Identifier (URI) refere
p5-Unix-Syslog-1.1  Perl5 interface to the UNIX syslog(3) calls
p5-libwww-5.837     Perl5 library for WWW access
pcre-8.10           Perl Compatible Regular Expressions library
pecl-APC-3.1.4      Alternative PHP Cache
pecl-memcache-3.0.4_1 Memcached extension
pecl-yaz-1.0.14_2   A PECL extension that implements a Z39.50 client
perl-5.10.1_2       Practical Extraction and Report Language
php5-5.3.3_2        PHP Scripting Language
php5-bz2-5.3.3_2    The bz2 shared extension for php
php5-calendar-5.3.3_2 The calendar shared extension for php
php5-ctype-5.3.3_2  The ctype shared extension for php
php5-curl-5.3.3_2   The curl shared extension for php
php5-dom-5.3.3_2    The dom shared extension for php
php5-extensions-1.4 A "meta-port" to install PHP extensions
php5-filter-5.3.3_2 The filter shared extension for php
php5-ftp-5.3.3_2    The ftp shared extension for php
php5-gd-5.3.3_2     The gd shared extension for php
php5-gettext-5.3.3_2 The gettext shared extension for php
php5-hash-5.3.3_2   The hash shared extension for php
php5-iconv-5.3.3_2  The iconv shared extension for php
php5-imap-5.3.3_2   The imap shared extension for php
php5-json-5.3.3_2   The json shared extension for php
php5-mbstring-5.3.3_2 The mbstring shared extension for php
php5-mcrypt-5.3.3_2 The mcrypt shared extension for php
php5-mysql-5.3.3_2  The mysql shared extension for php
php5-mysqli-5.3.3_2 The mysqli shared extension for php
php5-openssl-5.3.3_2 The openssl shared extension for php
php5-pcntl-5.3.3_2  The pcntl shared extension for php
php5-pdo-5.3.3_2    The pdo shared extension for php
php5-pdo_sqlite-5.3.3_2 The pdo_sqlite shared extension for php
php5-posix-5.3.3_2  The posix shared extension for php
php5-session-5.3.3_2 The session shared extension for php
php5-simplexml-5.3.3_2 The simplexml shared extension for php
php5-sockets-5.3.3_2 The sockets shared extension for php
php5-sqlite-5.3.3_2 The sqlite shared extension for php
php5-tokenizer-5.3.3_2 The tokenizer shared extension for php
php5-xml-5.3.3_2    The xml shared extension for php
php5-xmlreader-5.3.3_2 The xmlreader shared extension for php
php5-xmlrpc-5.3.3_2 The xmlrpc shared extension for php
php5-xmlwriter-5.3.3_2 The xmlwriter shared extension for php
php5-xsl-5.3.3_2    The xsl shared extension for php
php5-zip-5.3.3_2    The zip shared extension for php
php5-zlib-5.3.3_2   The zlib shared extension for php
pkg-config-0.25_1   A utility to retrieve information about installed libraries
png-1.4.3           Library for manipulating PNG images
portupgrade-2.4.6_4,2 FreeBSD ports/packages administration and management tool s
postfix-2.7.1,1     A secure alternative to widely-used Sendmail
printproto-1.0.4    Print extension headers
python26-2.6.6      An interpreted object-oriented programming language
ruby-1.8.7.248_5,1  An object-oriented interpreted scripting language
ruby18-bdb-0.6.5_1  Ruby interface to Sleepycat's Berkeley DB revision 2 or lat
sqlite3-3.7.2       An SQL database engine in a C library
sysconftool-0.15_3  Helps to install application configuration files
t1lib-5.1.2_1,1     A Type 1 Rasterizer Library for UNIX/X11
tcl-8.5.9           Tool Command Language
tcl-modules-8.5.9   Tcl common modules
unzoo-4.4_2         A zoo archive extractor
xcb-proto-1.6       The X protocol C-language Binding (XCB) protocol
xcmiscproto-1.2.0   XCMisc extension headers
xextproto-7.1.1     XExt extension headers
xf86bigfontproto-1.2.0 XFree86-Bigfont extension headers
xorg-macros-1.6.0   X.Org development aclocal macros
xproto-7.0.16       X11 protocol headers
xtrans-1.2.5        Abstract network code for X
yaz-4.0.11          Z39.50/SR client and API library

MySQLが 5.1 なのは PHP のmysqliモジュールがエラーを吐いてビルド出来なかったからで、詳しく調べなかったけれども、ライブラリが足らない、そんな感じ。とりあえず困ることは無いので、5.1 でお茶を濁した。

Apacheのオプション指定

Options for apache 2.2.16_2
[ ] THREADS               Enable threads support in APR
[X] MYSQL                 Enable MySQL support for apr-dbd
[ ] PGSQL                 Enable PostgreSQL support for apr-dbd
[ ] SQLITE                Enable SQLite support for apr-dbd
[X] IPV6                  Enable IPv6 support
[ ] BDB                   Enable BerkeleyDB dbm
[X] AUTH_BASIC            Enable mod_auth_basic
[X] AUTH_DIGEST           Enable mod_auth_digest
[X] AUTHN_FILE            Enable mod_authn_file
[X] AUTHN_DBD             Enable mod_authn_dbd
[X] AUTHN_DBM             Enable mod_authn_dbm
[X] AUTHN_ANON            Enable mod_authn_anon
[X] AUTHN_DEFAULT         Enable mod_authn_default
[X] AUTHN_ALIAS           Enable mod_authn_alias
[X] AUTHZ_HOST            Enable mod_authz_host
[X] AUTHZ_GROUPFILE       Enable mod_authz_groupfile
[X] AUTHZ_USER            Enable mod_authz_user
[X] AUTHZ_DBM             Enable mod_authz_dbm
[X] AUTHZ_OWNER           Enable mod_authz_owner
[X] AUTHZ_DEFAULT         Enable mod_authz_default
[X] CACHE                 Enable mod_cache
[X] DISK_CACHE            Enable mod_disk_cache
[X] FILE_CACHE            Enable mod_file_cache
[ ] MEM_CACHE             Enable mod_mem_cache
[X] DAV                   Enable mod_dav
[X] DAV_FS                Enable mod_dav_fs
[ ] BUCKETEER             Enable mod_bucketeer
[ ] CASE_FILTER           Enable mod_case_filter
[ ] CASE_FILTER_IN        Enable mod_case_filter_in
[ ] EXT_FILTER            Enable mod_ext_filter
[ ] LOG_FORENSIC          Enable mod_log_forensic
[ ] OPTIONAL_HOOK_EXPORT  Enable mod_optional_hook_export
[ ] OPTIONAL_HOOK_IMPORT  Enable mod_optional_hook_import
[ ] OPTIONAL_FN_IMPORT    Enable mod_optional_fn_import
[ ] OPTIONAL_FN_EXPORT    Enable mod_optional_fn_export
[ ] LDAP                  Enable mod_ldap
[ ] AUTHNZ_LDAP           Enable mod_authnz_ldap
[X] ACTIONS               Enable mod_actions
[X] ALIAS                 Enable mod_alias
[X] ASIS                  Enable mod_asis
[X] AUTOINDEX             Enable mod_autoindex
[X] CERN_META             Enable mod_cern_meta
[X] CGI                   Enable mod_cgi
[X] CHARSET_LITE          Enable mod_charset_lite
[X] DBD                   Enable mod_dbd
[X] DEFLATE               Enable mod_deflate
[X] DIR                   Enable mod_dir
[X] DUMPIO                Enable mod_dumpio
[X] ENV                   Enable mod_env
[X] EXPIRES               Enable mod_expires
[X] HEADERS               Enable mod_headers
[X] IMAGEMAP              Enable mod_imagemap
[X] INCLUDE               Enable mod_include
[X] INFO                  Enable mod_info
[X] LOG_CONFIG            Enable mod_log_config
[X] LOGIO                 Enable mod_logio
[X] MIME                  Enable mod_mime
[X] MIME_MAGIC            Enable mod_mime_magic
[X] NEGOTIATION           Enable mod_negotiation
[X] REWRITE               Enable mod_rewrite
[X] SETENVIF              Enable mod_setenvif
[X] SPELING               Enable mod_speling
[X] STATUS                Enable mod_status
[X] UNIQUE_ID             Enable mod_unique_id
[X] USERDIR               Enable mod_userdir
[X] USERTRACK             Enable mod_usertrack
[X] VHOST_ALIAS           Enable mod_vhost_alias
[X] FILTER                Enable mod_filter
[X] VERSION               Enable mod_version
[X] PROXY                 Enable mod_proxy
[ ] PROXY_CONNECT         Enable mod_proxy_connect
[X] PATCH_PROXY_CONNECT   Patch proxy_connect SSL support
[X] PROXY_FTP             Enable mod_proxy_ftp
[X] PROXY_HTTP            Enable mod_proxy_http
[X] PROXY_AJP             Enable mod_proxy_ajp
[ ] PROXY_BALANCER        Enable mod_proxy_balancer
[ ] PROXY_SCGI            Enable mod_proxy_scgi
[X] SSL                   Enable mod_ssl
[X] SUEXEC                Enable mod_suexec
[ ] SUEXEC_RSRCLIMIT      SuEXEC rlimits based on login class
[X] REQTIMEOUT            Enable mod_reqtimeout
[ ] CGID                  Enable mod_cgid

php5のオプション指定

Options for  php5 5.3.3_2
[X] CLI        Build CLI version
[X] CGI        Build CGI version
[ ] FPM        Build FPM version (experimental)
[X] APACHE     Build Apache module
[ ] AP2FILTER  Use Apache 2.x filter interface (experimental)
[ ] DEBUG      Enable debug
[X] SUHOSIN    Enable Suhosin protection system
[X] MULTIBYTE  Enable zend multibyte support
[X] IPV6       Enable ipv6 support
[ ] MAILHEAD   Enable mail header patch
[ ] LINKTHR    Link thread lib (for threaded extensions)

php5-extensionsのオプション指定

Options for php5-extensions 1.4
[ ] BCMATH      bc style precision math functions
[X] BZ2         bzip2 library support
[X] CALENDAR    calendar conversion support
[X] CTYPE       ctype functions
[X] CURL        CURL support
[ ] DBA         dba support
[X] DOM         DOM support
[ ] EXIF        EXIF support
[ ] FILEINFO    fileinfo support
[X] FILTER      input filter support
[ ] FRIBIDI     FriBidi support
[X] FTP         FTP support
[X] GD          GD library support
[X] GETTEXT     gettext library support
[ ] GMP         GNU MP support
[X] HASH        HASH Message Digest Framework
[X] ICONV       iconv support
[X] IMAP        IMAP support
[ ] INTERBASE   Interbase 6 database support (Firebird)
[X] JSON        JavaScript Object Serialization support
[ ] LDAP        OpenLDAP support
[X] MBSTRING    multibyte string support
[X] MCRYPT      Encryption support
[ ] MSSQL       MS-SQL database support
[X] MYSQL       MySQL database support
[X] MYSQLI      MySQLi database support
[ ] ODBC        unixODBC support
[X] OPENSSL     OpenSSL support
[X] PCNTL       pcntl support (CLI only)
[ ] PDF         PDFlib support (implies GD)
[X] PDO         PHP Data Objects Interface (PDO)
[X] PDO_SQLITE  PDO sqlite driver
[ ] PGSQL       PostgreSQL database support
[X] POSIX       POSIX-like functions
[ ] PSPELL      pspell support
[ ] READLINE    readline support (CLI only)
[ ] RECODE      recode support
[X] SESSION     session support
[ ] SHMOP       shmop support
[X] SIMPLEXML   simplexml support
[ ] SNMP        SNMP support
[ ] SOAP        SOAP support
[X] SOCKETS     sockets support
[X] SQLITE      sqlite support
[ ] SYBASE_CT   Sybase database support
[ ] SYSVMSG     System V message support
[ ] SYSVSEM     System V semaphore support
[ ] SYSVSHM     System V shared memory support
[ ] TIDY        TIDY support
[X] TOKENIZER   tokenizer support
[ ] WDDX        WDDX support (implies XML)
[X] XML         XML support
[X] XMLREADER   XMLReader support
[X] XMLRPC      XMLRPC-EPI support
[X] XMLWRITER   XMLWriter support
[X] XSL         XSL support (Implies DOM)
[X] YAZ         YAZ support (ANSI/NISO Z39.50)
[X] ZIP         ZIP support
[ ] ZLIB        ZLIB support

== 2010.10.21 追記 ==

現時点で mysql55-server を入れたときに php5-mysqli のビルドがこける。OpenPNE はphp5_pdo-mysqli を要求するようだから、おいら方面ではmysql55-server で特に困ることは無い模様。

====

んで、この環境で

  • ps ax
  • top
  • df

という具合。

ディスクは仕方がないとしてもメモリがちょっときついかなぁと思っていたのだけれど、この状態で stable にしてみたら、CPU パワーが効いているのか2時間少しで make installworld まで終わる。

一応 df。

うちの ML115 G1 は Athlon 64 X2 4200+ にメモリ 2G で、もっと時間が掛かるでござるよ。-j2 してても。それとも、KVMってそんなにパフォーマンスが良いのかなぁ。程度の同じ実環境作って試してみたいけれど、今は余裕がないし。

とりあえず、お試し期間内は 25番ポートの外側への通信が出来ないようなので、postfix の確認が出来ていないのだけれど、これは後回しにして、Wordpress を入れて http の負荷を見てみよう。

== 2010.10.19 追記 ==

お試し期間はまだまだだけれど、正式に申し込みを行って SMTP の送信まで確認した。実際にポートが開放されるのは正式に申し込んでから少し時間が掛かるようなので、スケジュール等の都合があるなら早めに申し込んだ方か良いかも。

お試し期間を利用する馬鹿 spamer がいるから仕方がない処置ですしね。

# この辺は見習って欲しいなぁ(ぼそ)>某所さん

====



コメント

  1. […] さくらVPS上のFreeBSD環境は「FreeBSD on さくらVPS」に記載してあるとおりです。 […]

  2. […] さくらVPS上のFreeBSD環境については「FreeBSD on さくらVPS」に記載している通りです。 […]

タイトルとURLをコピーしました