$ ./configure --user=nginx --group=nginx
--with-http_ssl_module --with-http_flv_module
--with-http_gzip_static_module
--with-openssl=/home/**/Download/openssl1.0.1c
# make && make install
添加Ngnix用户组nginx: [emerg] getpwnam("nginx") failed
然后就可以用了,启动命令sudo adduser --system --no-create-home --disabled-password --group nginx
/usr/local/nginx$ ./sbin/nginx -c ./conf/nginx.conf
Welcome to nginx!
发现只有两个进程,一个主进程( master)一个子进程( worker),和prefork下的Apache完全没法比(后者启动后就有6~8个进程)ps aux | grep nginx
这大概是Ngnix占用资源低的原因吧,也是event/poll/kqueue模型相对于进程/线程模型的优势吧root 4659 0.0 0.0 4732 732 ? Ss 19:51 0:00 nginx: master process
./sbin/nginx -c /usr/local/nginx/conf/nginx.conf nginx 4660 0.0 0.0 4956 1408 ? S 19:51 0:00 nginx: worker process
完全看不懂,因为ssl.key文件夹是从Apache下拷贝过来的,凭啥Apache能用Nginx不能用呢?nginx: [emerg] SSL_CTX_use_PrivateKey_file("/usr/local/nginx/conf/ssl.key/server.key") failed (SSL: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt error:0906A065:PEM routines:PEM_do_header:bad decrypt error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib)
然后直接启动Nginx,连密码都不用输……就启动了,访问了一下https://127.0.0.1,还是那个画面呀!#cp server.key server.key.org #openssl rsa -in server.key.org -out server.key