Ubuntu16.04 install jdk under a common user. For details, ubuntu16.04jdk
Note: I have installed Ubuntu16.04 with a pure version, so I have attached a non-interface graph.
Install JDK:
1. First, switch to the root user through sudo su. Under the root user, enter useradd-m-d/home/pa-s/bin/bash pa to create the user pa and set the pa User Password: passwd pa.
2. Use the FTP tool to upload the installation package to the/home/pa/software Directory. In this case, XFTP cannot be connected, but it cannot be pinged to the host.
3.SolutionXFTP connectionSolution:
(1) Check the Firewall status and sudo ufw status. If the firewall is closed, stop it again. Sudo ufw disable.
(2) open port 22. (Allow all external IP addresses to access the local port 22/tcp (ssh ). Sudo ufw allow 22.
(3) Because ubuntu does not install ssh-server by default. Therefore, you need to install the ssh service sudo apt-get install openssh-server.
(4) ps-e | grep ssh to view the structure.
(5) After installing the ssh service, restart the client and computer.
4. Continue to connect to Xftp, and a new problem occurs.
Solution: The xftp version is too low.
5. after continuing to connect to Xftp, the system found that the file could not be transferred. After querying the file, it was originally related to the permission. because I am relatively lazy, I will directly upgrade normal users to root user permissions.
Upgrade normal user permissions to root User Permissions
1. First, log on to the Super Terminal. We recommend that you install a vim Editor, that is, enter the command.
2. After the vim editor is installed, enter the command: sudo vim gedit/etc/passwd to enter the editing mode.
3. find your own user and modify the current user ID, for example, pa: x: 1001: 1001:/home/pa:/bin/bash, change 10001 to 0. for the vim Editor, click I to enter the editing mode.
4. Then Press Esc to exit the editing and press:Qw can be saved.
5. Switch to a common user.
6. logon with the pa user has become the root permission
6. Install jdk
1. First enter the directory to store the compressed package, and then use the compression. eg: Enter the command: sudo tar-zvxf jdk-7u80-linux-x64.tar.gz
2. For ease of management, move the decompressed directory to the java directory and enter the command: sudo mv/home/pa/software/jdk1.7.0 _ 80/home/pa/java
3. Set the environment variable and enter the command: sudo vim/home/pa/. bashrc for editing.
4. Add configuration information at the end of the file
5. Then Press Esc to exit the editing and press: wq to save.
6. Enter source ~ /. Use bashrc to make the file take effect. Enter java-version to view the version.
7. if the version number is displayed, the installation is successful.
Install Tomcat:
1. First, use xftp to send tomcat to the/home/pa/software directory, and then enter the command sudo tar-zvxf apache-tomcat-7.0.77.tar.gz for decompression
2. For ease of management, move the extracted file to the tomcat directory and enter the command sudo mv/home/pa/software/apache-tomcat-7.0.77/home/pa/tomcat.
3. Go to the bin directory of tomcat and enter the command: sudo vim startup. sh to add configuration information.
5. add the above configuration information at the bottom of the file. then Press Esc to exit the editing and press: wq to save. note: In the exec "$ PRGDIR"/"$ EXECUTABLE" start "$ @" line above.
6. Enter the command./startup. sh in the bin directory and start tomcat.
7. check whether tomcat is successfully started. You can use xshell to check whether tomcat is successfully started. In another window, enter the/home/pa/tomcat/logs directory and enter tail-f catalina. out to view logs
8. another authentication method can be used to test on your host machine. Enter the command ifconfig to view your ip address and add 8080. for example: 192.168.171.20.: 8080, tomcat is successful.
1.
9. After using tomcat, it is best to close tomcat and enter./shutdown. sh in the bin directory to close tomcat.
10. You can also disable tomcat by killing the process and enter the command ps-ef | gref tomcat to view the processes occupied by tomcat,
11. "1259" indicates the process occupied by tomcat, and then enter the command kill-9 1259 to completely kill the process occupied by tomcat.
Note: tomcat configuration does not need to be configured in versions earlier than 1.7. You only need to unzip the configuration.