6693867 [Mode]

Weblog

2006-11-09: MySQL5へバージョンアップ

毎回このてのバージョンアップは嵌まるんです。わたし!
とりあえず現在はこんな感じです。
gentooez8 ~ # emerge -pv mysql

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild U ] dev-db/mysql-5.0.26-r1 [4.1.21] USE="berkdb latin1 perl ssl -big-tables -cluster -debug -embedded -extraengine -max-idx-128% -minimal (-selinux) -srvdir -static (-raid%)" 25,380 kB

Total size of downloads: 25,380 kB

それではバージョンアップをします。
gentooez8 ~ # emerge -u mysql
終わるまで待つ。終わったらmysqlの依存関係をチェックする。
gentooez8 ~ # equery d mysql
[ Searching for packages depending on mysql... ]
net-libs/courier-authlib-0.58
net-libs/libwww-5.4.0-r7
dev-lang/php-5.1.6-r6
gnome-extra/libgda-1.2.3
dev-perl/DBD-mysql-2.9007
dev-libs/cyrus-sasl-2.1.22-r1
net-fs/samba-3.0.22-r3
net-dns/bind-9.3.2-r4
x11-libs/qt-4.1.4-r2
x11-libs/qt-3.3.6-r1
net-ftp/proftpd-1.3.0-r2
net-analyzer/snort-2.4.5
net-www/mod_auth_mysql-3.0.0
こんな感じなんだけど時間はかかるが全てコンパイルします。
あとはMySQLを再起動して終了だったのだがこんなところに落とし穴が!!


Read More!


2006-09-06: DDNSとDoCoMoメール

久しぶりのまじめな記事!そんなことあたりまえなんて方もいらっしゃるでしょうが、とりあえず書きます。


ある日突然DoCoMoあてメールがこんな感じで配送されない。

これって違和感ないね。 ※

Sep 6 22:20:56 gentooez8 sm-mta[14219]: k862sqx7013087: to=<ほげほげ@docomo.ne.jp>, ctladdr=<おれ@momoso-net.com> (1000/100), delay=02:26:03, xdelay=00:12:37, mailer=esmtp, pri=570752, relay=mfsmax.docomo.ne.jp. [203.138.180.240], dsn=4.0.0, stat=Deferred: Connection timed out with mfsmax.docomo.ne.jp.

DoCoMo側が接続してきたメールサーバのIPを逆引してドメインと一致しないと黙るみたいなのです。そうなのです!DDNSなのでIPから逆引きされると契約プロバイダが引かれドメイン名と一致しないのです。そこでこんなことをします。

gentooez8 ~ # vi /etc/mail/mailertable

docomo.ne.jp smtp:[smtp.契約プロバイダ.com] <-契約しているプロバイダのsmtpサーバをしてい。
例:
docomo.ne.jp smtp:[smtp.????.com]
.docomo.ne.jp smtp:[smtp.????.com]
ezweb.ne.jp smtp:[smtp.????.com]
.ezweb.ne.jp smtp:[smtp.????.com]
vodafone.ne.jp smtp:[smtp.????.com]
.vodafone.ne.jp smtp:[smtp.????.com]


gentooez8 ~ # cd /etc/mail
gentooez8 ~ # make mailertable.db <- hash して完成

これはDoCoMo宛メールを直接mfsmax.docomo.ne.jpに配送するのではなく、契約しているプロバイダを経由して配送する設定をするのです。それによりDoCoMo側が接続してきたサーバのIPを逆引きしてもおかしくないのでしっかりメールを配達してくれるのです。

そこでもう一度メールを送ってみる。
Sep 6 22:57:22 gentooez8 sm-mta[15270]: k865sCgu015267: to=<ほいほい@ほうほい.com>, ctladdr=<おれ@momoso-net.com> (1000/100), delay=00:03:09, xdelay=00:03:09, mailer=esmtp, pri=120716, relay=smtp.ほうほう.com. [XXX.XXX.XXX.XXX], dsn=2.0.0, stat=Sent (Ok: queued as BC46DF400C) DoCoMo宛でないので直接配送されている。
Sep 6 22:58:55 gentooez8 sm-mta[15332]: k865wrIG015328: to=<ほげほげ@docomo.ne.jp>, ctladdr=<おれ@momoso-net.com> (1000/100), delay=00:00:01, xdelay=00:00:01, mailer=smtp, pri=120752, relay=smtp.契約プロバイダ.com. [XXX.XXX.XXX.XXX], dsn=2.0.0, stat=Sent (k865wsHH021219 Message accepted for delivery) DoCoMo宛なので契約プロバイダのSMTPサーバ経由で配送されている。

