Steps of installing JDK on Linux and configuring vsftp remote connection with Tomcat

It's been a year since I started working in the company. When I was free these two days, I installed a VMware virtual machine and a red hat 6.1 full command-line operating system. I wanted to build a test environment that the company is using now. Unexpectedly, I encountered many problems in the middle, but most of them have been solved. Now I can upload projects by myself, Here, record what you have learned in these two days to prevent memory loss.

At first, to download and install virtual machines, I chose VMware. Of course, you can also choose other virtual machines, such as virtual@R_969_2419 @Virtual machine is just a tool to install the operating system. Of course, VMware may be more powerful, but any tool can be used for the operation we are doing now. Then go to the Internet to download the image file of the operating system you want to install, then create a new virtual machine on the virtual machine, and install the image file under you. Here, I won't describe how to install the virtual machine and image file. If you encounter a problem, just Baidu Google. hey

After the installation, I thought about how to install JDK and Tomcat on it. However, because I am not familiar with the Linux system, I do not know how to download the software package directly on Linux. However, I think there should be corresponding commands, but I did not do so. I think I should download the corresponding tar from windows GZ package, and then upload it to Linux through FTP. After reading a lot on the Internet, you should first check whether the corresponding FTP software is installed on the current Linux system. The command is RPM - QA | grep FTP. Under normal circumstances, the Linux system will automatically bring an FTP software. You can just start it. Through the following code, you can see that the Linux operating system comes with vsftp, and the starting command is service vsftpd start, The command to view the FTP service status is service vsftpd status

According to the truth, now that the FTP service has been started, I should be able to upload files. So I used xshell4 to connect to the system, but I was told that I could not connect. I carefully reviewed the previous operation process and looked for a blog on the Internet. I found that the service used for xshell remote connection is SSH, so I started the SSH service again, Because I don't know what the xshell tool is for, it's ridiculous to make such a big joke. However, after the SSH service is started, I found that only the root user can log in remotely, and other users can't log in. Therefore, continue Baidu Google and see that I want to modify / etc / SSH / sshd_ Config. There are allowusers XXX and allowgroups XXX commands. You can add user names and groups to it. XXX users can log in remotely, but it doesn't seem to work. Now this problem hasn't been solved. Take your time. Now that we're talking about this, there are many posts on the Internet about root remote login, which is not safe. I think so, It is better for root not to log in remotely, so its corresponding method is to modify / etc / SSH / sshd_ The option in config has a permittrootlogin yes|no, which is set to no, but it can not prevent ordinary users from Su to root. This is also a problem that will be followed up later. I will add this problem to this article later.

Now the root user can log in to the Linux system remotely with xshell. Click the new file transfer icon on the menu to use the FTP command. It doesn't mean that xshell must be used, but our company uses this software, so I'll make do with it. If I don't log in remotely and upload directly with FTP, Then downloading FTP may be a little easier than what I'm doing now, but I have to try it myself, hehe

Upload the compressed packages of JDK and Tomcat downloaded by windows and suitable for Linux system, and then decompress them to the appropriate directory. The command is tar - zxvf JDK XXX XX. After decompressing, configure the environment variables. My environment variable file is / etc / profile. Different system files will be different. Add the following lines to this file and make sure there are no errors, After the error, the error that the file cannot be found will be reported when starting Tomcat. I made such mistakes. They are all small mistakes that are not worth mentioning, which delayed the time. Hey...

Then restart Linux and try Java - version and javac - version to see if these messages appear

If you have this information, it means that the JDK installation is successful. The next step is to install Tomcat. Unzip it as above, and then configure the environment variables. Add the following:

Then we can upload our own projects to Tomcat webapps by uploading JDK before, and then start Tomcat

You can view Catalina dynamically The output of out is. The command is tail - f Catalina out

If Tomcat has been started and there are no errors, but it can not be accessed, it may be the problem of the firewall of the Linux system. At this time, Baidu and Google can be used again. I won't introduce it here

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>