Previous Page

nihilist - 00 / 00 / 00

PHP LainSafe

Before we start, you will need a Debian 10+ VPS (you can get one on digitalocean for example), if you prefer to use your own self hosted server, make sure that port 80 and 443 are correctly port forwarded so that the public ip points to the server and not the router. Once that's done, go and ssh into your debian 10 server.

Initial Setup

apt update -y && apt upgrade -y
apt install nginx php7.4-fpm curl php7.4-common socat -y
systemctl enable --now nginx php7.4-fpm

Next get yourself a domain name, you can use DuckDNS

Nginx Configuration

Next configure nginx:

mkdir /var/www/html/filesafe
mkdir /var/www/html/filesafe/uploads/

wget -O /etc/nginx/conf.d/phpfilesafe.conf

wget -O /var/www/html/filesafe/logo.png
wget -O /var/www/html/filesafe/wallpaper.png
wget -O /var/www/html/filesafe/index.php
wget -O /var/www/html/filesafe/style.css
wget -O /var/www/html/filesafe/upload.php

cd /var/www/html/filesafe
chown -R www-data: .

Then get your free letsencrypt certificate using

wget -O - | sh
source ~/.bashrc

systemctl stop nginx --issue --standalone -d -k 4096
systemctl start nginx 

nano /etc/nginx/conf.d/phpfilesafe.conf

Edit the nginx config to have your own domain name:

Once you're done, hit CTRL+S to save and CTRL+X to exit nano and just reload nginx, and view the website:

End Result

Reload the nginx configuration since we modified it:

nginx -t
nginx -s reload

Then just browse to your website:

And you're done! just upload your files (png, jpg, jpeg, pdf) (you can edit the extensions you want in upload.php)

If you want you can also edit the maximum filesize in the upload.php file (line 36)


Until there is Nothing left.

About nihilist

Donate XMR: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8

Contact: (PGP)