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 bydefault’. Stop.

yum update
yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd-devel
./configure 
make && make install
posted @ 2020-04-15 08:50  ZMemory  阅读(57)  评论(0编辑  收藏  举报