## 一、通过apache来实现
### 1. 安装apache2
```bash
apt-get install apache2
```
### 2. 配置
1. 访问apache2 web页面,访问的默认路径是`/var/www/html`,将路径下的index.html删除,放一些需要上传的文件就可以当文件服务器用了
2. 但是默认的路径很不方便使用,我们可以通过软链接把需要使用的路径放过过来
```bash
cd /var/www/html
sudo ln -s /home/xxx/DOC DOC
```
后续需要的文件直接放在`/home/xxx/DOC`下就可以了
### 3. 最终效果
![title](https://leanote.com/api/file/getImage?fileId=5f48c7bdab644151d6001702)
---
## 二、通过python
### 1. 配置
按如下命令可以把当前路径映射为文件服务器
```bash
# Python 2
python -m SimpleHTTPServer
# Python 3
python3 -m http.server
```
### 2. 最终效果
![title](https://leanote.com/api/file/getImage?fileId=5f48c895ab64414f9700160b)
---
## 三、通过miniserver
> 上面两种方法都没有上传的功能,如果需要直接在网页上传,可以使用miniserver
### 1. 安装以及配置方法
```bash
sudo curl -L https://github.com/svenstaro/miniserve/releases/download/v0.4.1/miniserve-linux-x86_64 -o /usr/local/bin/miniserve
sudo chmod +x /usr/local/bin/miniserve
# 启动
miniserve -u ~/Documents/
# 详细命令可以通 --help查看
miniserver --help
```
### 2. 最终效果
![title](https://leanote.com/api/file/getImage?fileId=5f48ca10ab644151d6001714)