当前位置:网站首页>Raspberry pie 4B deploys lnmp+tor and builds a website on dark web
Raspberry pie 4B deploys lnmp+tor and builds a website on dark web
2022-07-03 10:24:00 【Shenzhen University of technology affiliated middle school open】
Raspberry pie 4b Deploy LNMP+Tor, Set up in Dark web On the website
Preparation before start
You need to have :
- A computer
- Raspberry pie 4b And its necessary accessories
- Putty
- Winscp
- Public network IP
We should ensure that we can access the Internet scientifically
System
download Raspberry Pi OS
Go to Raspberry pie website download Raspberry Pi OS
What I choose here is Raspberry Pi OS Lite, If it is the other two, it will not affect
Burn into TF card
Go to Balena.io download Etcher Tools 
install 
Burning system ( Remember to run as an administrator )
Wait quietly for the burning to complete
SSH
Open the raspberry pie SSH function
Just burning the system TF card (boot disc ) Create a new one without suffix SSH file 

use Putty Connect the raspberry pie
open Putty, Connect the raspberry pie 
Log in with the default account password
account number pi
password raspberry


modify SSH Password and enable root SSH Sign in
modify pi password
sudo passwd pi

Empathy , modify root password , Enable root And open ssh Sign in
sudo passwd root
sudo passwd --unlock root
sudo sed -i "s/^#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
sudo systemctl restart ssh
sudo cp ~/.bashrc /root/.bashrc

Deploy LNMP
install Nginx and PHP7
Install package
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install nginx php7.3-fpm php7.3-cli php7.3-curl php7.3-gd php7.3-cgi
sudo service nginx start
sudo service php7.3-fpm restart
After successful installation, you can http:// Raspberry pie IP/ Access to the Nginx Default page for 
Nginx The root of /var/www/html
Give Way Nginx Can deal with PHP
sudo nano /etc/nginx/sites-available/default
Add the following
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

Replace with
location / {
index index.html index.htm index.php default.html default.htm default.php;
}
location ~\.php$ {
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

preservation
Ctrl + O
Enter
sign out
Ctrl + X
restart Nginx
sudo service nginx restart
Installation configuration MySQL
Install package
sudo apt-get install mariadb-server-10.0
change Mysql password
mysql

use mysql;
update user set plugin='mysql_native_password' where user='root';
UPDATE user SET password=PASSWORD(' The password you want to set ') WHERE user='root';
flush privileges;
exit;

restart Mysql service
service mysql restart
Install and deploy Tor service
install Tor
sudo apt-get install tor
Tor The root of /etc/tor
To configure Hidden Service obtain Onion domain name
edit /etc/tor/torrc
sudo nano /etc/tor/torrc
Find out , Get rid of the front # Number
############### This section is just for location-hidden services ###
## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.
HiddenServiceDir /var/lib/tor/hidden_service/ //hidden service The catalog of
HiddenServicePort 80 127.0.0.1:80 //HTTP The server IP, port
#HiddenServiceDir /var/lib/tor/other_hidden_service/
#HiddenServicePort 80 127.0.0.1:80
#HiddenServicePort 22 127.0.0.1:22

preservation
Ctrl + O
Enter
sign out
Ctrl + X
restart Tor service
killall tor
sudo -u debian-tor tor
Waiting to start , The first startup takes a long time , To ensure smooth network 
Just display the following
[notice] Bootstrapped 100%: Done

obtain Onion domain name
Default in /var/lib/tor/hidden_service/hostname
cd /var/lib/tor/hidden_service/
cat hostname

Modify the permissions
modify /var/www Folder permissions
sudo chown -R debian-tor:www-data /var/www

Restart again Tor service
killall tor
sudo -u debian-tor tor
Visit website
Download and install Tor browser , He said a few
Connected to the Tor service , Access the obtained Onion domain name 
complete
Reference material
SSH——https://www.jianshu.com/p/654ee08d2b3a
LNMP——https://shumeipai.nxez.com/2020/03/21/install-pi-dashboard-with-nginx-php73-on-pi.html
Tor
——https://blog.csdn.net/kEnnponN/article/details/82662445
——https://blog.csdn.net/weixin_30721899/article/details/98115671?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.control
——https://tor.stackexchange.com/questions/14863/var-lib-tor-is-not-owned-by-this-user-root-0-but-by-debian-tor-110
——https://askubuntu.com/questions/833021/could-not-bind-to-127-0-0-19050-address-already-in-use-is-tor-already-running
Authority modification ——https://zhidao.baidu.com/question/94171636.html
边栏推荐
- 20220610其他:任务调度器
- 【毕业季】图匮于丰,防俭于逸;治不忘乱,安不忘危。
- Deep learning by Pytorch
- Leetcode - 1670 design front, middle and rear queues (Design - two double ended queues)
- 20220606 Mathematics: fraction to decimal
- 20220609 other: most elements
- Leetcode-404: sum of left leaves
- Leetcode-106: construct a binary tree according to the sequence of middle and later traversal
- 20220531 Mathematics: Happy numbers
- 20220601数学:阶乘后的零
猜你喜欢

Label Semantic Aware Pre-training for Few-shot Text Classification

QT self drawing button with bubbles

CV learning notes convolutional neural network

Hands on deep learning pytorch version exercise answer - 2.2 preliminary knowledge / data preprocessing

Opencv image rotation

LeetCode - 1670 設計前中後隊列(設計 - 兩個雙端隊列)

Secure in mysql8.0 under Windows_ file_ Priv is null solution

Leetcode - 1670 conception de la file d'attente avant, moyenne et arrière (conception - deux files d'attente à double extrémité)

Vgg16 migration learning source code

Leetcode - 5 longest palindrome substring
随机推荐
2018 Lenovo y7000 black apple external display scheme
CV learning notes - image filter
Standard library header file
CV learning notes - clustering
The underlying principle of vector
2018 y7000 upgrade hard disk + migrate and upgrade black apple
Connect Alibaba cloud servers in the form of key pairs
CV learning notes - BP neural network training example (including detailed calculation process and formula derivation)
Tensorflow2.0 save model
Opencv feature extraction - hog
Window maximum and minimum settings
QT self drawing button with bubbles
Hands on deep learning pytorch version exercise solution - 2.5 automatic differentiation
CV learning notes convolutional neural network
Neural Network Fundamentals (1)
Anaconda installation package reported an error packagesnotfounderror: the following packages are not available from current channels:
20220605数学:两数相除
20220609 other: most elements
Wireshark use
Powshell's set location: unable to find a solution to the problem of accepting actual parameters