部署web 安装配置nginx

#vi /etc/sysctl.conf
 
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.printk_ratelimit = 30
kernel.printk_ratelimit_burst = 200
net.ipv4.tcp_max_tw_buckets = 256000
net.ipv4.ip_local_port_range = 1024 65535
net.core.somaxconn = 65535
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_tw_buckets = 28000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_retries1 = 3
net.ipv4.tcp_retries2 = 5
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_keepalive_probes = 2
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_mem = 3097431 4129911 6194862
net.ipv4.tcp_rmem = 4096 87380  6291456
net.ipv4.tcp_wmem = 4096 65536 4194304
net.ipv4.tcp_max_orphans = 131070
net.core.optmem_max = 81920
net.core.wmem_default = 8388608
net.core.wmem_max = 16777216
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.netdev_max_backlog = 862144
fs.file-max = 65535
fs.aio-max-nr = 65536
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296

#vi /etc/security/limits.conf
echo '*                soft    nofile          65535' >>/etc/security/limits.conf
echo '*                hard    nofile          65535' >>/etc/security/limits.conf

 
 
 useradd -r nginx -s /sbin/nologin
 mkdir -p /var/cache/nginx/
 chown -R nginx:nginx /var/cache/nginx/
 yum -y install gcc make  unzip autoconf perl pcre pcre-devel  openssl openssl-devel readline-devel
 unzip jemalloc-4.3.1.zip 
 cd jemalloc-4.3.1
 ./autogen.sh 
 ./configure 
 make 
 make install 
 echo /usr/local/lib > /etc/ld.so.conf.d/local.conf
 ldconfig 
 cd .. 
 tar xf LuaJIT-2.0.4.tar.gz 
 make 
 cd LuaJIT-2.0.4
 make 
 make install 
 export LUAJIT_LIB=/usr/local/lib
 export LUAJIT_INC=/usr/local/include/luajit-2.0
 echo 'export LUAJIT_LIB=/usr/local/lib' >> /etc/profile
 echo 'LUAJIT_INC=/usr/local/include/luajit-2.0' >> /etc/profile
 cd ..
 tar xf openresty-1.11.2.2.tar.gz 
 cd openresty-1.11.2.2
 ./configure --with-luajit --with-pcre  --with-file-aio --user=ngtinx --group=nginx --with-http_v2_module
 gmake 
 gmake  install 
 cd .. 
 
 unzip ngx_devel_kit-0.3.0.zip  
 unzip lua-nginx-module-master.zip 
 unzip lua-upstream-nginx-module-0.06.zip 
 unzip ngx_http_dyups_module-0.2.9.zip 
 unzip ngx_cache_purge-2.3.zip 
 unzip nginx-module-vts-0.1.11.zip 
 unzip ngx_http_geoip2_module-master.zip 
 unzip nginx_upstream_check_module.zip
 tar xf libmaxminddb-1.2.0.tar.gz 
 cd libmaxminddb-1.2.0
 ./configure 
 make 
 make install  
 tar xf nginx-1.10.2.tar.gz 
 cd nginx-1.10.2
 ./configure \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--http-client-body-temp-path=/var/cache/nginx/client_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
--user=nginx \
--group=nginx \
--without-http_autoindex_module \
--without-http_fastcgi_module \
--without-http_uwsgi_module \
--without-http_scgi_module \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_stub_status_module \
--with-threads \
--with-stream \
--with-stream_ssl_module \
--with-http_slice_module \
--with-file-aio \
--with-http_v2_module \
--with-ld-opt="-Wl,-rpath,/usr/local/lib/" \
--add-module="/home/nginx/nginx/nginx/ngx_devel_kit-0.3.0/" \
--add-module="/home/nginx/nginx/nginx/lua-nginx-module-master/" \
--add-module="/home/nginx/nginx/nginx/lua-upstream-nginx-module-0.06/" \
--add-module="/home/nginx/nginx/nginx/ngx_http_dyups_module-0.2.9/" \
--add-module="/home/nginx/nginx/nginx/ngx_cache_purge-2.3/" \
--add-module="/home/nginx/nginx/nginx/nginx-module-vts-0.1.11/" \
--add-module="/home/nginx/nginx/nginx/ngx_http_geoip2_module-master/" \
--add-module="/home/nginx/nginx/nginx/nginx_upstream_check_module-master/"
 make -j4
 make install
 
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值