Build a JAVA Runtime Environment in CentOS Linux
1. Install jdk
1. Enter the usr directory
Cd/usr
2. Create a java installation directory under the usr directory
Mkdir java
3. Copy jdk-6u24-linux-i586.bin to the java directory
Cp/home/itcast/Desktop/jdk-6u24-linux-i586.bin/usr/java/
4. Install jdk
Cd/usr/java
/Jdk-6u24-linux-i586.bin
5. After the installation is complete, create a link for him to save the directory Length
Ln-s/usr/java/jdk1.6.0 _ 24 // usr/jdk
6. Edit the configuration file
Vim/etc/profile
Add the following content:
JAVA_HOME =/usr/jdk
CLASSPATH = $ JAVA_HOME/lib/
PATH = $ PATH: $ JAVA_HOME/bin
Export PATH JAVA_HOME CLASSPATH
8. Restart the machine or source/etc/profile
Sudo shutdown-r now
9. view the installation status
Java-version
Java version "1.6.0 _ 24"
Java (TM) SE Runtime Environment (build1.6.0 _ 24-b07)
Java HotSpot (TM) Client VM (build 19.1-b02, mixed mode, sharing)
Ii. install tomcat
Tar-zxvf apache-tomcat-6.0.29.tar.gz-C/opt (unzip to/opt)
Ln-s/opt/apache-tomcat-6.0.29 // opt/tomcat (create a link file)
Start tomcat
Cd/opt/tomcat/bin/
./Startup. sh (Note: points represent the current directory)
If it cannot be started, try
-I switch to the root user and restart
./Startup. sh
Test http: // 127.0.0.1: 8080/
Iii. Uninstall and install mysql
1. uninstall mysql
Uninstall mysql in linux
Uninstall mysql
1. Check whether mysql is installed before.
Command: rpm-qa | grep-I mysql
We can see two mysql packages:
Mysql-4.1.12-3.RHEL4.1
Mysqlclient10-3.23.58-4.RHEL4.1
2. Delete mysql
DELETE command: rpm-e -- nodeps package name
(Rpm-ev mysql-4.1.12-3.RHEL4.1)
3. Delete the development header files and libraries of old mysql versions.
Command: rm-fr/usr/lib/mysql
Rm-fr/usr/include/mysql
Note: After uninstallation, data in/var/lib/mysql and/etc/my. cnf will not be deleted. If you are sure it is useless, manually delete it.
Rm-f/etc/my. cnf
Rm-fr/var/lib/mysql
2. Install mysql
(1) uninstall mysql rpm-e mysql // normal deletion mode [root @ xiaoluo ~] # Rpm-e -- nodeps mysql // strong deletion mode. If the above command is used to delete other dependent files, you can use this command to forcibly delete them.
(2): Install mysql using yum
1) yum list | grep mysql: Command to view the available mysql database versions on yum:
2) install yum install-ymysql-server mysql-deve
3) run the rpm-qimysql-server command to check the version of the newly installed mysql-server.
4) servicemysqld start: start our mysql service.
5) servicemysqld restart to restart mysql
6) chkconfig mysqld on sets mysql to start automatically upon startup
7) mysqladmin-u root password 'root': Use this command to set the password of the root account to root.
Error: 1130-host... isnot allowed to connect to this MySql server
It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to mysql on the computer of localhost, and change the "host" entry in the "user" table in the "mysql" database to "%" from "localhost"
Mysql-u root-pvmwaremysql> use mysql;
Mysql> update user set host = '%' whereuser = 'root ';
Mysql> select host, user from user;
4. Open specific linux ports
More/etc/sysconfig/iptables
# Firewall configuration written bysystem-config-firewall
# Manual customization of this file is notrecommended.
* Filter
: Input accept [0: 0]
: Forward accept [0: 0]
: Output accept [0: 0]
-A input-m state -- state ESTABLISHED, RELATED-j ACCEPT
-A input-p icmp-j ACCEPT
-A input-I lo-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 22-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 8009-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 8081-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 3690-j ACCEPT
-A input-j REJECT -- reject-with icmp-host-prohibited
-A forward-j REJECT -- reject-with icmp-host-prohibited
COMMIT
[Root @ nb home] #/etc/init. d/iptablesrestart
Iptables: clear firewall rules: [OK]
Iptables: Set the chain to policy ACCEPT: filter [OK]
Iptables: uninstalling module: [OK]
Iptables: Application Firewall Rules: [OK]