使用Nginx搭建文件服务器 nginxwebdav
程序员文章站
2024-03-14 18:02:34
...
下载Nginx软件包
wget http://nginx.org/download/nginx-1.17.3.tar.gz
解压Nginx软件包
tar -zxvf nginx-1.17.3.tar.gz
切换到Nginx目录
cd nginx-1.17.3
安装Nginx依赖包
yum install -y pcre pcre-devel zlib zlib-devel openssl openssl-devel gcc gcc-c++
安装Nginx到系统
./configure --with-http_dav_module
make
make install
修改Nginx的配置
cd /usr/local/nginx/conf
vi nginx.conf
============================================================
location / {
root html;
client_body_temp_path html;
dav_methods PUT;
create_full_put_path on;
dav_access user:rw group:r all:r;
limit_except GET {
auth_basic "closed site";
auth_basic_user_file htpasswd;
}
index index.html index.htm;
}
============================================================
写入密码到文件
echo 'bessky:52PrWRJdkBic6' > htpasswd
启动Nginx服务
../sbin/nginx
优化配置
vi /etc/security/limits.conf
============================================================
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535
============================================================
ulimit -n
开机启动
cd /lib/systemd/system
vi nginx.service
============================================================
[Unit]
Description=nginx service
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
============================================================
开机启动
systemctl enable nginx
禁止启动
systemctl disable nginx
启动服务
systemctl start nginx.service
停止服务
systemctl stop nginx.service
重启服务
systemctl restart nginx.service
wget http://nginx.org/download/nginx-1.17.3.tar.gz
解压Nginx软件包
tar -zxvf nginx-1.17.3.tar.gz
切换到Nginx目录
cd nginx-1.17.3
安装Nginx依赖包
yum install -y pcre pcre-devel zlib zlib-devel openssl openssl-devel gcc gcc-c++
安装Nginx到系统
./configure --with-http_dav_module
make
make install
修改Nginx的配置
cd /usr/local/nginx/conf
vi nginx.conf
============================================================
location / {
root html;
client_body_temp_path html;
dav_methods PUT;
create_full_put_path on;
dav_access user:rw group:r all:r;
limit_except GET {
auth_basic "closed site";
auth_basic_user_file htpasswd;
}
index index.html index.htm;
}
============================================================
写入密码到文件
echo 'bessky:52PrWRJdkBic6' > htpasswd
启动Nginx服务
../sbin/nginx
优化配置
vi /etc/security/limits.conf
============================================================
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535
============================================================
ulimit -n
开机启动
cd /lib/systemd/system
vi nginx.service
============================================================
[Unit]
Description=nginx service
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
============================================================
开机启动
systemctl enable nginx
禁止启动
systemctl disable nginx
启动服务
systemctl start nginx.service
停止服务
systemctl stop nginx.service
重启服务
systemctl restart nginx.service
推荐阅读
-
使用Nginx搭建文件服务器 nginxwebdav
-
实时监控、直播流、流媒体、视频网站开发方案流媒体服务器搭建详解:使用nginx搭建rtmp直播、rtmp点播、,hls直播服务配置详解
-
使用dockercompose搭建springboot-mysql-nginx应用
-
在windows环境下使用nginx搭建服务器配合axure演示原型
-
使用nginx搭建点播和直播流媒体服务器的方法步骤
-
Nginx环境搭建与使用
-
FastDFS - Linux下搭建FastDFS 文件服务器与Nginx配置(部署和运维)
-
CentOS 6(64-bit) + Nginx搭建静态文件服务器
-
Nginx搭建HTTPS服务器和强制使用HTTPS访问的方法
-
Nginx搭建HTTPS服务器和强制使用HTTPS访问的方法