風で飛んでいくチラ裏

気ままに雑記メモ書き殴り。古い記事は別blogからの引っ越しなのでレイアウトがアレです。

debian Wheezy に nginx を入れる

ハマりどころはなかったはずなんですが、情弱の私のための備忘録。

nginx のダウンロード

$ cd ~/src
$ wget http://nginx.org/download/nginx-1.7.2.tar.gz
$ tar zxvf nginx-1.7.2.tar.gz

ビルド

$ cd nginx-1.7.2
$ ./configure
...
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

PCREライブラリが無いと怒られた。

落とす。

$ cd ..
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.gz
$ tar zxvf pcre-8.33.tar.gz

リトライ。

$ cd nginx-1.7.2
$ ./configure --with_pcre=/home/XXXX/src/pcre-8.33
$ make
$ sudo make install

でけた。

後はこちらのサイト様のように /usr/local/nginx/conf/nginx.conf をいじって起動。
http://d.hatena.ne.jp/koujirou6218/20101019/1287479177

$ sudo /usr/local/nginx/sbin/nginx

サーバにHTTPでアクセスできれば成功。