下載並安裝
[root@root ~]# wget http://nginx.org/download/nginx-1.9.9.tar.gz
[root@root ~]# tar -zxvf nginx-1.9.9.tar.gz
[root@root ~]# cd nginx-1.9.9
[root@root nginx-1.9.9]# ./configure --with-http_ssl_module --with-http_gzip_static_module
[root@root nginx-1.9.9]# make
[root@root nginx-1.9.9]# make install
配置
[root@root ~]# vi /usr/local/nginx/conf/nginx.conf
配置端口號、IP、項目目錄、默認文件
server {
listen 8891;
server_name localhost;
location / {
root /apply/test;
index index.html index.htm;
}
}
啓動
[root@root ~]# /usr/local/nginx/sbin/nginx
重啓
[root@root ~]# /usr/local/nginx/sbin/nginx -s reload
問題
make: *** No rule to make target
build', needed by
default’. Stop.
yum update
yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd-devel
./configure
make && make install