Apache 1.3.29とmod_ssl 2.8.16をアーカイブからソースを展開して、コンパイルしてインストールする方法のメモ

Vine Evo

Apache 1.3.29+mod_ssl 2.8.16のインストール

1.0 '03/11/10
1.1 '04/04/07
コンパイルオプションを変更して、再インストール
ProEvo > Vine Evo > Apache 1.3.29+mod_ssl 2.8.16のインストール


1 Apache+mod_sslについて

1.1 Apacheとは何か?

AaacheはLinux標準のWebサーバーです。このサイトでは、apacheのインストールで詳しく説明しています。

1.2 mod_sslとは何か?

mod_sslはApacheにSSL通信機能を付加するモジュールです。Apache標準のモジュールではなく、mod_sslプロジェクトでサポートされる独自のモジュールです。
このサイトでは、mod_sslについてApache+SSLのインストールで説明しています。

2 Apache+mod_sslのインストール

2.1 Apache+mod_sslのインストール

以下の手順で、Apache 1.3.29とmod_ssl 2.8.16をインストールします。
  1. /etc/init/httpd stop
  2. tar zxvf apache_1.3.29.tar.gz
  3. tar zxvf mod_ssl-2.8.16-1.3.29.tar.gz
  4. cd mod_ssl-2.8.16-1.3.29
  5. ./configure --with-apache=../apache-1.3.29
  6. cd ../apache-1.3.29
  7. ./cf
    cf
    ./configure \
     --mandir=/usr/local/man \
     --enable-rule=EAPI --enable-rule=SSL_COMPAT \
     --enable-rule=SHARED_CORE --enable-rule=SHARED_CHAIN \
     --enable-module=so --enable-module=ssl \
     --enable-module=info --enable-module=expires --enable-module=unique_id \
     --enable-module=vhost_alias --enable-module=rewrite \
     --enable-module=log_referer \
     --enable-shared=ssl --enable-shared=info --enable-shared=status \
     --enable-shared=expires --enable-shared=unique_id \
     --enable-shared=auth --enable-shared=actions --enable-shared=cgi \
     --enable-shared=env --enable-shared=dir --enable-shared=userdir \
     --enable-shared=log_config --enable-shared=log_referer \
     --enable-shared=negotiation --enable-shared=setenvif \
     --enable-shared=include --enable-shared=unique_id \
     --enable-shared=alias --enable-shared=vhost_alias --enable-shared=rewrite
    
  8. make
  9. make install
以上でインストールは終了です。

2.2 Apacheの設定

Apacheが動くように設定ファイルを編集します。
LAN内で使うための設定です。外部に公開する場合は、セキュリティホールが出ないように設定を変更する必要があります。

/usr/local/apache/conf/httpd.conf
|
ExtendedStatus On
|
<IfDefine SSL>
Listen 443
</IfDefine>
|
ServerAdmin root@agartha
|
ServerName agartha
|
<Directory /home/*/public_html>
    AllowOverride All
    Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI
</Directory>
|
<IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.php
</IfModule>
|
HostnameLookups On
|
<IfModule mod_alias.c>
    ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
</IfModule>
|
<IfModule mod_mime.c>
    AddHandler cgi-script .cgi
</IfModule>
|
<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from localhost agartha tir-n-org
</Location>

<Location /server-info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from localhost agartha tir-n-org
</Location>
|
<IfDefine SSL>
<VirtualHost _default_:443>

ServerName agartha
ServerAdmin root@agartha

SSLCertificateFile /usr/local/apache/conf/ssl/server.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl/server.key

</VirtualHost>
</IfDefine>
以上で設定は終了です。

2.3 自動起動の設定

Linux起動時にApacheが自動的に起動するように設定します。
次の手順で起動・終了スクリプトを設定します。

  1. cd /etc/init.d/
  2. ln -s /usr/local/apache/bin/apachectl httpd
  3. cd /etc/rc.d/rc3.d
  4. ln -s ../init.d/httpd S84httpd
  5. cd ../rc5.d
  6. ln -s ../init.d/httpd S84httpd
以上で設定は終了です。

2.4 Apacheを起動する

上記までの設定が終了すればApacheは起動できます。
以下の手順でApacheを起動します。

  1. /etc/init.d/httpd start
これで、/etc/init.d/httpd start: httpd startedとメッセージが出れば 正常に起動してます。

http://agartha/server-info にアクセスして、Apacheの情報を見ることはできれば Apacheは正常に動いています。

3. SSLを設定する

3.1 証明書を作成する

自前で証明書を作成するを参考にして、証明書を作成します。
作成方法の詳細は、自前で証明書を作成するを見てください。
これで、/usr/local/apache/conf/ssl/下に
server.csr
server.crt
の2つのファイルができていればOkです。

3.2 ssl付きでApacheを起動する

次の手順でApacheを再起動します。これでssl付きでApacheを起動します。

  1. /etc/init.d/httpd stop
  2. /etc/init.d/httpd startssl
これでSSL付きで接続できます。https://agartha/にアクセスして、ページが表示されれば成功です。

(webmaster@aglabo.com)

$Revision: 2 $
Last update: $Date: 2007-02-28 23:35:40 +0900 (豌エ, 28 2譛 2007) $