2012年5月に導入したさくらのVPS。先日のGT110bに続いてTrusty化。
何はともあれVPSリモートコンソールから
root@vps:~# apt-get install update-manager-coreを投入する手順でトライしてみたが、やはり先日のGT110bと同様にCPAN/Perl絡みでエラーが量産される状況で環境を引き継ぐオンラインアップデートは不可。
root@vps:~# do-release-upgrade -d
というわけで、潔く再インストールを決断してVPSコントロールパネルから「OS再インストール」をポチッとな。「Ubuntu 14.04」を選択した後はガイダンスに従ってポチポチと一時間弱。
/home配下は無事に引き継げたので/etc/ssh/sshd_configの
- Port番号を22から"ほにゃらら"に変更
- PasswordAuthenticationはnoに
- PermitRootLoginはwithout-passwordのままでOK
$ sudo service ssh restartでsshdを再起動した後、remoteからのssh作業にスイッチ。
続いてお約束の設定変更。
$ sudo /usr/sbin/groupmod -n owner yanoで、グループ名とデフォルトエディタを変更。ついでにsudoでいちいちパスワードを打たなくていいようvisudoでNOPASSWDオプションを付与しておく。
$ sudo update-alternatives --config editor
yano ALL=(ALL) NOPASSWD: ALL
続いてaptをアップデートし、ntpやbuild-essentialを導入。
$ sudo apt-get update
$ sudo apt-get install ntp build-essential
![[External]](/~yano/parts/extlink.png)
# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
# server 0.ubuntu.pool.ntp.org
# server 1.ubuntu.pool.ntp.org
# server 2.ubuntu.pool.ntp.org
# server 3.ubuntu.pool.ntp.org
server ntp1.jst.mfeed.ad.jp
server ntp2.jst.mfeed.ad.jp
server ntp3.jst.mfeed.ad.jp
sudo /etc/init.d/ntp restart今回はロケール設定は英語のままで。
まずはドメイン名が引けないと何も始まらないので、nsdを導入。
$ sudo apt-get install nsdバージョンは4になったが、/etc/nsd/nsd.confの最後にゾーン設定を追加するだけ。肝心のゾーンファイルなどはそのままでいけそうだ。
続いてapache2とphp5のinstall。
$ sudo apt-get install apache2 php5 php5-mysql php5-cli libapache2-mod-php5修正するのは/etc/apache2/mods-available/userdir.confと
*** userdir.conf.orig 2014-01-03 23:48:41.000000000 +0900/etc/apache2/mods-available/php5.conf。
--- userdir.conf 2014-06-06 23:36:52.084814230 +0900
***************
*** 3,10 ****
UserDir disabled root
<Directory /home/*/public_html>
! AllowOverride FileInfo AuthConfig Limit Indexes
! Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Require all granted
</Limit>
--- 3,11 ----
UserDir disabled root
<Directory /home/*/public_html>
! # AllowOverride FileInfo AuthConfig Limit Indexes
! # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
! AllowOverride All
<Limit GET POST OPTIONS>
Require all granted
</Limit>
*** php5.conf.orig 2014-04-10 02:25:47.000000000 +0900
--- php5.conf 2014-06-06 23:39:21.914981486 +0900
***************
*** 22,27 ****
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
! php_admin_flag engine Off
</Directory>
</IfModule>
--- 22,27 ----
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
! # php_admin_flag engine Off
</Directory>
</IfModule>
cgiは各ファイルを/usr/lib/cgi-bin/にまるっと復元し、
# cd /usr/lib/
# tar xvf ~yano/sysbackup/vps.cgi-bin.tar.bz2
# chown -Rh www-data:www-data /usr/lib/cgi-bin
続いてpostfixとdovecotとspamassassinのinstall。
$ sudo apt-get install postfix postfix-policyd-spf-perl dovecot-core dovecot-pop3d dovecot-imapd spamassassin spamassassin-rules-ja procmailまずMaildir形式の設定は/etc/dovecot/conf.d/10-mail.confで。
diff -bcr dovecot.orig/conf.d/10-mail.conf /etc/dovecot/conf.d/10-mail.confユーザ設定は既定で
*** dovecot.orig/conf.d/10-mail.conf 2014-05-15 03:11:09.000000000 +0900
--- /etc/dovecot/conf.d/10-mail.conf 2014-06-07 00:32:35.134055880 +0900
***************
*** 27,33 ****
#
# <doc/wiki/MailLocation.txt>
#
! mail_location = mbox:~/mail:INBOX=/var/mail/%u
# If you need to set multiple mailbox locations or want to change default
# namespace settings, you can do it by defining namespace sections.
--- 27,34 ----
#
# <doc/wiki/MailLocation.txt>
#
! # mail_location = mbox:~/mail:INBOX=/var/mail/%u
! mail_location = maildir:~/Maildir
# If you need to set multiple mailbox locations or want to change default
# namespace settings, you can do it by defining namespace sections.
![[External]](/~yano/parts/extlink.png)
diff -bcr dovecot.orig/conf.d/10-ssl.conf /etc/dovecot/conf.d/10-ssl.confあたりで、 SMTP認証はPostfix側が/etc/postfix/main.cfの
*** dovecot.orig/conf.d/10-ssl.conf 2014-05-15 03:11:09.000000000 +0900
--- /etc/dovecot/conf.d/10-ssl.conf 2014-06-09 13:11:59.444922703 +0900
***************
*** 9,16 ****
# dropping root privileges, so keep the key file unreadable by anyone but
# root. Included doc/mkcert.sh can be used to easily generate self-signed
# certificate, just make sure to update the domains in dovecot-openssl.cnf
! ssl_cert = </etc/dovecot/dovecot.pem
! ssl_key = </etc/dovecot/private/dovecot.pem
# If key file is password protected, give the password here. Alternatively
# give it when starting dovecot with -p parameter. Since this file is often
--- 9,18 ----
# dropping root privileges, so keep the key file unreadable by anyone but
# root. Included doc/mkcert.sh can be used to easily generate self-signed
# certificate, just make sure to update the domains in dovecot-openssl.cnf
! # ssl_cert = </etc/dovecot/dovecot.pem
! # ssl_key = </etc/dovecot/private/dovecot.pem
! ssl_cert = </etc/ssl/certs/ssl-mail.pem
! ssl_key = </etc/ssl/private/ssl-mail.key
# If key file is password protected, give the password here. Alternatively
# give it when starting dovecot with -p parameter. Since this file is often
smtpd_sasl_auth_enable = yesで、 dovecot側が/etc/dovecot/conf.d/10-master.confの
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_authenticated_header = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
diff -bcr dovecot.orig/conf.d/10-master.conf /etc/dovecot/conf.d/10-master.conf
*** dovecot.orig/conf.d/10-master.conf 2014-05-15 03:11:09.000000000 +0900
--- /etc/dovecot/conf.d/10-master.conf 2014-06-07 01:23:30.811983604 +0900
***************
*** 93,101 ****
}
# Postfix smtp-auth
! #unix_listener /var/spool/postfix/private/auth {
! # mode = 0666
! #}
# Auth process is run as this user.
#user = $default_internal_user
--- 93,101 ----
}
# Postfix smtp-auth
! unix_listener /var/spool/postfix/private/auth {
! mode = 0666
! }
# Auth process is run as this user.
#user = $default_internal_user
【参照】
●さくらインターネット http://www.sakura.ad.jp/
●VPS(仮想専用サーバ)のさくらインターネット http://vps.sakura.ad.jp/
●インターネットマルチフィード時刻情報サービス http://www.jst.mfeed.ad.jp/
┗サービス詳細