AipoApacheLinux日記

CentOS Aipo 7から8へバージョンアップ Apache と Tomcat連動

1 Mins read

Aipoさん使わせていただいております。
ありがとうございます。

バージョンアップにともないURLも「url/aipo」から「url/」にアクセス先が変わりました。

Apacheとの連動且つSSL強制アクセスとしたいので、以下の部分を修正しました。

■Tomcat側設定「/usr/local/aipo/tomcat/conf/server.xml」
Port80はApache配下でコントロールする為にこの部分をコメントアウト
<!-- A "Connector" represents an endpoint by which requests are received
  and responses are returned. Documentation at :
  Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
  Java AJP Connector: /docs/config/ajp.html
  APR (HTTP/AJP) Connector: /docs/apr.html
  Define a non-SSL HTTP/1.1 Connector on port 8080
<Connector port="80" maxThreads="1000" protocol="org.apache.coyote.http11.Http11NioProtocol"
    connectionTimeout="20000"
    redirectPort="8443" />
-->

■Tomcat側設定「/usr/local/aipo/tomcat/conf/server.xml」
AJPを通じて443Portでアクセスさせたいので、8443から443へ変更
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />

■Apache側設定「/opt/lampp/etc/extra/hoge.conf」※apache系のconfファイルね
<IfModule ssl_module>
<VirtualHost *:443>
  #アクセスさせたいURL
  ServerName aipo.hoge.com
  ServerAdmin aipo@hoge.com
 
  #これはダミー
  DocumentRoot "/opt/lampp/htaipo"
  <Directory "/opt/lampp/htaipo">
  </Directory>
 
  #Aipo Tomcatへ連結
  <Location "/">
    ProxyPass "ajp://localhost:8009/"
  </Location>
 
  #オレオレ証明書
  #######################################################
  #  SSL Engine Switch:
  SSLEngine on
 
  #  Server Certificate:
  SSLCertificateFile /opt/lampp/etc/ssl.crt/server.crt
  SSLCertificateKeyFile /opt/lampp/etc/ssl.key/server.key
 
  #必要であればSSL Optionを記載する
  #######################################################
 
</VirtualHost>
</IfModule>

Read more
LinuxMySQL日記

mysqldumpでバックアップ mysqlで復元

1 Mins read

MySqlのバックアップと復元について

CentOS 6.9 x64
MariaDB 10.1.25(xampp linux x64 5.6.31内)

最近xampp内にあるのはMariaDBとなっていますが。。。オープンソースが分かれた感じね。これ昔のSybaseとSQLServerと同じやつだ(汗)MySqlがOracleに買収されて相変わらずオープンソースだけどライセンス系でめんどくさいから分けちゃえってやつ。そういえばUnixとLinuxもそんな感じだよね。アメリカ人(Linuxは欧米かぁ)は昔からライセンスの緩いVS固いで戦ってるけど、こちらは使ってて名前違うのに、中身はほぼ一緒なの、なんで?って疑問、若い人に教えるの大変なんだよなぁ。そういえばOpenSSLも確かオープンソース団体の脆弱性修正が遅すぎるってGoogleが別プロジェクト作っちゃったのこの前見た。。。

まえがきはさておき、xamppや複数のMySqlを1台で運用(あまりやらんが使用ポートを分ければ複数インスト可能)するときに「sock」指定(プロセス指定)が必要なのでその部分も含めてコマンド書いときます。

yum使ってMySqlを標準インストールした場合、Pathが普通に切られているから、他のネット情報のように「sock」部分はカットして使ってください。

■バックアップ(使い勝手がよいのでバイナリでアウトプット)
# ./mysqldump --default-character-set=binary --socket=/opt/lampp/var/mysql/mysql.sock -u root -p dbname > /opt/dump.sql

■復元
# ./mysql --socket=/opt/lampp/var/mysql/mysql.sock -u root -p dbname < /opt/dump.sql

Read more
Linux日記

CentOS 6.9 (64bit) に xampp linux x64 5.6.31 をインストール

3 Mins read

久しぶりに環境設定で少しハマったので書き込み

CentOS 6.9 (64bit) にxampp linux x64 5.6.31 をインストールしたら以下のエラーで起動できない。

# ./lampp start
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
 
id: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/share/xampp/xampplib: line 11: test: -ne: unary operator expected
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/httpd: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

