mysqldump -u root -p -q HISTORY > HISTORY.backup
mysqlのバックアップを取る。
あとはもう必要なものはないはず。
あるかもしれないけど、1年くらい、放置してあるから、もういいか。
解約しよう。
shutdown -h now
月曜日に手続きする。
このブログを検索
2015/05/16
2015/05/10
InsecurePlatformWarning
python blocking.py
/usr/lib/python2.6/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
warningなので、動くことは動く。
pythonのバージョンを変えれば出なくなるという情報を見つけたが、
それもどうかな。
yum install python
とやると、2.6.6 が入る。
動くから別にいいか、と思ったが、長いのでやっぱりウザい。
1台目ではでなかったのに、とバージョンを見ると 2.7.3 になっている。
いれなおした覚えはあるようなないような・・・
2.7.x をいれてしまえばよさそうだが、
それにともなってアレもアレするとかいう情報が出てくるので、
とりあえず見送り。
/usr/lib/python2.6/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
warningなので、動くことは動く。
pythonのバージョンを変えれば出なくなるという情報を見つけたが、
それもどうかな。
yum install python
とやると、2.6.6 が入る。
動くから別にいいか、と思ったが、長いのでやっぱりウザい。
1台目ではでなかったのに、とバージョンを見ると 2.7.3 になっている。
いれなおした覚えはあるようなないような・・・
2.7.x をいれてしまえばよさそうだが、
それにともなってアレもアレするとかいう情報が出てくるので、
とりあえず見送り。
2015/05/09
postfix 再設定
/etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = **************
mydomain = **************
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
mynetworks_style = host
mynetworks = 127.0.0.0/8
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
smtpd_banner = $myhostname ESMTP hoge
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
smtpd_sasl_type = cyrus
smtpd_sasl_path = smtpd
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
broken_sasl_auth_clients = yes
saslauthd を起動すること。
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = **************
mydomain = **************
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
mynetworks_style = host
mynetworks = 127.0.0.0/8
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
smtpd_banner = $myhostname ESMTP hoge
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
smtpd_sasl_type = cyrus
smtpd_sasl_path = smtpd
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
broken_sasl_auth_clients = yes
saslauthd を起動すること。
cgi移行
ファイルを移す。
htmlファイルを /var/www/htmlに
cgiを /var/www/cgi-bin に
cssも移す。
cgiを動かすとinternal server errorになる。
/var/log/httpd/error_log を見ると、CGI.pm がない、とある。
cpan
YAMLがないといわれる。
install YAML
install CGI
エラーが出てインストールできない。
cpanからダウンロードしてインストールする。
wget http://www.cpan.org/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/CGI/CGI-4.15.tar.gz
tar zxvf CGI-4.15.tar.gz
cd CGI-4.15
perl Makefile.PL
make
make install
こんどはXML/RSS.pm がない。
もうRSSなんか使わないので、前回はRSSを使っているところをコメントにしたのだが、
ついでなのでインストールする。
と思ったがまたエラーが出る。
DateTime が必要?
cpanで
install DateTime
とやってもそんなのない、といわれる。
cpanm というのがあるのを知る。
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
とかなんとかやってなんとか入る・・・
次は MeCab.pm
これも前回はコメントアウトしたのだが、今回はがんばる。
http://taku910.github.io/mecab/#download
本体、辞書、perlバインディングの3つをいれる。
こんどは、GD/Graph/pie.pm
yum install perl-GD
cpan>install GD::Graph::pie
次はpythonのmecabバインディング
buildでエラー。
MeCab_wrap.cxx:149:20: error: Python.h: No such file or directory
yum install python-devel
/etc/ld.so.confに1行追加(libmecab.soのある場所)
/usr/local/lib
ldconfig
htmlファイルを /var/www/htmlに
cgiを /var/www/cgi-bin に
cssも移す。
cgiを動かすとinternal server errorになる。
/var/log/httpd/error_log を見ると、CGI.pm がない、とある。
cpan
YAMLがないといわれる。
install YAML
install CGI
エラーが出てインストールできない。
cpanからダウンロードしてインストールする。
wget http://www.cpan.org/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/CGI/CGI-4.15.tar.gz
tar zxvf CGI-4.15.tar.gz
cd CGI-4.15
perl Makefile.PL
make
make install
こんどはXML/RSS.pm がない。
もうRSSなんか使わないので、前回はRSSを使っているところをコメントにしたのだが、
ついでなのでインストールする。
と思ったがまたエラーが出る。
DateTime が必要?
cpanで
install DateTime
とやってもそんなのない、といわれる。
cpanm というのがあるのを知る。
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
cpanm DateTime
cpanm XML::RSS
次は twitter
install Net::Twitter::Lite
install Net::Twitter
よくみると違う
install Net::Twitter::Lite::WithAPIv1_1
Crypt::SSLeay
がないと言われる。
そしてどうしてもinstall できない。
ググる。
yum install opessl-devel
をやればいけるという情報を見つける。
釈然としないが、なんか以前にもやったような気がする・・・
やって、もう一度 Crypt::SSLeay をいれる・・・
ダメ・・・
cpan>force install Scalar::Util
cpan>install IO::Socket::SSL
cpan>force install LWP::Protocol::https
がないと言われる。
そしてどうしてもinstall できない。
ググる。
yum install opessl-devel
をやればいけるという情報を見つける。
釈然としないが、なんか以前にもやったような気がする・・・
やって、もう一度 Crypt::SSLeay をいれる・・・
ダメ・・・
cpan>force install Scalar::Util
cpan>install IO::Socket::SSL
cpan>force install LWP::Protocol::https
次は MeCab.pm
これも前回はコメントアウトしたのだが、今回はがんばる。
http://taku910.github.io/mecab/#download
本体、辞書、perlバインディングの3つをいれる。
こんどは、GD/Graph/pie.pm
yum install perl-GD
cpan>install GD::Graph::pie
次はpythonのmecabバインディング
buildでエラー。
MeCab_wrap.cxx:149:20: error: Python.h: No such file or directory
yum install python-devel
/etc/ld.so.confに1行追加(libmecab.soのある場所)
/usr/local/lib
ldconfig
2015/05/06
centosを再インストールするとすると
必要なことは
postfix + dovecot の設定
perlのモジュールのインストール
cpan
YAML::Tiny
Net::Twitter::Lite
pythonのモジュールのインストール
pip
tweepy
crontabのインストールと設定
apacheのインストール
postfix + dovecot の設定
perlのモジュールのインストール
cpan
YAML::Tiny
Net::Twitter::Lite
pythonのモジュールのインストール
pip
tweepy
crontabのインストールと設定
apacheのインストール
locale問題
localeのエラーが出ている。
英語で使っていればいいのだが、
cgiに日本語でコメントが書いてある。
それは我慢していたのだが、
twitterのbotを移植しようとしたら、同じエラーが出て、
これはなんとかせねばならない。
その前に、perlのモジュールが動かない。
インストールしようとしたらCPAN.pmがない。
yum install perl-CPAN
perl -MCPAN -e shell
をやって
install YAML::Tiny
をやる。
スクリプト内のフォルダ名を直したり、ファイルのパーミッションを直したら動いた。
localeのエラーは出たままだが、とりあえず無視。
botを動かすためにcrontabの設定をしようと思い
vi /etc/crontab
をやろうとしたら、ファイルがない。
インストールされてなかった。
yum install crontabs
botの移行は一応できたが、
tweetするネタは日本語で書いてあるため、これを編集するには
やっぱりlocale問題を解決せねばならない・・・。
もちろんさんざんググって、書いてあることを片っ端から試しているが治らない。
locale問題に関しては、「接続する側の設定との不一致」ということで、
クライアント側の設定を変えて解決するということがよくあるようだが、
私の場合は、メッセージにあるように、
# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=ja_JP.UTF-8
LC_CTYPE=ja_JP.utf8
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
本当に、必要なファイルまたはフォルダが存在しないと思えてならない。
glibcをアップデートしたのがきっかけだと思い、
戻してみたがダメ。
OS再インストールするかな・・・
やったことは全部メモってあるし、試行錯誤したけどたいした量じゃないから・・・。
英語で使っていればいいのだが、
cgiに日本語でコメントが書いてある。
それは我慢していたのだが、
twitterのbotを移植しようとしたら、同じエラーが出て、
これはなんとかせねばならない。
その前に、perlのモジュールが動かない。
インストールしようとしたらCPAN.pmがない。
yum install perl-CPAN
perl -MCPAN -e shell
をやって
install YAML::Tiny
をやる。
スクリプト内のフォルダ名を直したり、ファイルのパーミッションを直したら動いた。
localeのエラーは出たままだが、とりあえず無視。
botを動かすためにcrontabの設定をしようと思い
vi /etc/crontab
をやろうとしたら、ファイルがない。
インストールされてなかった。
yum install crontabs
botの移行は一応できたが、
tweetするネタは日本語で書いてあるため、これを編集するには
やっぱりlocale問題を解決せねばならない・・・。
もちろんさんざんググって、書いてあることを片っ端から試しているが治らない。
locale問題に関しては、「接続する側の設定との不一致」ということで、
クライアント側の設定を変えて解決するということがよくあるようだが、
私の場合は、メッセージにあるように、
# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=ja_JP.UTF-8
LC_CTYPE=ja_JP.utf8
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
本当に、必要なファイルまたはフォルダが存在しないと思えてならない。
glibcをアップデートしたのがきっかけだと思い、
戻してみたがダメ。
OS再インストールするかな・・・
やったことは全部メモってあるし、試行錯誤したけどたいした量じゃないから・・・。
tweepy インストール
yum install python-pip
pip install tweepy
エラーが出る。
# pip install tweepy
Downloading/unpacking tweepy
Downloading tweepy-3.3.0.tar.gz
Running setup.py egg_info for package tweepy
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/tweepy
Storing complete log in /root/.pip/pip.log
ググる。
pip install --upgrade pip
pip install tweepy
pip install tweepy
エラーが出る。
# pip install tweepy
Downloading/unpacking tweepy
Downloading tweepy-3.3.0.tar.gz
Running setup.py egg_info for package tweepy
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/tweepy/setup.py", line 17, in <module>
install_reqs = parse_requirements('requirements.txt', session=uuid.uuid1())
TypeError: parse_requirements() got an unexpected keyword argument 'session'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/tweepy
Storing complete log in /root/.pip/pip.log
ググる。
pip install --upgrade pip
pip install tweepy