mod_XXXを作る際にベースは簡単に作成できるように、mod_helloworldの作り方まとめ。(Ubuntuの場合)
apx2で、モジュールの雛形を作る。Ubuntuの場合、apache2-threaded-devパッケージに入っていた。
apt-get install apache2-threaded-dev
apxs2 -g -n helloworld
これで、helloworldディレクトリに、以下のファイルができる。
cd helloworld/
ls
./modules.mk
./.deps
./mod_helloworld.c
./Makefile
Makefileを見て、make installするだけでOKかと思いきや、下記のエラー。
/build/instdso.sh: No such file or directory
というエラー。Makefileを確認し、/usr/share/apache2/build/special.mkファイルの、instdso.shファイルのパスが、
$(top_srcdir)/build/instdso.sh SH_LIBTOOL='$(SH_LIBTOOL)' $$i $(DESTDIR)$(libexecdir); \
となっていたので、Makefile中のtop_srcdirを設定するとOK。
top_srcdir=/usr/share/apache2
sudo make install
make[1]: ディレクトリ `/home/tnoborio/src/helloworld' に入ります
/usr/share/apr-1.0/build/libtool --silent --mode=install cp mod_helloworld.la /usr/lib/apache2/modules/
make[1]: ディレクトリ `/home/tnoborio/src/helloworld' から出ます
/usr/share/apr-1.0/build/libtool --silent --mode=install cp mod_helloworld.la /usr/lib/apache2/modules/
apx2で、モジュールの雛形を作る。Ubuntuの場合、apache2-threaded-devパッケージに入っていた。
apt-get install apache2-threaded-dev
apxs2 -g -n helloworld
これで、helloworldディレクトリに、以下のファイルができる。
cd helloworld/
ls
./modules.mk
./.deps
./mod_helloworld.c
./Makefile
Makefileを見て、make installするだけでOKかと思いきや、下記のエラー。
/build/instdso.sh: No such file or directory
というエラー。Makefileを確認し、/usr/share/apache2/build/special.mkファイルの、instdso.shファイルのパスが、
$(top_srcdir)/build/instdso.sh SH_LIBTOOL='$(SH_LIBTOOL)' $$i $(DESTDIR)$(libexecdir); \
となっていたので、Makefile中のtop_srcdirを設定するとOK。
top_srcdir=/usr/share/apache2
sudo make install
make[1]: ディレクトリ `/home/tnoborio/src/helloworld' に入ります
/usr/share/apr-1.0/build/libtool --silent --mode=install cp mod_helloworld.la /usr/lib/apache2/modules/
make[1]: ディレクトリ `/home/tnoborio/src/helloworld' から出ます
/usr/share/apr-1.0/build/libtool --silent --mode=install cp mod_helloworld.la /usr/lib/apache2/modules/
コメント