Skip to content

Instantly share code, notes, and snippets.

@eiichi-worker
Created May 19, 2017 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiichi-worker/60aea82e2b89a5e3dd7b403601899419 to your computer and use it in GitHub Desktop.
Save eiichi-worker/60aea82e2b89a5e3dd7b403601899419 to your computer and use it in GitHub Desktop.
glibcについて勉強(httpdをコンパイル)

#glibc #make → golangとかで最近最注目

glibc 元々libc (unix書くためにC言語) ↓ GNU glibc(GPL)

linuxの最小構成

  • kernel
  • glibc (カーネルのコンパイル)

Linux Unix(商用)高い!! ↓ Linux(copy版的な。無償)

本日 httpdをコンパイル

docker run -it --name debian debian /bin/bash
apt-get update
apt-get install build-essential

aot-get install wget

ソースコード持ってくる
https://httpd.apache.org/download.cgi#apache24

cd /tmp
wget http://ftp.jaist.ac.jp/pub/apache//httpd/httpd-2.4.25.tar.bz2
tar jxf httpd-2.4.25.tar.bz2

wget http://ftp.meisei-u.ac.jp/mirror/apache/dist//apr/apr-1.5.2.tar.bz2
tar jxf apr-1.5.2.tar.bz2

cd httpd-2.4.25

コンパイルする

一部面倒なので今回はapt-get apt install libaprutil1 libaprutil1-dev apt install libpcre3-dev

# apr
cd /tmp/apr-1.5.2
./configure     # Makefileを作る
make            # コンパイル
make install    # インストール

# httpd
./configure
make
make install

make は /usr/localがデフォ
指定の場合は、configureのときにoptionで指定

configure --help

/usr/local/apache2/bin/apachectl start

/usr/local/apache2/bin/httpd -DFOREGROUND

Ctr + z # 一時停止 bg # バックグラウンドに送る fg 1 # フォアグラウンドに戻す

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment