您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

NGINX编译安装及配置

2024/6/21 18:48:41发布30次查看
一、编译安装
./configure  
--prefix=/usr  
--sbin-path=/usr/sbin/nginx  
--conf-path=/etc/nginx_1_6/nginx.conf  
--error-log-path=/var/log/nginx/error.log  
--http-log-path=/var/log/nginx/access.log  
--pid-path=/var/run/nginx/nginx.pid    
--lock-path=/var/lock/nginx.lock  
--user=nginx  
--group=nginx  
--with-http_ssl_module  
--with-http_flv_module  
--with-http_stub_status_module  
--with-http_gzip_static_module  
--http-client-body-temp-path=/var/tmp/nginx/client/  
--http-proxy-temp-path=/var/tmp/nginx/proxy/  
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/  
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi  
--http-scgi-temp-path=/var/tmp/nginx/scgi  
--with-pcre   --with-file-aio
编译过程中,会出现找不到类库的问题,先装好类库,再重复执行就好了
二、测试nginx环境
执行以下语句
$ sudo /etc/init.d/nginx configtest看到以下提示就说明已经可以具备了启动所有的环境
testing nginx configuration: nginx.
我遇到的错误是这样的
在启动nginx之前还需要添加nginx用户组,否则会提示
[emerg]: getpwnam(“nginx”) failed
添加用户组
sudo adduser --system--no-create-home--disabled-password--group nginx
三、启动nginx
启动nginx
sudo /etc/init.d/nginx start
看到以下提示说明启动成功
starting nginx: nginx.
以上就介绍了nginx编译安装及配置,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product