mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/selfhosting-blogposts.git
synced 2025-05-17 04:36:58 +00:00
add selfhosting tutorials
This commit is contained in:
parent
95c33c8b41
commit
cc3824e6a2
1900 changed files with 32727 additions and 0 deletions
BIN
phpfilesafe/1.png
Normal file
BIN
phpfilesafe/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
BIN
phpfilesafe/2.png
Normal file
BIN
phpfilesafe/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
phpfilesafe/3.png
Normal file
BIN
phpfilesafe/3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 93 KiB |
BIN
phpfilesafe/4.png
Normal file
BIN
phpfilesafe/4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
81
phpfilesafe/index.md
Normal file
81
phpfilesafe/index.md
Normal file
|
@ -0,0 +1,81 @@
|
|||
# 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](https://www.duckdns.org/)
|
||||
|
||||

|
||||
|
||||
## **Nginx Configuration**
|
||||
|
||||
Next configure nginx:
|
||||
|
||||
|
||||
mkdir /var/www/html/filesafe
|
||||
mkdir /var/www/html/filesafe/uploads/
|
||||
|
||||
wget https://blog.nowhere.moe/servers/phpfilesafe/phpfilesafe.conf -O /etc/nginx/conf.d/phpfilesafe.conf
|
||||
|
||||
wget https://blog.nowhere.moe/servers/phpfilesafe/logo.png -O /var/www/html/filesafe/logo.png
|
||||
wget https://blog.nowhere.moe/wallpaper.png -O /var/www/html/filesafe/wallpaper.png
|
||||
wget https://blog.nowhere.moe/servers/phpfilesafe/html/index.php -O /var/www/html/filesafe/index.php
|
||||
wget https://blog.nowhere.moe/servers/phpfilesafe/html/style.css -O /var/www/html/filesafe/style.css
|
||||
wget https://blog.nowhere.moe/servers/phpfilesafe/html/upload.php -O /var/www/html/filesafe/upload.php
|
||||
|
||||
cd /var/www/html/filesafe
|
||||
chown -R www-data: .
|
||||
|
||||
|
||||
Then get your free letsencrypt certificate using acme.sh:
|
||||
|
||||
|
||||
wget -O - https://get.acme.sh | sh
|
||||
source ~/.bashrc
|
||||
|
||||
|
||||
|
||||
|
||||
systemctl stop nginx
|
||||
acme.sh --issue --standalone -d ech2.duckdns.org -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)
|
||||
|
BIN
phpfilesafe/logo.png
Normal file
BIN
phpfilesafe/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 83 KiB |
Loading…
Add table
Add a link
Reference in a new issue