nginx 服务搭建
下载并安装
[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