感じたこと!
なんと全てのメールを契約プロバイダのSMTPサーバ経由で配送したほうがメールの到達スピードが速い・・・・!まそんなに急がなくてもいいじゃん!

※息子のが足の指を組んでるところ。器用です!!


2006-06-26: ODFファイル


OpenDocument Formatのことで文書用標準フォーマットのことです。なんとISO、IECとも国際標準といているのです。もちろん以前に紹介したOpenOffice.org 2.0もODFを標準ファイル形式としていたり、ある国ではこんなこと
ベルギー政府、内部文書でOpenDocument Formatの採用を義務付けへ CNET Japanより

パパをかきました より

なんてこともあります。今後とも注目!!です。


2006-06-13: The greatest in the world


6月12日に独立行政法人情報通信研究機構(NICT)の光・時空標準グループなるところが、時刻制度10ナノ秒以内で毎秒100万リクエスト以上に耐えられる日本標準時に直結したNTPサーバを稼働させたと!
八百万の神に より

なんとこの能力は世界最高性能なんだと。こんな世界一を使わないわけには行かないのでみんなでNTPの設定をしてPCの鼓動を一つにしよー。そしてサッカー日本を応援しよー。(設定方法文頭のリンクから)

そこで我が家のGENTOO Linuxも同じビートにするのでこんなことします。

gentooez8 ~ # vi /etc/ntp.conf

server ntp.tohoku.ac.jp
server ntp.nict.jp ←これ
driftfile /var/lib/ntp/ntp.drift
restrict default nomodify nopeer
restrict 127.0.0.1
logfile /var/log/ntp.log

もともとあった東北大のNTPサーバの下に世界一のビートを追加

gentooez8 ~ # /etc/init.d/ntpd restart
でNTPDの再起動

gentooez8 ~ # ntpq -p
   remote    refid       st t when poll reach  delay  offset  jitter
============================================================
+zao.net.tohoku. .GPS.     1 u  56  64  377  54.902  0.985  0.525
*ntp-b2.nict.go. .PPS.      1 u  57  64  377  42.462  -1.046  2.476
こんなんで動作確認!

日本がんばれー


※八百万の神に
これは大峠に向う山中にひっそりと建つ神社の石段です。なかなか神秘的です。決勝トーナメント進出「ガラガラぱんぱん!」




2006-04-08: snortで不正侵入検知

IDS(Intrusion Detection System)であるSnortのインストールを行うことにした。

それにしてもsnortって名前はやっぱり豚がクンクンとトリフを探し当てるように、ネットワーク上の怪しい何かを嗅ぎ分けるようなので付けられた名前なのでしょうか?
このセキュリティ対策も食べ物で決まったようなので食べ物対策シリーズ第3弾のはじまりです。(ちょっと強引ですが)

赤いウクレレより


パッケージの確認

gentooez8 ~ # emerge -pv snort

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild N ] dev-libs/libpcre-6.3 -doc 552 kB
[ebuild N ] net-analyzer/snort-2.4.3-r1 -flexresp -inline +mysql +odbc +postgres -prelude (-selinux) -sguil -snortsam +ssl 3,457 kB

Total size of downloads: 4,010 kB
事前にlibpcreが必要みたいですね。これは正規表現がPerlと仲良くするライブラリでしょうか?


インストール

Read More!


2006-03-03: Clamでウィルス対策(メール編)


シジミを使った料理でメールにひそむウィルスを調理。クラムチャウダとか日本人ならやっぱりしじみの味噌汁が最高!ハマグリならやはり「その手は桑名の焼きハマグリ」でしょうか!
という事でClam AntiVirusの導入です。しんぱいはClamなやつでウィルス見つけても口を割らないかも?SPAM(スパム)ポークランチョンミートに続く食べ物対策シリーズ第2弾です。

ひな祭りより

