In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to deploy the java project in linux. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
There are four main folders under the 1.linux directory, you know, etc,usr,home,root
Image.png
2.linux common commands (there are some cp,mv detailed use is not listed, because the feeling can be replaced with xftp, if you really want to use it can also be checked, I think the less can remember the better. Remember the commonly used ones first, and then remember the others. I have typed every command below, and I often use it in the use of linux.
Cd.. cd ~ return home directory, that is, root directory cd / switch to root directory cd usr switch to this directory usr directory ls view all files and folders under the current root directory is the abbreviation of list word mkdir create folder clear clear screen find/root-name'* test*' vaguely query test files and folders under root directory, tar package, gz compression The packaged compressed files on linux can also be decompressed locally and uploaded to the linux server ps-ef | grep system to view all the processes in the current system ps-ef | grep tomcat to see how many tomcat processes are currently pkill-9-java to end the java process netstat-apn | grep: 8080 and then use kill-9 pid to kill the specified process sh / usr/lib/tomcat/server/web_inst/webapp_cs/start. Sh starts tomcatifconfig to view the URL of linux netstat-an to view the port usage of the current system chmod u=rwx Mv aaa.txt aaa.txt mv cut copy-s aaa copy folder or file this s means recursively If there are files in the folder, use-s to traverse rm-s aaa to delete folders or files rm-rf aaa to delete files and folders r represents a loop, f represents mandatory, no need to ask for additions, deletions, changes and queries of files and folders, you can operate through xftp. If you want to modify files on linux, you can download files on linux to windows for modification (for example, add the suffix .txt) After the modification is completed, you can force ctrl+c to exit the vim file after uploading to the linux server, modify the contents of the file, vim aaa.txt, press I to edit mode, if you want to save, press ESC, and then enter: wq can save the tar-zcvf xxx.tar.gz / test/* to decompress the file on linux. The open port 22 of linux by default cannot be modified.
two。 Ali Cloud Server
I have already bought it here, so I will not repeat the purchase process.
Image.png
Please install xftp and xshell
Image.png
Briefly introduce the functions of these two kinds of software (please Baidu related documentation for details) Xshell: connect to the remote server host through the network. Xftp: can transfer files between Unix and Windows.
3. Connect the remote host through Xshell, as shown in the following figure
Image.png
A good article is recommended here.
Aliyun's initial experience of deploying JavaWeb Project
I started tomcat smoothly with the author of csdn, and never installed it when installing mysql. Later, I found that the linux I installed at the beginning was 32-bit, and the online tutorial was basically 64-bit, so I deleted the system and redid it. When it's done. Inadvertently found a better way. This method allows you to quickly deploy on Aliyun.
Image.png
Here is a public image of Ali Yun, which contains tomcat,jdk,mysql. It can save you the trouble of installation.
Public image address
Here, I would like to tell you a pit. Because linux only opens port 22 by default, mainly for security, but our tomcat port 8080 and mysql ports all need to be open, otherwise we will not be able to connect.
Previous operation
/ sbin/iptables-I INPUT-p tcp-- dport 8080-j ACCEPT/etc/rc.d/init.d/iptables save-permanently save the changes to the firewall
Now you just need to enter your server, click manage-> Security rules, and open the port.
Image.png
Since the Aliyun system has been installed before, the original system needs to be deleted with the mirror, so I backed up it with a snapshot.
You need to stop the server first, and then create a snapshot
Image.png
Image.png
Next time, if you want to restore the last record, just roll back.
Now I can reinstall the system at ease.
Image.png
After the operation of the above steps: you can refer to the public image address. I'll give you a general explanation here.
First run more readme.txt, which shows the password entry instructions for the initial mysql: mysqladmin-u root-h 127.0.0.1-p password, then enter the initial password, and then enter the new password 1, mysql-u root-p2, use mysql;3, update user set host='%' where user='root'; 4, flush privileges Test web performance http:// the ip address of your server: 8080 tomcat installation directory is: / home/tomcat webapp Please deploy to the following directory / home/tomcat/apache-tomcat-default/webapps tomcat port runs on port 8080 by default, which can be modified according to the actual situation.
After reading the above, do you have any further understanding of how to deploy the java project in linux? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.