- using python3 modules such as http.sever and uploadserver have already been discussed
- alternatively apache or nginx can likewise be used
```bash
#Nginx config file to be saved in /etc/nginx/sites-available/upload.conf
server {
listen 9001;
location /target/ {
root /var/www/uploads;
dav_methods PUT;
}
}
```
# Nginx Setup
```bash
sudo mkdir -p /var/www/uploads/target
sudo chown -R www-data:www-data /var/www/uploads/target
sudo ln -s /etc/nginx/sites-available/upload.conf /etc/nginx/sites-enabled/ #symlink site to site-enabled directory
sudo systemctl restart nginx.service #start nginx
tail -2 /var/log/nginx/error.log #check for errors
ss -lntp | grep 80 #check to see if port 80 is being used and note pid
ps -ef | grep <pid> #search on the pid listenting on port 80
sudo rm /etc/nginx/sites-enabled/default #if port 80 is already occupied, remove defautl nginx config, which binds to port 80
```
```bash
#test uploading file to nginx server using curl to send a PUT request
curl -T /etc/passwd http://localhost:9001/target/users.txt #upload /etc/passwd to /var/www/uploads/target as users.txt
sudo tail -5 /var/www/uploads/target/users.txt #check for uploaded file
```