5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Apacheのmoduleをソースビルドする場合に気をつけること

Posted at

これはなに?

(めったにないけど) Apacheのmoduleをソースビルドする際に気をつけること。

たまたま担当したサービスに自社製Apache moduleがあったので備忘録を兼ねてます。

まずはビルド方法

/Path/to/apache/bin/apxsを使うのがお手軽い

/Path/to/apache/bin/apxs -ci mod_xxx.c

or

/Path/to/apache/bin/apxs -c mod_xxx.c
/Path/to/apache/bin/apxs -i mod_xxx.la

気をつけること

1. Apacheプロセス起動中に apxs -i mod_xxx.la しない

すでにLoad済みのモジュールの更新をする場合、Apacheプロセス稼働中にapxs -iしちゃうと
Segmentation faultをくらっちゃいます。

/Path/to/apache/logs/error_log
[Mon Jul 27 12:42:43 2015] [notice] child pid 6926 exit signal Segmentation fault (11)

いちおう回避策もあります。

/Path/to/apache/build/instdso.sh を以下のように編集してから、apxs -iしてやると
稼働中のApacheでもSegmentation faultしないはず。
※更新が反映されるのは、Apache restart後。

/Path/to/apache/build/instdso.sh
< CMD="$SH_LIBTOOL --mode=install cp $DSOARCHIVE $TARGETDIR/"
---
> CMD="$SH_LIBTOOL --mode=install install $DSOARCHIVE $TARGETDIR/"

詳細はこちらをご確認ください。
参考: http://dsas.blog.klab.org/archives/50972695.html

2... は特に無かった。 apxs -c時に出たWarningなどはきっちり潰さないと Segmentation faultくらいますよ。くらい。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?