LoginSignup
0
1

More than 5 years have passed since last update.

Apacheのインストール

Posted at

ソースコードからApacheをインストールしてみました。
※2018.05にインストールした際の手順です

Apache:http://httpd.apache.org/ 《Ver.2.4.33》
APR:http://apr.apache.org/download.cgi 《Ver.1.6.3》
APR-util:http://apr.apache.org/download.cgi 《Ver.1.6.1》

Apacheのダウンロード

$ wget http://ftp.jaist.ac.jp/pub/apache//httpd/httpd-2.4.33.tar.gz

Apacheの解凍

ダウンロードしたファイルを解凍して、解凍後、作成されたディレクトリに入る

$ tar -xvzf httpd-2.4.33.tar.gz
$ cd httpd-2.4.33

APR・APR-utilのダウンロード・解凍

Apacheと同様の手順

# APR
$ wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-1.6.3.tar.gz
$ tar -xvzf apr-1.6.3.tar.gz

# APR-util
$ wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-util-1.6.1.tar.gz
$ tar -xvzf apr-util-1.6.1.tar.gz

APRとAPR-utilを/srclib/の中に移動

Apacheをmakeする際に一緒に自動でコンパイルされるため、/srclib/配下に解凍したものを置くだけでOK!

$ mv apr-1.6.3 /home/erina/httpd-2.4.33/srclib/apr
$ mv apr-util-1.6.1 /home/erina/httpd-2.4.33/srclib/apr-util

コンフィグ,コンパイル,インストール

マシンの環境にあわせたMakefileを生成した後、コンパイルを行い、実行ファイルを作成

$ ./configure --with-included-apr
$ make
$ make install

libiconvが邪魔してmakeがエラーの場合は以下を実行後コンフィグ

$ rm /usr/local/include/iconv.h
$ make distclean
$ ./configure --with-included-apr
$ make
$ make install

Apacheの起動・停止・再起動

Apacheのある階層で実行する

起動

$ /usr/local/apache2/bin/apachectl -f /usr/local/apache2/conf/httpd.conf
# http://xx.xx.xx.xx(IPアドレス)/ で「It Works!」の画面が表示されたらOK!

停止

$ /usr/local/apache2/bin/apachectl stop

再起動

$ /usr/local/apache2/bin/apachectl restart
0
1
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
0
1