Instalación de nginx

  
en azure cloud Antes de instalar nginx, puede instalar libevent primero. Los pasos para instalar libevent son los siguientes: 1. Descargue libevent: wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar. Gz2. Extraiga libevent: tar -zxvpf libevent-2.0.21-stable.tar.gz3. Vaya al directorio de descompresión: cd libevent-2.0.21-stable4. Especifique el directorio de instalación: ./configure --prefix = /usr /local /libevent -2.0.215. Instale libevent: makemake install6, instale nginxyum install -y openssl * tar -xvf pcre-8.31.tar.gz -C /usr /local /tar -xvf nginx-1.4.2.tar.gzcd nginx-1.4 .2. /Configure --with-http_ssl_module --prefix = /usr /local /nginx --with-pcre = /usr /local /pcre-8.31 --with-http_stub_status_modulepS: Chief Compilation Script 1.121 /122yum -y install gcc Automake autoconf libtool make./configure --prefix = /usr /local /nginx --with-http_stub_status_module --with-http_realip_module --with-http_gzip_static_module --with-http_ssl_module --with-pcre = /usr /local /PCre 8.31makemake instalar

7, vea los parámetros de compilación:

/usr /local /nginx /sbin /nginx -V
8, use la cuenta nginx para iniciar setcap CAP_NET_BIND_SERVICE = + ep /usr /local /nginx /sbin /nginx Primero ejecute /usr /local /nginx /sbin /nginx con la cuenta raíz, luego elimine el proceso nginx y cambie a la cuenta nginx para ejecutar el servicio nginx restart o /usr /local /nginx /sbin /nginx para comenzar, verá que el proceso es Comience con 9 con la cuenta nginx, error de depuración [nginx @ lb_net_1 ~] $ service nginx startstart nginxnginx: [emerg] bind () a 0.0.0.0:80 falló (13: Permiso denegado) nginx está ejecutando [nginx @ lb_net_1 ~] $ [nginx @ lb_net_1 ~] $ exitlogout [root @ lb_net_1 conf] # [root @ lb_net_1 conf] # sudo chown root: wheel /usr /local /nginx /sbin /nginx [root @ lb_net_1 conf] # sudo chmod u + s /usr /local /nginx /sbin /nginx [root @ lb_net_1 conf] # [root @ lb_net_1 conf] # su - nginx [[root @ lb_net_1 conf] # sudo chmod u + x /usr /local /nginx /sbin /nginx Después de entrar en la cuenta nginx, se inició con éxito.zh-CN"],null,[0.98214149],zh-CN"]]]

Copyright © Conocimiento de Windows All Rights Reserved