Linux下搭建Nginx环境
上面变通操作完毕,接下来开始编译安装. [root@oracle132 nginx-0.6.31]# ./configure --with-pcre=/usr/include/pcre --with-http_stub_status_module [root@oracle132 nginx-0.6.31]# vi ./objs/Makefile(注:删除此文件1006行“./configure --disable-shared”) [root@oracle132 nginx-0.6.31]#make [root@oracle132 nginx-0.6.31]#make install [root@oracle132 nginx-0.6.31]# [root@oracle132 nginx-0.6.31]# 安装完毕,默认nginx安装到了/usr/local/下,进入nginx文件夹,打开配置文件! [root@oracle132 conf]# pwd /usr/local/nginx/conf 2)nginx的配置文件详解 [root@oracle132 conf]# vi nginx.conf user nobody nobody; #运行用户 worker_processes 1; #启动进程 #全局错误日志及PID文件 #error_log logs/error.log; error_log logs/error.log notice; #error_log logs/error.log info; pid logs/nginx.pid; #工作模式及连接数上限 events { use epoll; worker_connections 1024; } #设定http服务器,利用它的反向代理功能提供负载均衡支持 http { #设定mime类型 include mime.types; default_type application/octet-stream; #设定日志格式 #log_format main '$remote_addr - $remote_user [$time_local] $request ' # '"$status" $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; #设定请求缓冲 client_header_buffer_size 1k; large_client_header_buffers 4 4k; #设定access log sendfile on; tcp_nopush on; keepalive_timeout 65; #启用网页压缩 gzip on; gzip_http_version 1.0; gzip_comp_level 2; gzip_proxied any; gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_min_length 1100; gzip_buffers 4 8k; (编辑:徐州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |