#安装JDK
1. Check if the system installs the JDK and uninstall
Rpm-qa | grep javatzdata-java-2013g-1.el6.noarchjava-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_ 64java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
2. Delete Package
Rpm-e--nodeps tzdata-java-2013g-1.el6.noarchrpm-e--nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64rpm-e-- Nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64
3. Copy the Jdk-6u35-linux-x64.bin to the/usr/local/java directory (mkdir Java)
chmod +x Jdk-6u35-linux-x64.bin./jdk-6u35-linux-x64.bin
4. Configure Environment variables
Vi/etc/profile
Java_home=/usr/local/java/jdk1.6.0_35jre_home=/usr/local/java/jdk1.6.0_35/jrepath= $PATH: $JAVA _home/bin: $JRE _ Home/binclasspath=.: $JAVA _home/lib/jt.jar: $JAVA _home/lib/tools.jar: $JRE _home/libexport java_home JRE_HOME PATH CLASSPATH
#:wq
5. Load Environment variables
Source/etc/profile
6. Test whether the installation is successful
Java-versionjava version "1.6.0_35" Java (tm) SE Runtime Environment (build 1.6.0_35-B10) Java HotSpot (tm) 64-bit Server VM (Build 20.10-b01, Mixed mode)
#安装成功.
#安装tomcat
7. Copy apache-tomcat-6.0.35 to/usr/local/tomcat/(mkdir Tomcat)
8. Decompression
Tar zxvf apache-tomcat-6.0.35.tar.gz
9. Installing Tomcat into a system service
Cd/etc/init.dvi Tomcat #!/bin/bash # description:tomcat Start Stop Restart # processname:tomcat # chkconfig:234 20 JAVA_HOME=/USR/LOCAL/JAVA/JDK1.6.0_35 export Java_home path= $JAVA _home/bin: $PATH export PATH Catalina_home=/usr/lo cal/tomcat/apache-tomcat-6.0.35 case $ in start) SH $CATALINA _home/bin/startup.sh;; Stop) SH $CATALINA _home/bin/shutdown.sh;; Restart) SH $CATALINA _home/bin/shutdown.sh sh $CATALINA _home/bin/startup.sh;; ESAC Exit 0
#:wq
To add Tomcat to system services
chmod 755 Tomcat chkconfig--add Tomcat chkconfig--level 2345 Tomcat Onchkconfig--list Tomcat
10. The test is successful
service tomcat startusing catalina_base: /usr/local/tomcat/ Apache-tomcat-6.0.35using catalina_home: /usr/local/tomcat/apache-tomcat-6.0.35using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.35/tempUsing JRE_HOME: /usr/local/java/jdk1.6.0_35Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.35/bin/bootstrap.jarservice tomcat restart Using catalina_base: /usr/local/tomcat/apache-tomcat-6.0.35using catalina_home: /usr/local/tomcat/apache-tomcat-6.0.35using catalina_tmpdir: /usr/local/tomcat/ apache-tomcat-6.0.35/tempusing jre_home: /usr/local/java/ jdk1.6.0_35using classpath: /usr/local/tomcat/ Apache-tomcat-6.0.35/bin/bootstrap.jarusing catalina_base: /usr/local/tomcat/apache-tomcat-6.0.35using catalina_home: /usr/ local/tomcat/apache-tomcat-6.0.35using catalina_tmpdir: /usr/local/tomcat/apache-tomcat-6.0.35/ tempusing jre_home: /usr/local/java/jdk1.6.0_35using classpath: /usr/local/tomcat/apache-tomcat-6.0.35/bin/ bootstrap.jarservice tomcat stopusing catalina_base: /usr/local/tomcat/ Apache-tomcat-6.0.35using catalina_home: /usr/local/tomcat/apache-tomcat-6.0.35using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.35/tempUsing JRE_HOME: /usr/local/java/jdk1.6.0_35Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.35/bin/bootstrap.jarservice tomcat startusing catalina_base: /usr/local/tomcat/apache-tomcat-6.0.35using catalina_home: /usr/local/tomcat/ Apache-tomcat-6.0.35using catalina_tmpdir: /usr/local/tomcat/apache-tomcat-6.0.35/tempusing jre _home: /usr/local/java/jdk1.6.0_35using classpath: /usr/local/tomcat/apache-tomcat-6.0.35/bin/bootstrap.jar
#安装成功
#安装MYSQL
11, install the cmake required to rely on the package
Yum-y Install GCC Libxml2-dev Curl screen libpng12-dev autoconf libpcre3-dev make bzip2 libevent-dev patch Libjpeg62-dev Libcurl4-openssl-dev libfreetype6-dev g++ libtool libncurses5-dev psmisc lrzsz gcc-c++ ncurses-devel
12, copy to the server related directory
Tar zxvf cmake-2.8.5.tar.gzcd cmake-2.8.5./boostarp#./configuremake# time a little long make Installcmake-version#cmake version 2.8.5
13. Permanently add cmake to the system environment variable
Vi/etc/profilepath=/usr/local/cmake-2.8.10.2/bin: $PATHexport PATH
#:wqsource/etc/profile #立即生效
14. Create MySQL installation directory machine database storage directory
Mkdir-p/usr/local/mysqlmkdir-p/usr/local/mysql/data
15. Create MySQL users and user groups
Groupadd mysqluseradd-r-G MySQL MySQL
16. Compile and install MySQL
Tar zxvf mysql-5.5.17.tar.gzcd mysql-5.5.17cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_unix_addr=/usr/ Local/mysql/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dwith_myisam_storage_engine=1- Dwith_innobase_storage_engine=1-dwith_memory_storage_engine=1-dwith_readline=1-denabled_local_infile=1-dmysql_ datadir=/usr/local/mysql/data-dmysql_user=mysql-dmysql_tcp_port=3306
Make && make install
17. Check whether the installation is successful
cd /usr/local/mysql ll total 76 drwxr-xr-x. 2 mysql mysql 4096 dec 4 00:03 bin-rw-r--r--. 1 mysql mysql 17987 oct 12 2011 copyingdrwxr-xr-x. 5 mysql mysql 4096 dec 4 00:18 datadrwxr-xr-x. 2 mysql mysql 4096 dec 4 00:03 docsdrwxr-xr-x. 3 mysql mysql 4096 dec 4 00:03 include-rw-r--r--. 1 mysql mysql 7604 Oct 12 2011 INSTALL-BINARYdrwxr-xr-x. 3 mysql mysql 4096 Dec 4 00:03 libdrwxr-xr-x. 4 mysql mysql 4096 dec 3 23:24 mansrwxrwxrwx. 1 mysql mysql 0 dec &nbSp;4 00:18 mysql.sockdrwxr-xr-x. 10 mysql mysql 4096 dec 3 23:24 mysql-test-rw-r--r--. 1 mysql mysql 2552 oct 12 2011 READMEdrwxr-xr-x. 2 mysql mysql 4096 Dec 3 23:24 scriptsdrwxr-xr-x. 27 mysql mysql 4096 dec 3 23:24 sharedrwxr-xr-x. 4 mysql mysql 4096 dec 4 00:03 sql-benchdrwxr-xr-x. 2 mysql mysql 4096 dec 4 00:03 support-files
#安装成功
18. Set MySQL directory permissions
Cd/usr/local/mysql
#把当前目录中所有文件的所有者设为root, the owning group is MySQL
Chown-r root:mysql. Chown-r mysql:mysql Data
19. Add the MySQL startup service to the system service
CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF
CP: Do you want to overwrite "/etc/my.cnf"? Y
20. Create a table for the database
cd/usr/local/mysqlscripts/mysql_install_db--user=mysql
21. Setting Environment variables
vi/root/.bash_profile# in modifying path= $PATH: $HOME/bin: path= $PATH: $HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/ Libsource/root/.bash_profile #使刚才的修改生效
22. Manually start MySQL
./bin/mysqld_safe--user=mysql & #启动MySQL, but can not stop mysqladmin-u root-p shutdown #此时root还没密码, so the null value, prompt for password, enter directly.
23. Add the MySQL startup service to the system service
CP Support-files/mysql.server/etc/init.d/mysql
24. Start MySQL
Service MySQL start starting mysql ... error! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).
#启动失败, Modify Permissions
Chown-r Mysql:mysql/usr/local/mysql
#再次启动
/etc/init.d/mysql start
25. Modify the root password of MySQL and open remote connection
Mysql-u root mysqlmysql> use MySQL; mysql> desc User; Mysql> GRANT All privileges on * * to [email protected] '% ' identified by ' root '; The ability to add remote connections for root mysql> update user Set Password = Password (' chinaums ') where user= ' root '; Set root user password mysql> select Host,user,password from User where user= ' root '; mysql> flush Privileges; Mysql> exit
26. Re-Login
Mysql-u root-p
#若还不能进行远程连接, turn off the firewall
27, Configuration InnoDB
Vi/etc/my.cnf
#添加以下内容
# to take the best advantage of the current InnoDB featuresinnodb_file_per_table=1innodb_file_format=barracudainnodb_strict_ Mode=1
#官方推荐
28. Restart MySQL
/usr/local/mysql/support-files/mysql.server Stop/etc/init.d/mysql Start
This article from the "Down-to-earth, pragmatic" blog, please be sure to keep this source http://3633188.blog.51cto.com/3623188/1591437
Centos 6.5 Installation JDK + Tomcat-apache + Mysql Notebooks