nginx 安装
1.创建用户
useradd -r www -s /bin/false -M
2创建目录
mkdir -p /var/tmp/nginx/client/
3、安装依赖
yum -y install gcc
yum -y install pcre pcre-devel
yum -y install zlib zlib-devel
yum -y install openssl openssl-devel
4、下载 nginx包 wget http://nginx.org/download/nginx-1.19.1.tar.gz
5、编译
./configure --user=www --group=www --prefix=/usr/ --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --error-log-path=/var/log/nginx/nginx_error.log --http-log-path=/var/log/nginx/nginx_access.log --pid-path=/usr/local/nginx/run/nginx.pid --lock-path=/usr/local/nginx/lock/nginx --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_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-pcre --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
6、安装 make&&make install
7、systemctl stop firewalld.service 关闭防火墙
8、systemctl disable firewalld.service 开机禁用防火墙
9、启动 cd /usr/sbin/ .\nginx
如果使用ngin 上传大文件要设置 大小可以自己定义 nginx.config http{} 里面添加
client_max_body_size 50m; //文件大小限制,默认1m client_header_timeout 1m; client_body_timeout 1m; proxy_connect_timeout 60s; proxy_read_timeout 1m; proxy_send_timeout 1m;