まずはパッケージの確認
gentooez8 ~ # emerge -pv clamav

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild N ] dev-libs/gmp-4.1.4-r3 -doc -nocxx 1,641 kB
[ebuild N ] app-antivirus/clamav-0.88 +crypt -mailwrapper +milter (-selinux) 4,457 kB

Total size of downloads: 6,099 kB

sendmailで使うためにUSEにmilterを追加します。それにしてもなぜGMPがついてくるのか?
GMP(GNU multiple precision arithmetic library)てなことで何桁もの円周率の計算を早くやってくれる数値計算ライブラリなのですが(それだけじゃないですけど)

Read More!


2006-02-22: ウィルス対策


Linuxもウィルス対策ということで、FRISK Software 社のF-Portをインストールすることにした。
GENTOOにはパッケージが存在するので、下記のようにインストールすると、こんなメッセージが表示されインストールは完了。注目はRememberから始まる文章で「ウイルスのデータベースを最新保つために規則的にアップデートをしなきゃだめよ。cronで動かすのがいいじゃん。そして毎日(草木も目覚める寅七つ時)にね。」そんなことが書いてあるみたい。


不思議なお酒のおくりものより

# emerge f-prot

* Remember to run /opt/f-prot/tools/check-updates.pl regularly to keep virus
* database up to date. Recommended method is to use cron. See manpages for
* cron(8) and crontab(5) for more info.
* An example crontab entry, causing check-updates.pl to run every night at 4AM:

0 4 * * * /opt/f-prot/tools/check-updates.pl >/dev/null

* For more examples, see /usr/share/doc/f-prot-4.6.3/html/auto_updt.html

* As of 4.5.4, the update script is installed correctly into directory designed
* by upstream again. Check your crontab, so the path matches the one above.

>>> Regenerating /etc/ld.so.cache...
>>> app-antivirus/f-prot-4.6.3 merged.
>>> Recording app-antivirus/f-prot in "world" favorites file...

>>> clean: No packages selected for removal.

>>> Auto-cleaning packages ...

>>> No outdated packages were found on your system.


* GNU info directory index is up-to-date.

じゃあ案内に従いcronに登録します。コマンドはこんなかんじです。

# crontab -e


そんなこんなでまずは/tmpあたりをチェックすると、ウイルスの署名ファイルが古いね!

Read More!


2006-01-16: 不正アクセス対策


今年に入りSSHをねらった不正アクセスが増えてきました。そこでファイヤーウォール(iptables)の設定とswatchによる監視と、不審者を自動で登録しアクセスを拒否する対策をしました。

桃曽根 歳の神より

まず、gentooなのでこのへんを参照しカーネルを再構築します。
swatchのバージョンはapp-admin/swatch-3.1これ!
iptablesのバージョンはnet-firewall/iptables-1.3.4これ!
カーネル再構築後は再起動し自分の環境に合わせてiptablesを設定しておく!

さて、まずこんなシェルを作っておく場所は/etc/swatch/ipselect.shに。
/var/log/auth.logのDid not receive identification string fromとかFailed password for invalid userとかのログをswatchが監視し、下記のシェルに情報をわたしたらシェルがIPアドレスを抜き出してiptablesのアクセス拒否文を発行する。


Read More!


2006-01-10: SSHアタック


最近SSHサーバへ接続を試みる不正なアクセスが増えている。
こんなかんじです。
こいつもかん・・・・・・→

sshとは

横浜のとあるデパートより

Jan 10 11:10:03 gentooez8 sshd[10121]: Address 84.244.9.189 maps to serv-3-9-189.lycos-vds.com, but this does not map back to the address - POSSIBLE BREAKIN ATTEMPT!
Jan 10 11:10:03 gentooez8 sshd[10121]: User root from 84.244.9.189 not allowed because not listed in AllowUsers
Jan 10 11:10:03 gentooez8 sshd(pam_unix)[10121]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=84.244.9.189 user=root
Jan 10 11:10:05 gentooez8 sshd[10121]: Failed password for invalid user root from 84.244.9.189 port 46878 ssh2
Jan 10 11:10:09 gentooez8 sshd[10127]: Invalid user admin from 84.244.9.189


それも今年に入ってからすごい!

上記の一部始終はこれsshattack.log(6KB)


Weblog

2010-03-20: 大人の科学

