问题1:
Tomcat运行启动正常提示,但在url器中无法正常访问,更换端口后,依旧不能访问,执行shutdown.sh 系统报错
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
百度后,知道tomcat和jdk版本不匹配导致报错,虚机装的jdk版本是1.7的,之前报错版本tomcat版本是9的,从新下载tomcat8,修改端口号,就能正常访问了。
端口号的修改方法:
在/opt/apache-tomcat-8.5.4/conf 目录下用vi打开server.xml
修改
redirectPort="8443" />
修改端口号为8081
----------------------------------------------------------------------------------------------------------------------------------------
安装tomcat过程:
1.官网下载
2.命令解压:tar -zvxf apache-tomcat-8.5.4.tar.gz
3. 拷贝到 /opt下
4.配置环境变量 /etc/profile TOMCAT_HOME =/opt/apache-tomcat-8.5.4
5.启动tomcat /opt/apache-tomcat-8.5.4/bin sh startup.sh
6. 停止tomcat sh shutdown.sh
----------------------------------------------------------------------------------------------------------------------------------------
maven 安装过程:
1.官网下载
2.命令解压: tar -zvxf apache-maven-3.0.4-bin.tar.gz
3. 拷贝maven文件 cp -r apache-maven-3.0.4 /usr/maven
4.修改配置文件 vi /etc/profile
M2_HOME=/usr/maven
PATH=$PATH:$M2_HOME/bin
export M2_HOME PATH
5.变量生效 #source /etc/profile 或注销重新登录
6. 检查maven 是否安装成功
----------------------------------------------------------------------------------------------------------------------------------
jenkins 安装:
1.官网下载
2.拷贝jenkins.war 到 /opt/apache-tomcat-8.5.4/webapps
3.修改配置文件 vi /etc/profile export JENKINS_HOME=/opt/apache-tomcat-8.5.4/webapps/jenkins
4.配置文件生效 source /etc/profile
5.验证jenkins ,在url中输入url http://localhost:8081/jenkins/ (默认端口是8080、修改tomcat配置文件server.xml 文件中端口号)
6.页面提示:
Unlock Jenkins
To ensure Jenkins is securely set up by the administrator, a password has been written to the log (not sure where to find it?) and this file on the server:
/root/.jenkins/secrets/initialAdminPassword
Please copy the password from either location and paste it below.
提示输入密码:密码位置在 jenkins安装虚机中root目录下输入vi .jenkins/secrets/initialAdminPassword
拷贝文件中的密码,填写在url中,下面界面提示是否添加插件,暂时不添加,可以选择跳过,安装验证完成,开启jenkins的学习。
km min123