LoginSignup
12
11

More than 5 years have passed since last update.

Nginxインストールメモ

Posted at

コンパイルに必要なものをインストール

Debian or Ubuntu

sudo apt-get -y install build-essential libc6 libpcre3 libpcre3-dev libpcrecpp0 libssl0.9.8 libssl-dev zlib1g zlib1g-dev lsb-base

CentOS

sudo yum groupinstall "Development Tools"
sudo yum install -y openssl-devel pcre-devel zlib-devel

必要なディレクトリ作成

sudo mkdir -p /var/log/nginx
sudo chown -R <user>:<group> /var/log/nginx

コンパイル

export CFLAGS="-O3 -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g"
./configure --prefix=/usr/local/nginx-1.4.4 \
--error-log-path=/var/log/nginx/error.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/log/nginx/body \
--http-proxy-temp-path=/var/log/nginx/proxy \
--http-fastcgi-temp-path=/var/log/nginx/fastcgi \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module \
--without-http_userid_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module
make
sudo make install

symlink張る

簡単にバージョンアップできるように、symlinkを張っておく

sudo ln -s /usr/local/nginx-1.4.4 /usr/local/nginx
12
11
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
12
11