1
1

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 3 years have passed since last update.

Apache2.4.41をソースからインストールする

Last updated at Posted at 2020-02-12

専門学校の卒業制作で初めてApacheを扱ったので備忘録的なアレを書いておく
Ubuntuですら触ったのは初めてなので多々抜けている点もあるかと思われ

#OS
Ubuntu18.04LTS

#参考記事
https://www7390uo.sakura.ne.jp/wordpress/archives/467
https://bty.sakura.ne.jp/wp/archives/149
https://www.skyarch.net/blog/?p=9543

#必要なもの
1.GCC(Cコンパイラ)
2.pcre-8.39
3.apr-1.7.0
4.apr-util-1.6.1
5.httpd-2.4.41

#GCCのインストール
サクっとaptコマンドで
$ apt-get install build-essential
#コンパイルとインストール
上記のものを/usr/local/srcにダウンロードして解凍

ダウンロードの際は
$ wget (URL)

解凍は
$ tar zxvf (ファイル名)

解凍後、各ディレクトリに入って

$ ./configure
$ make || make install```

と実行していきます。

#注意点その1
expat.hというライブラリが足りないといわれたので
[ここ](https://github.com/libexpat/libexpat/releases/download/R_2_2_7/expat-2.2.7.tar.gz)
からダウンロードします。こいつをインストールすればいけるはず。
#注意点その2
apr-utilの./configureを実行する際にオプションで

```$ ./configure --with-apr=/usr/local/apr```

とつけてやる
#注意点その3
httpd-2.4.41の./configureもオプションで

```$./configure --with-pcre=/usr/local/src/pcre-8.39/pcre-config --with-apr=/usr/local/src/apr-1.7.0 --with-apr-util=/usr/local/src/apr-util-1.6.1```

とつけてやる
#注意点その4
インストール後、いざ起動しようとするとライブラリのパスを通せというメッセージが出てきたため、

```$ export LD_LIBRARY_PATH="/usr/local/lib"```

これで実行できるようになる。
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?