赞
踩
//一键安装上面四个依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
//创建一个文件夹
cd /usr/local
mkdir nginx
cd nginx
//下载tar包
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
//进入nginx目录
cd /usr/local/nginx
//进入目录
cd nginx-1.13.7
//执行命令 考虑到后续安装ssl证书 添加两个模块
./configure --with-http_stub_status_module --with-http_ssl_module
//执行make命令
make
//执行make install命令
make install
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
# 打开配置文件
vi /usr/local/nginx/conf/nginx.conf
/usr/local/nginx/sbin/nginx -s reload
# 打开配置文件
vi /usr/local/nginx/conf/nginx.conf
location /download {
root /data;
add_header Content-Disposition: "attachment";
add_header Content-Type application/octet-stream;
autoindex off; # 开启目录浏览功能
autoindex_exact_size off; # 关闭详细文件大小统计,让文件大小显示MB,GB单位,默认为b
autoindex_localtime on; # 开启以服务器本地时区显示文件修改日期
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。