Software Installation (JDK + MySQL + TOMCAT) and jdktomcat
1. JDK Installation
1. Check whether JDK is installed in the current Linux system.
Input rpm-qa | grep java
If:
Uninstall two openjdks, and enter rpm-e -- nodeps to uninstall the software.
2. Upload JDK to Linux
3. install the required plug-in yum install glibc. i686 for jdk running (optional)
4. Decompress jdk to tar-xvf jdk-7u71-linux-i586.tar.gz-C/usr/local under/usr/local.
5. Configure jdk environment variables, open the/etc/profile configuration file, and copy the following configuration
# Set java environment
JAVA_HOME =/usr/local/jdk1.7.0 _ 71
CLASSPATH =.: $ JAVA_HOME/lib. tools. jar
PATH = $ JAVA_HOME/bin: $ PATH
Export JAVA_HOME CLASSPATH PATH
6. Reload the/etc/profile configuration file source/etc/profile.
7. verify whether the installation is successful.
Ii. Install MySQL
1. Check whether MySQL is included in CentOS.
Input rpm-qa | grep mysql
If yes: Delete the built-in MySQL
2. Upload Mysql to linux
3. Install the mysql dependency (select)
Yum-y install libaio. so.1 libgcc_s.so.1 libstdc ++. so.6
When an error occurs, add -- setopt = protected_multilib = false.
Yum update libstdc ++-4.4.7-4. el6.x86 _ 64
4. Decompress Mysql to the mysql directory under/usr/local/(the mysql directory needs to be manually created ).
Cd/usr/local
Mkdir mysql
Tar-xvf MySQL-5.6.22-1.el6.i686.rpm-bundle.tar-C/usr/local/mysql
5. Install mysql under/usr/local/mysql
Installation server: rpm-ivh MySQL-server-5.6.22-1.el6.i686.rpm
Install client: rpm-ivh MySQL-client-5.6.22-1.el6.i686.rpm
When an error occurs, add -- nodeps -- force.
6. Add mysql to the system service and set startup.
Add to System Service: chkconfig -- add mysql
Automatic Start: chkconfig mysql on
7. log on to mysql
After mysql is installed, a temporary random password is generated, which is stored in/root/. mysql_secret.
If the following error occurs during logon, libncurses. so.5 is missing
Yum install libncurses. so.5
Enter the password randomly generated by MySQL just now and log on successfully:
8. Modify the mysql password.
The following prompt is displayed:
MySQL asked you to change the initial password:
Set password = password ('20140901 ');
After changing the password, you can use it:
9. Enable mysql remote logon.
By default, mysql is secure and does not support remote logon to mysql. Therefore, you must set the permission to enable remote logon to mysql.
After logging on to mysql, enter the following command:
Grant all privileges on *. * to 'root' @ '%' identified by 'root ';
Flush privileges;
10. Open Port 3306 for external access to Linux
/Sbin/iptables-I INPUT-p tcp -- dport 3306-j ACCEPT
/Etc/rc. d/init. d/iptables save --- save the modification permanently to the firewall.
Remote connection:
3. TOMCAT installation
1. Upload Tomcat to linux
2. Decompress Tomcat to/usr/local.
3. open port 8080 for external access to Linux
/Sbin/iptables-I INPUT-p tcp -- dport 8080-j ACCEPT
/Etc/rc. d/init. d/iptables save
4. Start and close Tomcat
Start tomcat in the bin:./startup. sh
Access successful:
Go to tomcat bin to close:./shutdown. sh