If you use the 163 image source and then use sudo apt-get install mysql-server, you cannot install other dependent packages automatically. The solution is to change the source to another one, I will return to the default ubuntu source here. Then enter sudo apt-get install mysql-server. ubuntu will automatically download and install all the packages for you.
Go to mysql:
1) $ mysql-uroot-p123456 (-u user name and-p password)
2) $ mysql-uroot-p123456 mysql directly enters the mysql database
After successful entry:
1) view the database: $ show databases;
2) view the table: $ show tables;
3) use tables: use mysql;
4) import the SQL file to mysql:
Mysql-uroot-p123456 fws </opt/create_DDL. SQL
Install jdk:
1. Download jdk(jdk-7-linux-i586.tar.gz), unzip $ tar-zxvf jdk-7-linux-i586.tar.gz
2) Move the decompressed folder to the specified directory $ mv jdk1.7.0/usr/soft/
3) set environment variables:
$ Vi ~ /. Bashrc
Add:
Export JAVA_HOME =/usr/soft/jdk1.7.0
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH
Save and exit: source ~ /. Bashrc
4) test: java-version
Install tomcat
1)download atat(apache-tomcat-7.0.22.tar.gz) unzip $ tar-zxvf apache-tomcat-7.0.22.tar.gz;
2) Move the decompressed folder to the specified directory $ mv apache-tomcat-7.0.22/usr/soft/
3) environment variables. If jdk is correctly installed, you do not need to set them.
Tomcat security:
1) shutdown Port:
The Tomcat server. xml file contains the following sentence:
<Server port = "8005" shutdown = "SHUTDOWN"> it indicates that we disable tomcat using port 8005, you can use the firewall to set 8005 to access only from a specified machine or change the shutdown parameter value to another value.
2) default error page:
The default error page protects some sensitive information. To prevent attacks, we need to hide this information. Open the/web. xml folder and add the following content after </welcome-file-list> at the end of the file:
<Error-page>
<Exception-type> java. lang. Throwable </exception-type>
<Location>/error. jsp </location>
</Error-page>
3) Delete the webapps sample file: delete project files such as ROOT.
From Java, go's