可按Ctrl+D收藏 蚂蚁资源网

蚂蚁资源网

源码安装nginx(centos nginx 安装)

  • 全部评论(3)
  • dsadasd
  • yum install -y epel-releaseyum clean all && yum makecacheyum install -y nginx
  • 2021-02-23 17:50:01
  • 111
  • 先安装编译依赖的一些组件复制代码 代码如下:yum install pcre pcre-devel openssl openssl-devel -y1、解压程序包复制代码 代码如下:tar xf nginx-1.10.0.tar.gz cd nginx-1.10.02、预编译配置参数复制代码 代码如下:./configure --user=www \--group=www \--prefix=/data/server/nginx \--with-http_stub_status_module \--without-http-cache \--with-http_ssl_module \--with-http_gzip_static_module3、执行编译复制代码 代码如下:make && make install4、替换配置文件nginx.confuser www www;worker_processes 1;error_log /u01/data/log/nginx/error.log crit;pid /u01/data/server/nginx/logs/nginx.pid;#Specifies the value for maximum file descriptors that can be opened by this process.worker_rlimit_nofile 65535;events{use epoll;worker_connections 65535;}http {include mime.types;default_type application/octet-stream;#charset gb2312;server_names_hash_bucket_size 128;client_header_buffer_size 32k;large_client_header_buffers 4 32k;client_max_body_size 8m;sendfile on;tcp_nopush on;keepalive_timeout 60;tcp_nodelay on;fastcgi_connect_timeout 300;fastcgi_send_timeout 300;fastcgi_read_timeout 300;fastcgi_buffer_size 64k;fastcgi_buffers 4 64k;fastcgi_busy_buffers_size 128k;fastcgi_temp_file_write_size 128k;gzip on;gzip_min_length 1k;gzip_buffers 4 16k;gzip_http_version 1.0;gzip_comp_level 2;gzip_types text/plain application/x-javascript text/css application/xml;gzip_vary on;#limit_zone crawler $binary_remote_addr 10m;log_format main '$remote_addr - "$request_time" [$time_local] "$request" ''"$status" $body_bytes_sent "$http_referer" ''"$http_user_agent" $http_x_forwarded_for';log_format '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" $http_x_forwarded_for "$request_time"';include /u01/alidata/server/nginx/conf/vhosts/*.conf;
  • 2021-02-11 23:12:06
  • 互站网
  • php怎么把程序部署到nginx服务器,Nginx安装方法:1 apt网络安装修改源列表?1234vi /etc/apt/sources.list#加入以下源deb http://nginx.org/packages/debian/ squeeze nginxdeb-src http://nginx.org/packages/debian/ squeeze nginx更新源列表并通过apt安装nginx?123apt-key add nginx_signing.keyapt-get updateapt-get install nginx2 源码编译安装先安装编译环境, 由于nginx在以后的使用中会需要用到perl正则、压缩算法、SSL等特性,所以我们需要提前安装相关库文件。
  • 2021-02-11 23:12:06
  • 商品推荐