ウクレレチューニングした。科学は楽しい。相棒も喜んでた。左ききなところも!いい。






2009-03-22: Martin S-O Uke

とりあえず、新しいウクレレです。








2009-02-27: ALA MOANA UK-260P

UKULELE

携帯電話を買い換えたので、その写真をアップしました。

2009-01-19:
現在カスタム中!
ストリングをAquilaに変更。

2007-06-14:
Worth Strings のLightを付けてみた。感想は軽い!そのまんまですが、音は2〜3日もしたら落ち着くでしょうか。そしたらまた書きます。
しばらく酒のつまみに。美味しく呑めそうです。
(^_^)/□☆□\(^_^)


Weblog

2007-11-18: タイヤ交換しょう。

天気予報が【・・・雨か雪でしょう】と聴こえてきた。今日はタイヤをスタットレに交換。


2007-04-14: タイヤ交換

最近アップしていない。なんせ休日くらいしか運転しないからなー
(・・;)(;^_^A


2006-07-10: 7月の壁紙

妖精です。いや蝶々?


Weblog

2017-01-04: 試しに

試しの投稿
20170104-img_3827.jpg
変身忍者


2016-11-30: 今回のWebメールはRoundCubeで!(Ubuntu 16.04 LTS)

今回のWebメールはRoundCubeで!(Ubuntu 16.04 LTS)

これらが事前にインストールし動いていること。
・SMTPサーバー、IMAPサーバー、PHP(今回はPHP5.6)、SSLの設定、MySQLサーバー

・データベースの作成
root@ubuntuez8:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18331
Server version: 5.7.16-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database roundcube;
mysql> grant all privileges on roundcube.* to roundcube@'localhost' identified by 'password';
mysql> flush privileges;
mysql> exit

・RoundCubeのインストール
root@ubuntuez8:~# apt-get -y install roundcube roundcube-mysql roundcube-plugins roundcube-plugins-extra
Configuring roundcube-coreの設定が途中で表示されますがを選択して進めます。
root@ubuntuez8:~# cd /usr/share/dbconfig-common/data/roundcube/install
root@ubuntuez8:/usr/share/dbconfig-common/data/roundcube/install# mysql -u roundcube -D roundcube -p < mysql
root@ubuntuez8:/usr/share/dbconfig-common/data/roundcube/install# cd
root@ubuntuez8:~#

・RoundCubeの設定
root@ubuntuez8:~# vi /etc/roundcube/debian-db.php
<?php
##
## database access settings in php format
## automatically generated from /etc/dbconfig-common/roundcube.conf
## by /usr/sbin/dbconfig-generate-include
##
## by default this file is managed via ucf, so you shouldn't have to
## worry about manual changes being silently discarded. *however*,
## you'll probably also want to edit the configuration file mentioned
## above too.
##
$dbuser='roundcube';
$dbpass='password';
$basepath='';
$dbname='roundcube';
$dbserver='localhost';
$dbport='';
$dbtype='mysql';

root@ubuntuez8:~# vi /etc/roundcube/config.inc.php
省略
$config = array();
省略
$config['default_host'] = 'ssl://mail.hogehoge-net.com';
省略
$config['default_host'] = 'ssl://mail.hogehoge-net.com';
省略
$config['smtp_server'] = 'ssl://mail.hogehoge-net.com';
省略
$config['smtp_port'] = 465;
省略
$config['smtp_user'] = '%u';
省略
$config['smtp_pass'] = '%p';
省略
$config['product_name'] = 'HoGeHoGe-NET.COM. Webmail';

ここからは最後に追加
# IMAP Port specification (SSL)
$config['default_port'] = 993;

# SMTP Specify authentication type
$config['smtp_auth_type'] = 'LOGIN';

# SMTP HELO host Designation
$config['smtp_helo_host'] = 'hogehoge-net.com';

# Specify domain name
$config['mail_domain'] = 'hogehoge-net.com';

# UserAgent Specify
$config['useragent'] = 'HoGeHoGe-NET.COM. Webmail';

# SMTP IMAP Specify connection options
$config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => true,
'peer_name' => 'mail.hogehoge-net.com',
'allow_self_signed' => true,
'ciphers' => 'HIGH:!SSLv2:!SSLv3',
),
);
$config['smtp_conn_options'] = array(
'ssl' => array(
'verify_peer' => true,
'peer_name' => 'mail.hogehoge-net.com',
'allow_self_signed' => true,
'ciphers' => 'HIGH:!SSLv2:!SSLv3',
),
);