「libc.so.6」ライブラリが無いか?環境変数のPathがおかしいんだろうと決め込んで確認コマンド投げる

yumで確認
#yum provides */libc.so.6
 
読み込んだプラグイン:fastestmirror, security
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
base/filelists_db | 6.4 MB 00:00
extras/filelists_db | 25 kB 00:00
updates/filelists_db | 2.9 MB 00:00
glibc-2.12-1.209.el6.x86_64 : The GNU libc libraries
リポジトリー : base
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6.i686 : The GNU libc libraries
リポジトリー : base
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6
 
glibc-2.12-1.209.el6_9.1.i686 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6
 
glibc-2.12-1.209.el6_9.2.i686 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6
 
glibc-2.12-1.209.el6_9.2.x86_64 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6_9.1.x86_64 : The GNU libc libraries
リポジトリー : updates
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6_9.2.x86_64 : The GNU libc libraries
リポジトリー : installed
一致 :
ファイル名 : /lib64/libc.so.6
 
glibc-2.12-1.209.el6_9.2.i686 : The GNU libc libraries
リポジトリー : installed
一致 :
ファイル名 : /lib/i686/nosegneg/libc.so.6
ファイル名 : /lib/libc.so.6

いるね~

なんじゃ?リンク切れか?。。。リンクあるし???
はて?

起動時にエラー?

起動ファイルlampp=xamppファイルなのでviでオープンし中身確認

どうやら起動時のOSバージョンチェックで読み込み先共通ライブラリが違っていることが原因見たいだけど、このエラーメッセージからはそんなこと読み取れん!Cのデバッグと同じで落ちている箇所やエラーメッセージに騙されてはいかんやつやな(笑)本質の問題を見分ける所は。。。人生と同じか(苦笑)

CentOSのバージョン確認「2.6.32」部分がキーとなっておりこれを超えているか?のチェックっぽい
#more /proc/version
Linux version 2.6.32-696.13.2.el6.x86_64 (mockbuild@c1bl.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Thu O
ct 5 21:22:16 UTC 2017

viでxamppを開き436行目の
「export LD_ASSUME_KERNEL=2.2.5」

「export LD_ASSUME_KERNEL=2.8.0」
へ変更してあげる

こんな感じ
# do we have that new red hat linux 9 with posix native threads?
if test $(osguess) = "rh9"
then
# for now disable PNTL. if PNTL gets more popular we will support it. - oswald [8apr3]
export LD_ASSUME_KERNEL=2.8.0
#echo "XAMPP: DISABLE PNTL..."
fi

これで無事起動♪
#./lampp start

Read more
日記

Exchange Server 2010 クライアントのメールボックス使用量確認コマンド

1 Mins read

Exchange Server 2010 クライアントのメールボックス使用量の確認がEMCでは出来ないのでShellコマンドにて確認する

Get-MailboxStatistics -Server 'hoge.hogehoge.local'
Get-MailboxStatistics -Database 'Mailbox Database 1234567890'
Get-MailboxStatistics -Identity 'hogehoge\user01' | select displayname, totalitemsize

Read more
ApacheLinux日記

CentOS6.4 Apache 2.4.4 SSL 本番環境コピーでエラーとなる

1 Mins read

本番環境からconf系ファイルをコピーして使用できるよう環境構築時に嵌ったので覚書!

コピーしてきてapacheが起動しない、confテストはOK

error_logに以下の記載がある

AH02311: Fatal error initialising mod_ssl,

ssl用のアクセスログを見ると。。。

AH02204: Init: Pass phrase incorrect for key of localhost.local:443
SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
SSL Library Error: error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error
SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
SSL Library Error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error (Type=RSA)
SSL Library Error: error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib
SSL Library Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag
SSL Library Error: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error (Type=PKCS8_PRIV_KEY_INFO)

「Init: Pass phrase incorrect」とはSSL用の起動時passがないと言っている。。。はて?

決められた場所にpasswordファイルがあり、「SSLPassPhraseDialog exec:」のpassが間違っているのかと確認する。。。あってる。。。はて?

1時間ほど苦悶しながら調べる。。。あっ!?コピーしたから実行権限がなくなっているんだ!そう、このファイル内だけbshellが記載してあるんだ。。。とほほ、basic認証のpasswordファイルなどは関係ないのに。。。(すでに言い訳、笑)

Read more