ダウンロード

http://httpd.apache.org/download.cgi でUnix Sourceのダウンロード後、FTPで転送。

最初configureが成功せず、webで調べたところgccのPATHもれが判った。
http://oshiete1.goo.ne.jp/qa1974980.html

インストール作業

# pwd
/export/home
# ls
myname      lost+found  work   ←このmynameの中にFTPしたファイルあり
# mv /export/home/myname/work/*gz ./work/
# ls
myname      lost+found  work
# cd w*
# ls
httpd-2.2.11.tar.gz
# ls -l
合計 13312
-rw-r--r--   1 myname   guests   6806786  1月 30日  13:52 httpd-2.2.11.tar.gz
#
# gzip -dc httpd-2.2.11.tar.gz | tar xf -
# ls -l
合計 13314
drwxr-xr-x  11 500      100         1024 12月  7日  00:17 httpd-2.2.11
-rw-r--r--   1 myname   guests   6806786  1月 30日  13:52 httpd-2.2.11.tar.gz
# cd ../
# ls
myname       lost+found  work
# mv work/httpd-2.2.11 ./httpd-2.2.11
# ls -l
合計 22
drwxr-xr-x   3 myname   guests       512  1月 30日  13:51 myname
drwxr-xr-x  11 500      100         1024  1月 30日  13:58 httpd-2.2.11
drwx------   2 root     root        8192  1月 29日  19:19 lost+found
drwxr-xr-x   2 root     root         512  1月 30日  13:58 work
# cd  httpd-2.2.11
# ls
ABOUT_APACHE      InstallBin.dsp    NWGNUmakefile     apachenw.mcp.zip  docs              modules
Apache.dsw        LAYOUT            README            build             emacs-style       os
BuildAll.dsp      LICENSE           README.platforms  buildconf         httpd.dsp         server
BuildBin.dsp      Makefile.in       ROADMAP           config.layout     httpd.spec        srclib
CHANGES           Makefile.win      VERSIONING        configure         include           support
INSTALL           NOTICE            acinclude.m4      configure.in      libhttpd.dsp      test
# ./configure --enable-so --enable-ssl
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking target system type... i386-pc-solaris2.10

Configuring Apache Portable Runtime library ...

checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking target system type... i386-pc-solaris2.10
・・・
・・・
checking whether to enable mod_ssl... checking dependencies
checking for SSL/TLS toolkit base... none
checking for OpenSSL version... checking openssl/opensslv.h usability... no
checking openssl/opensslv.h presence... no
checking for openssl/opensslv.h... no
checking openssl/ssl.h usability... no
checking openssl/ssl.h presence... no
checking for openssl/ssl.h... no
no OpenSSL headers found
checking for SSL-C version... checking sslc.h usability... no
checking sslc.h presence... no
checking for sslc.h... no
no SSL-C headers found
configure: error: ...No recognized SSL/TLS toolkit detected

どうやらSSLの設定が悪い?のでconfigureが失敗する。
http://solaris-user.com/apache/apache-ssl.html のサイトを参考に、opensslをインストール

色々あがいたが、結局Apacheは2.0.52がそらてんに標準で同梱されていたので
ひとまずそれで稼働確認してみることに。。(インストール参照)

しかしあくまで新規インストールに挑戦すべしとのことで、
再度インストール作業に取りかかる。
1.先ほど途中まで実行したapacheのソース類を全て削除する
2.ダウンロードしたアーカイブを下記パスに解凍する
/usr/local/httpd-2.2.11.tar
3.tarを展開し、中のソース類を下記パスに保管する
/usr/local/src
4.ユーティリティaprとapr-utilをインストールする
 http://www.apache.jp/manual/install.html
 apr/apr-util >= 1.2 の項を参照
# Build and install apr 1.2
cd srclib/apr
./configure --prefix=/usr/local/apr-httpd/
make
make install

# Build and install apr-util 1.2
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install

# Configure httpd
cd ../../
./configure --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ 

上記1~4の順番通りに実行すれば、問題なくインストールできる。
私が経験したインストールのエラーについて以下現象と原因を記録する。
●ソースの展開後、一度apacheのconfigureを実行
# ./configure --prefix=/usr/local/apache2.2.11
 prefixをかようなパスにしているのは、思いつきとしか言いようがない。
makeしたら次のエラーが発生
ld: fatal: Symbol referencing errors. No output written to .libs/htpasswd
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `htpasswd'
Current working directory /usr/local/src/support
*** Error code 1
・・・
make: Fatal error: Command failed for target `all-recursive'
●エラーが発生したので4.にならいユーティリティをインストールした。
 しかしapr-utilのmake installで下記エラーが発生し、先に進めない。
libtool: install: error: cannot install `libaprutil-1.la' to a directory not ending in /usr/local/apache2.2.11/lib
*** Error code 1
make: Fatal error: Command failed for target `install'
●K先生に泣きついたら、インストールのやり直し(1.~4.の手順)であっさり成功。
原因は最初のapacheのconfigureで指定したパスが、makeで設定されたままcleanされずツールのインストールをしたためのようだ。
make clean実行後にユーティリティのインストールをやり直すことでも成功した。
→makeは実行ディレクトリが変わったからって油断できないっってことを学習しますた。

設定

文字化け対応

試験用index.htmlをEUCコードで作成し表示する。
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=EUC-JP">
</head>
<body>
あさのさんのてすと用
</body>
</html>
これを
  • テキストモード無変換で/var/apache2/htdocs/asano/index.htmlへFTP転送
  • URL指定(http://10.253.101.178/asano/)してブラウザ表示
文字化けが起こってしまった。
【対応】
これは/etc/apache2/httpd.confの「AddDefaultCharset ISO-8859-1」をコメントで消し
apacheを再起動したことで解消した。
  • 参考リンク


最終更新:2009年02月16日 10:55