ここがpoint 'CN_match' ではなく 'peer_name' で!!

root@ubuntuez8:~# vi /etc/apache2/conf-enabled/roundcube.conf
#コメント解除
Alias /roundcube /var/lib/roundcube

php-mcryptの暗号化関数が必要。なのでインストールするが他にもいろいろ入れておく。
root@ubuntuez8:~# apt install php5.6-mcrypt php5.6-intl php5.6-zip

PHP拡張を有効化
root@ubuntuez8:~# phpenmod mcrypt

PEAR (PHP Extension and Application Repository)でPHPライブラリを確認
とりあえづ現状をアップデートしておく。
root@ubuntuez8:~# pear upgrade-all
でこんなのが必要なのでインストール
root@ubuntuez8:~# pear install Auth_SASL Net_SMTP Net_IDNA2-0.1.1 Mail_mime Mail_mimeDecode
root@ubuntuez8:~# pear list
Installed packages, channel pear.php.net:
==============
Package Version State
Archive_Tar 1.4.2 stable
Auth 1.6.4 stable
Auth_SASL 1.0.6 stable
Console_Getopt 1.4.1 stable
Crypt_CHAP 1.5.0 stable
DB 1.9.2 stable
Log 1.13.1 stable
MDB2 2.5.0b5 beta
Mail 1.3.0 stable
Mail_Mime 1.10.0 stable
Mail_mimeDecode 1.5.6 stable
Net_IDNA2 0.1.1 beta
Net_LDAP2 2.2.0 stable
Net_SMTP 1.7.2 stable
Net_Sieve 1.3.4 stable
Net_Socket 1.0.14 stable
PEAR 1.10.1 stable
PEAR_Manpages 1.10.0 stable
Structures_Graph 1.1.1 stable
XML_Util 1.3.0 stable
ここpointNet_IDNA2-0.1.1はバージョンも指定してインストール。ベータ版ですねこれ!!

pluginのjqueryuiとzipdownloadのconfigファイルを修正
root@ubuntuez8:~# cd /var/lib/roundcube/plugins/jqueryui
root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# cat config.inc.php
<?php
// Empty configuration for jqueryui
// See /usr/share/roundcube/plugins/jqueryui/config.inc.php.dist for instructions
// Check the access right of the file if you put sensitive information in it.
?>
と書いてあるので!
root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 23 2015 config.inc.php -> /etc/roundcube/plugins/jqueryui/config.inc.php
ーrw-r--r-- 1 root root 334 Nov 23 2015 config.inc.php.dist

root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# rm config.inc.php
root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# ln -s config.inc.php.dist config.inc.php

root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 30 09:25 config.inc.php -> config.inc.php.dist
ーrw-r--r-- 1 root root 334 Nov 23 2015 config.inc.php.dist

root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# cd /var/lib/roundcube/plugins/zipdownload
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# cat config.inc.php
<?php
// Empty configuration for zipdownload
// See /usr/share/roundcube/plugins/zipdownload/config.inc.php.dist for instructions
// Check the access right of the file if you put sensitive information in it.
?>
同じくと書いてあるので!
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 23 2015 config.inc.php -> /etc/roundcube/plugins/zipdownload/config.inc.php
ーrw-r--r-- 1 root root 334 Nov 23 2015 config.inc.php.dist

root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# rm config.inc.php
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# ln -s config.inc.php.dist config.inc.php

root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 30 09:47 config.inc.php -> config.inc.php.dist
ーrw-r--r-- 1 root root 399 Nov 23 2015 config.inc.php.dist

apache2をリスタートして終了
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# systemctl restart apache2.service

・これでWeb ブラウザを起動し、「https://www.hogehoge-net.com/roundcube/」でログインして使えますが、LOGをはくのでローテーションなんか設定しましょう。


2016-11-21: gentooそろそろ

gentooからubuntuにサーバを移行中。80%終了しました


« Previous Post
Next Post »
 
桃曽根っと.COM. Get Firefox Get Thunderbird