nginx 安装

useradd nginx

./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module

make && make install

cd /usr/local/nginx

vim /conf/nginx.conf


        location / {

            root   html;

            index  index.html index.htm;

   allow ip_1;

   deny all;

   auth_basic "auth-domain";

   auth_basic_user_file /usr/local/nginx/conf/authuser.txt

        }

htpasswd -c /usr/local/nginx/conf/authuser.txt admin(类似于apache)

sbin/nginx -c /conf/nginx.conf

netstat -tualnp | grep nginx


你可能感兴趣的:(nginx 安装)