Install Nginx, configure firewall and file structure; SFTP transfer download, SCP upload download.
// it is not clear here that it is very similar to the last one.
Nginx
Install Nginx
Apt get update
apt install nginx
;
after installation, the service will be automatically executed,
verification: systemctl status nginx
;
Configure the firewall
ufw allow 'Nginx
;
verification :ufw status
;
Successful execution interface
File structure
all Nginx configuration files are located in /etc/nginx
directory.
the main configuration file for Nginx is /etc/nginx/nginx.conf
. To make the Nginx configuration easier to maintain, it is recommended to create a separate configuration file for each domain. You can have as many server block files as you want.
Nginx server prevents files from being stored in the /etc/nginx/ locations-available
directory. Nginx will not use the configuration files found in this directory unless they are linked to the /etc/nginx/ location-enabled
directory.
to activate the server block, you need to create a symbolic link (pointer) from the configuration file site in the sites-available directory to the directory sites-enabled.
is recommended to follow standard naming conventions. For example, if your domain name is mydomain.com, then your configuration file should be named /etc/nginx/sites-available/mydomain.com.conf code>
the/etc/nginx/snippets directory contains can included in the configuration file from the server. If you use repeatable configuration segments, you can refactor these segments into fragments and include the fragment file in the server block.
Nginx log files (access.log and error.log) are located in the /var/log/ Nginx
directory. It is suggested that there are different Access, and the error is the log file of each server module.
The MAC sends files to the server
SFTP transfer download
Create a new remote connection in the shell and send it using SFTP (prompted for server password) :
Use put to send command: put local file path remote path
; The
put command cannot upload a folder directly. Can be packaged for delivery.
use the get download command get remote path
;
use bye to exit SFTP :bye
.
SCP upload and download
1, from the server to download file SCP username @ servername:/path/filename/Users/MAC/Desktop (local directory) code>
For example: SCP [email protected]:/root/zouzouzou. TXT/Users/MAC/Desktop code> is the server/root/zouzouzou. TXT/Users/MAC/downloaded to a local Desktop directory.
[email protected]: SCP - r/raid5 ZXX/my_download/zouzouzou.zip/users/zhuxiaoxia/Desktop code>
2. Upload local files to the server SCP /path/filename username@servername:/path
;
For example, SCP/Users/MAC/Desktop/zouzouzou. TXT [email protected]:/root/ code>
3. Download the whole directory scp-r username@servername:/root/ (remote directory) /Users/ MAC /Desktop (local directory)
For example : scp-r [email protected]:/root/ /Users/ MAC /Desktop/
4. Upload directory to server scp-r local_dir username@servername:remote_dir
For example: scp-r test [email protected]:/root/ upload the test directory under current directory to the server's /root/ directory
Reminder: The target server wants to enable write permission.
Read More:
- Mac realizes file interaction (upload and download) between terminal and server
- To solve the problem of nginx accessing PHP file into download
- Nginx startup error: nginx: [error] open() “/ var / run / nginx/ nginx.pid The solution of “failed (2: no such file or directory)”
- nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
- nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
- Implementation of HTTPS file server based on nginx in win2012
- /var/run/nginx/nginx.pid” failed (2: No such file or directory)
- Alibaba cloud builds FTP server 200 port command successful. Consider using PASV. 425 failed to establish connection
- Docker builds the pit that Seata stepped on. can not connect to services-server
- nginx: [error] open() “/usr/local/var/run/nginx.pid” failed (2: No such file or directory)
- Nginx installation in MAC
- nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
- CentOS7 nginx Failed to read PID from file /run/nginx.pid: Invalid argument?
- nginx: open() “/var/run/nginx.pid“ failed (2: No such file or directory)
- The file server reports an error of 413, and the file uploaded by nginx reports an error of 413 request entity too large
- Failed to download package files error after re installing Ubuntu
- Solve the MAC terminal download error curl: (7) failed to connect to raw.githubusercontent.com port 443: Connection refused
- The jar package download of Maven project appears (could not transfer artifact. Org mybatis:mybatis )
- Google cloud disk: too many users have recently viewed or downloaded this file. Please try to access this file later. (How to Bypass Google Drive Download Limit (Quota Exceeded) Error)
- HDFS and local file transfer and error reporting