標籤:tomcat work sof 關閉selinux stat oss hot repo ext
上傳軟體包
rz上傳jdk-8u181-linux-x64.tar.gz和apache-tomcat-8.5.32.tar.gz或者FileZilla Client進行sftp連結上傳
tar xzvf jdk-8u181-linux-x64.tar.gz -C /usr/local/
cd /usr/local/jdk1.8.0_181/bin[[email protected] bin]# ./java -version java version "1.8.0_181"Java(TM) SE Runtime Environment (build 1.8.0_181-b13)Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mix-ed mode)
- 配置環境變數
[[email protected] bin]# vim /etc/profileexport JAVA_HOME=/usr/local/jdk1.8.0_181export CLASSPATH=.:JAVA_HOME/libexport PATH=$PATH:$JAVA_HOME/bin
[[email protected] ~]# source /etc/profile[[email protected] ~]# java -version openjdk version "1.8.0_131"OpenJDK Runtime Environment (build 1.8.0_131-b12)OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
- 安裝Tomcat
[[email protected] software]# tar xzvf apache-tomcat-8.5.32.tar.gz[[email protected] software]# cd apache-tomcat-8.5.32/[[email protected] apache-tomcat-8.5.32]# ll總用量 92drwxr-x---. 2 root root 4096 8月 20 14:56 bindrwx------. 2 root root 238 6月 21 03:53 confdrwxr-x---. 2 root root 4096 8月 20 14:56 lib-rw-r-----. 1 root root 57092 6月 21 03:53 LICENSEdrwxr-x---. 2 root root 6 6月 21 03:50 logs-rw-r-----. 1 root root 1723 6月 21 03:53 NOTICE-rw-r-----. 1 root root 7138 6月 21 03:53 RELEASE-NOTES-rw-r-----. 1 root root 16246 6月 21 03:53 RUNNING.txtdrwxr-x---. 2 root root 30 8月 20 14:56 tempdrwxr-x---. 7 root root 81 6月 21 03:51 webappsdrwxr-x---. 2 root root 6 6月 21 03:50 work[[email protected] apache-tomcat-8.5.32]# cd bin/[[email protected] bin]# pwd/root/software/apache-tomcat-8.5.32/bin[[email protected] bin]# ./startup.sh Using CATALINA_BASE: /root/software/apache-tomcat-8.5.32Using CATALINA_HOME: /root/software/apache-tomcat-8.5.32Using CATALINA_TMPDIR: /root/software/apache-tomcat-8.5.32/tempUsing JRE_HOME: /usr/local/jdk1.8.0_181Using CLASSPATH: /root/software/apache-tomcat-8.5.32/bin/bootstrap.jar:/root/software/apache-tomcat-8.5.32/bin/tomcat-juli.jarTomcat started.
- 允許存取預設連接埠8080,關閉selinux
[[email protected] bin]# firewall-cmd --permanent --add-port=8080/tcpsuccess[[email protected] bin]# firewall-cmd --reload success[[email protected] bin]# getenforceEnforcing[[email protected] bin]# setenforce 0[[email protected] bin]# getenforce Permissive
- 安裝Mysql
[[email protected] bin]# yum repolist | grep mysql[[email protected] bin]# rpm -ivh https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm擷取https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm警告:/var/tmp/rpm-tmp.m7U7PD: 頭V3 DSA/SHA1 Signature, 金鑰識別碼 5072e1f5: NOKEY準備中... ################################# [100%]正在升級/安裝...1:mysql80-community-release-el7-1 ################################# [100%]
[[email protected] bin]# yum repolist | grep mysqlmysql-connectors-community/x86_64 MySQL Connectors Community 63mysql-tools-community/x86_64 MySQL Tools Community 69mysql80-community/x86_64 MySQL 8.0 Community Server 33
[[email protected] yum.repos.d]# pwd/etc/yum.repos.d[[email protected] yum.repos.d]# ll總用量 40-rw-r--r--. 1 root root 1503 8月 3 05:03 CentOS-Base.repo-rw-r--r--. 1 root root 1664 8月 3 05:01 CentOS-Base.repo.bak-rw-r--r--. 1 root root 1309 8月 30 2017 CentOS-CR.repo-rw-r--r--. 1 root root 649 8月 30 2017 CentOS-Debuginfo.repo-rw-r--r--. 1 root root 314 8月 30 2017 CentOS-fasttrack.repo-rw-r--r--. 1 root root 630 8月 30 2017 CentOS-Media.repo-rw-r--r--. 1 root root 1331 8月 30 2017 CentOS-Sources.repo-rw-r--r--. 1 root root 3830 8月 30 2017 CentOS-Vault.repo-rw-r--r--. 1 root root 1864 2月 22 16:49 mysql-community.repo-rw-r--r--. 1 root root 1885 2月 22 16:49 mysql-community-source.repo
[[email protected] software]# yum install mysql-community-server[[email protected] software]# yum install mysql-server[[email protected] ~]# rpm -qa | grep mysqlmysql-community-server-8.0.12-1.el7.x86_64mysql80-community-release-el7-1.noarchmysql-community-libs-8.0.12-1.el7.x86_64mysql-community-common-8.0.12-1.el7.x86_64mysql-community-libs-compat-8.0.12-1.el7.x86_64mysql-community-client-8.0.12-1.el7.x86_64[[email protected] lib]# systemctl start mysqld[[email protected] lib]# systemctl enable mysqld[[email protected] lib]# cat /var/log/mysqld.log |grep password #查看初始密碼2018-08-20T11:54:48.607318Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: +goyZ3q8w?!z[[email protected] lib]# mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 8Server version: 8.0.12Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql> show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. #提示需要先修改密碼mysql> alter user [email protected]‘localhost‘ identified by ‘[email protected]‘; #修改密碼為[email protected]Query OK, 0 rows affected (0.10 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || sys |+--------------------+4 rows in set (0.02 sec)mysql>
安裝JDK、Tomcat和Mysql(CentOS 7.4)