2014年8月2日土曜日

mysql自動起動(再)

osをmarvericksに、server.appをver 3.xにしたらいろいろ動かなくなった。

mysqlでエラーがでる。passengerが動かない。
mysql.sockがない模様。どうしたらいいのか忘れている。

140802 11:13:45  mysqld started
140802 11:13:45 [Warning] Can't create test file /var/mysql/xxxxxx.lower-test
140802 11:13:45 [Warning] Can't create test file /var/mysql/xxxxxx.lower-test
InnoDB: The InnoDB memory heap has been disabled.
InnoDB: Mutex and rw_lock use GCC atomic builtins.
140802 11:13:45  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

140802 11:13:45  mysqld ended

権限がないのかなと思っていろいろやったけど

140802 11:48:03  mysqld started
140802 11:48:03 [Warning] Setting lower_case_table_names=2 because file system for /var/mysql/ is case insensitive
InnoDB: The InnoDB memory heap has been disabled.
InnoDB: Mutex and rw_lock use GCC atomic builtins.
140802 11:48:03  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
140802 11:48:03  mysqld ended

さしてかわらない。rootでmysq_safeでmysql.sockができるが、別のアカウントだとエラーになる。

diff: /etc/my.cnf: Permission denied
cat: /var/mysql/xxxxxx.jp.pid: Permission denied
Starting mysqld daemon with databases from /var/mysql
STOPPING server from pid file /var/mysql/xxxxxxx.jp.pid
140802 12:48:37  mysqld ended

mysqlを実行すると、エラーになる。mysqlが起動していないからか。ふと、起動時に何か立ち上げてたなと思い出すが、LaunchDaemon、LaunchAgentを見てもない、Sysytemにも、Libraryにも。。。marvericksにしたときに消えたかな。

記述方法を忘れたので再度記載。これで動いた。



<?xml version="1.0" encoding="UTF-8"?>
<lt!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>KeepAlive</key>
        <true/>
        <key>RunAtLoad</key>
        <true/>
        <key>Label</key>
        <string>org.mysql</string>
        <key>OnDemand</key>
        <false/>
        <key>Program</key>
        <string>/usr/bin/mysqld_safe</string>
        <key>UserName</key>
        <string>_mysql</string>
</dict>
</plist>

launchctl


起動時などに何かしたいときは/Library/LaunchDaemonにplistを作っておく。

launchctl load -w xxxx.plist

でOK。

launchctl: no plist was returned for: xxxx.plist
nothing found to load

などのエラーのときは記述ミスなどが疑われるので、

plutil -lint xxxx.plist

でエラーチェックできる

2014年8月1日金曜日

passengerでエラー

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

my.confとかさわっていない、mysql.sockが見当たらないので、mysqld_safeで起動して、mysql.sockを生成。これで動きました。前もやったけど、ここに書いてなかったのかな、みあたらない

/var/mysql〜

2014年7月27日日曜日

AuthType

Server.appでldapを利用するには
AuthTypeをDigestからBasicにするだけみたい。


http://support.apple.com/kb/HT4777?viewlocale=ja_JP

2014年7月21日月曜日

mod_dav_svn関連のエラー

エラー

XSWebConfig:ERROR:
httpd: Syntax error on line 149 of /Library/Server/Web/Config/apache2/httpd_server_app.conf: Cannot load /usr/libexec/apache2/mod_dav_svn.so into server: dlopen(/usr/libexec/apache2/mod_dav_svn.so, 10): Library not loaded: /usr/lib/libsvn_repos-1.0.dylib\\n  Referenced from: /usr/libexec/apache2/mod_dav_svn.so\\n  Reason: image not found

とりあえず街頭ファイルのシンボリックリンクを作成するか、コピーで

/Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs-1.0.dylib
/Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_fs-1.0.dylib
/Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_util-1.0.dylib
/Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_delta-1.0.dylib
/Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_subr-1.0.dylib
/Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_repos-1.0.dylib

パーミッションの@の消し方

xattr -d com.apple.FinderInfo ファイル名
xattr -d com.apple.metadata:kMDItemWhereFroms ファイル名
xattr -d com.apple.quarantine ファイル名

2014年6月27日金曜日

外からアクセスできない

LAN外からwebにアクセスしようとしてもつながらない。

DNSレコードのサービスの設定が間違っていたよだ。

○ インターネット > IPv4アドレス
× インターネット > ルーターアドレス