1: Log in to the linux server
secureCRT: SecureCRT is a terminal emulation program that supports SSH. Simply put, it is a software for logging in to UNIX or Linux server hosts under Windows. The difference is that SecureCRT supports SSH, as well as Telnet and rlogin protocols. SecureCRT is an ideal tool for connecting Windows, UNIX and VMS. toll;
Solve the problem that the mac computer cannot save the password
secureCRT related settings (linux color settings, placing linux session disconnection settings) Putty, XShell, SecureCRT, SSH Secure Shell Slient which one is easy to use ?
Xshell : Xshell terminal emulator; free;
putty: windows ssh tool introduced by kevin
Mac computer SSH connection to linux:
mac computer remote connection to Linux
netstat -ntulp |grep 80 Check if the port starting with 80 is occupied, it will list all the ports starting with 80 kill -9 process id, query and kill the corresponding process. kill -9 11823
Connection host: ssh [email protected] Password: 3b8e45b74457e318
ssh -X [email protected]
2: View linux system information
Use the cat command to view # cat /proc/version (Linux view the current operating system version information)
cat /proc/version
3:
Remote terminal login information IP:47.100.34.60 PORT:22 USER:root PWD:XXh6FjUurx ======================================================= Redis information PORT:6379 PASSWORD:nozuonodie ======================================================= fastDFS information PORT:23000/22122 File access address: http://47.100.34.60:8000/file path File everywhere path: /data/fdfs_storage/ nginx path: /data/nginx/ ======================================================= tomcat related information /usr/local/tomcat8l /usr/local/jdk8
Linux file editing commands are organized in detail
vi xxx.xml what! wow
4: How to check whether tomcat is started/system log under Linux x
5: windows linux file transfer tool winscp.exe
winscp is an open source graphical sftp client using ssh in windows environment. Also supports scp protocol
Or directly use the scp command to get
Linux sftp login: sftp [email protected] Upload file: put /work/android-project/eduQudao/java/qudaoedu/target/qudaoedu.war /usr/local/tomcat8/webapps/qudaoedu.war Upload file example 2: sftp> put /Users/duandazhi/Downloads/portal.war /usr/local/tomcat8/portal.war The sftp command also supports basic file operation commands, such as cd ls mkdir; local system, you can also use these commands, add L in front of the command
Scenario: Use sftp to copy the local folder /Users/duandazhi/Downloads/dazerPath (including subfolders) to the /usr/local/tomcat8/webapps directory of the server
put: put: No such file or directory
Command: put step: 1. First locate the remote /usr/local/tomcat8/webapps directory: cd /usr/local/tomcat8/webapps/ourslook 2. Create a new folder in the webapps directory: mkdir ourslook rm -rf * Force silent deletion of all files and directories under ourslook, operate with caution 3. Enter the remote ourslook folder: cd ourslook 4. Locally locate the Downloads folder: lcd /Users/duandazhi/Downloads (You can view it with the command lls, Data should be in the local directory) 5. Execute the key command: put -r dazerPath/. To upload the local dazerPath directory to the server, the premise is that you have entered the ourslook directory of the server. This will automatically create the ourslook directory without creating a dazerPath directory on the server. [[Or use the following command to get it done]: put -r /Users/duandazhi/Downloads/ourslook/. /usr/local/tomcat8/webapps/ourslook put /Users/duandazhi/Downloads/portal.war /usr/local/tomcat8/webapps/portal.war 6. Swipe ............................ Copy all the things in the local dazerPath folder (including various subfolders) to remote ourslook 6: Basic configuration of linux server; in fact, the easiest way is to use secureCRT SFTP to upload and drag directly.
Remote terminal login information IP:xxx.xx.xx.xx PORT:22 USER:root PWD : h6FjUurx ======================================================= Redis information PORT:6379 PASSWORD:nozuonodie ======================================================= fastDFS information PORT:23000/22122 File access address: http://xx.xxx.xx.xx:8000/file path File everywhere path: /data/fdfs_storage/ nginx path: /data/nginx/ ======================================================= tomcat related information /usr/local/tomcat8l /usr/local/jdk8 =======================================================
Restart of linux server tomcat Restart Tomcat under Linux x Relevant commands of tomcat service under linux x
1. Start the tomcat service Method 1: Start directly ./startup.sh -- not recommended Method 2: Start nohup as a service ./startup.sh & -- start tomcat in the background Method 3: Start the console dynamic output mode./catalina.sh run to dynamically display the console output information of the tomcat background, Ctrl+C to exit and close the service 2. Check whether tomcat is started
kill the viewing process
1: Check whether tomcat is running ps -ef|grep java 1-1: Check whether tomcat is running ps -ef |grep tomcat #If there is printing tomcat related, it means running 1-2: Check if the port is occupied netstat -apn | grep 8888 1-3: The process number can be seen in the above methods, kill -9 1711
linux basic commands
Linux Move or Rename File/Directory - 10 Practical Examples of mv
rm -rf ourslook/ silently and recursively delete ourslook directory mv jdk-8u161-linux-x64.rpm jdk8x64.rpm rename a single file mv download/ downloads/ rename directory
6: Check the command to check the CPU model, memory size, hard disk space, and server configuration under linux
Probably with a 7000-8000 is almost the same, linux, windows can be; if there is no need to use linux, then use WINDOWS CPU: 4 cores RAM:8G-16G HDD SYS:40G HDD DATA:100G NETWORK: about 8M
Check the hard disk size: df -h
Chijun driver server configuration: 1 4-core CPU, model Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz, 8G memory, 128G hard disk Guqibao server configuration: 1 2-core CPU, model Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz, 16G memory, 100G hard disk
View the file or folder size under the current directory:
//View the space occupied by each file and directory in the current directory du -sh *
7: Check the current linux How to check whether the current system version is UBuntu or Cent OS?
Very simple, the command is: lsb_release -a
8: nohup command description
nohup ./startup.sh &
9: Check if linux is 32 or 64 bit:
getconf LONG_BIT
10: Edit text, one is to try the upload and download commands of fstp, and edit it locally; one is to try the vi command;
vi auxiliary trial ESC and: command input and insert, i switch to insert mode Exit without saving: :q! Display line number: :set number Jump to the specified line: ngg or nG, eg: 23gg or 23G, jump to line 23 Highlight word: Shift + * Exit save: :wq Save to another file: :w new filename
11: linux firewall settings --
Centos7 used iptables before, and then kept iptables but replaced it with firewall
Open, close, view status, basic settings, etc. of iptables and firewall in ce ntos
Pay attention to closing the firewall and iptables firewall settings. If it does not take effect after closing and restarting, add the release settings; if the internal network can be accessed, but the external network still cannot be accessed, it is necessary to check whether the relevant server provider has released the corresponding port number. For details, see : Check if TCP port 80 is working x
centos7 View firewall status: firewall-cmd --list-all The port number opened by the Chijun Driver Project: ports: 80/tcp 80/udp 3306/tcp 3306/udp 6379/tcp 6379/udp 23000/tcp 23000/udp 22122/tcp 22122/udp 8000/tcp 8000/udp service firewalld restart restart service firewalld start open service firewalld stop shutdown firewall-cmd --list-all View firewall rules firewall-cmd --state View firewall status firewall-cmd --zone=public --add-port=22/tcp --permanent firewall-cmd --zone=public --add-port=21/tcp --permanent firewall-cmd --zone=public --permanent --add-port=80/tcp --permanent firewall-cmd --zone=public --permanent --add-port=80/udp --permanent firewall-cmd --zone=public --permanent --add-port=3306/tcp --permanent firewall-cmd --zone=public --permanent --add-port=3306/udp --permanent firewall-cmd --zone=public --permanent --add-port=6379/tcp --permanent firewall-cmd --zone=public --permanent --add-port=6379/udp --permanent firewall-cmd --zone=public --permanent --add-port=23000/tcp --permanent firewall-cmd --zone=public --permanent --add-port=22122/tcp --permanent firewall-cmd --zone=public --permanent --add-port=22122/udp --permanent firewall-cmd --zone=public --permanent --add-port=8080/tcp --permanent firewall-cmd --zone=public --permanent --add-port=8080/udp --permanent firewall-cmd --zone=public --permanent --add-port=443/tcp --permanent firewall-cmd --zone=public --permanent --add-port=443/udp --permanent firewall-cmd --zone=public --permanent --add-port=8888/tcp --permanent firewall-cmd --zone=public --permanent --add-port=8888/udp --permanent After adding, restart the firewall to take effect: restart the firewall command: firewall-cmd --reload or service firewalld restart
12: linux centos set and view server time
Modification time, such as: date -s "2018-02-26 15:54:00". Can also be: date -s "15:54:00" View current time: date Network time synchronization: ntpdate -u 210.72.145.44, or command: ntpdate -u ntp.api.bz
x
13: Environment variable settings
vi /etc/profile #export Add command, command reference java environment variable # source /etc/profile #Effective immediately #env view or echo $PATH14: centos7 supports Chinese
Centos7 Chinese garbled solution x There are two directories vi /etc/sysconfig/i18n and vi /etc/locale.conf If not, create a file
The first trick: check whether Chinese language is supported, such as: "echo Chinese"
The second trick: "mkdir Chinese directory name", if it can be typed and displayed normally. Chijun and Quanbao are fine, you need to "reboot" to restart;
The third trick: date If the date in Chinese is displayed, it is OK
15: restart centos7
Linux restart command X, a command reboot to get it, usually do not shut down the shutdown, it is very troublesome to operate and maintain it.
16 Common compression and decompression commands
17: Check the tomcat log, the tomcat8.5 is used here, and the war package uses the springboot project
Switch to: cd /usr/local/tomcat85/bin/logs Regular or: cd /usr/local/tomcat85/logs Dynamically display the log: tail -f catelina.out This will always be refreshed dynamically18: