安装步骤

<section class="section" id="Installation_Steps__section_ldh_3fx_svb"><h2 class="doc-tairway">步骤一:设置ECS的安全组规则</h2> <ol class="ol" id="Installation_Steps__ol_r5m_jfx_svb"> <li class="li"> 登录<a class="xref" href="https://www.ocftcloud.com/console/ecs/overview" target="_blank" rel="external noopener">云服务器ECS控制台</a>。 </li> <li class="li"> 单击左侧导航栏<span class="ph menucascade"><span class="ph uicontrol">网络</span><abbr> > </abbr><span class="ph uicontrol">安全组</span></span>,进入<span class="ph uicontrol">安全组</span>页面。 </li> <li class="li"> 选择目标地域,单击目标安全组名称。 </li> <li class="li"> 进入<span class="ph uicontrol">实例</span>页面,切换到<span class="ph uicontrol">安全组规则</span>页面。 </li> <li class="li"> 单击右上角<span class="ph uicontrol">创建</span>,进入<span class="ph uicontrol">创建安全组规则</span>页面。 <ol class="ol" type="a" id="Installation_Steps__ol_cwr_1yh_2sb"> <li class="li">添加入方向的ICMP安全组规则<div class="p"> <img class="image" id="Installation_Steps__image_xkr_mkj_2sb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20232006152128-1b2fab649d14.png"> </div></li> <li class="li">添加web项目分配端口的访问规则,以8080 端口为例。<div class="p"> <img class="image" id="Installation_Steps__image_pwk_nkj_2sb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20232006152128-1a01bdc491d2.png"> </div></li> </ol> </li> </ol> </section> <section class="section" id="Installation_Steps__section_b1x_jfx_svb"><h2 class="doc-tairway">步骤二:安装jdk</h2> <ol class="ol" id="Installation_Steps__ol_jsn_kfx_svb"> <li class="li"> 新建一个目录,执行如下命令: <div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_lyb_pj3_gtb"><code>mkdir /usr/loca</code></pre> </div> </li> <li class="li"> 解压jdk-12.0.1_linux-x64_bin.tar.gz到/usr/local。 <div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_jyk_pj3_gtb"><code>chmod +x jdk-12.0.1_linux-x64_bin.tar.gz</code></pre> </div><div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_kgp_pj3_gtb"><code>tar xzf jdk-12.0.1_linux-x64_bin.tar.gz –C /usr/local</code></pre> </div> </li> <li class="li"> 配置环境变量。 <ol class="ol" type="a" id="Installation_Steps__ol_ptc_gyh_2sb"> <li class="li">打开/etc/profile:vi /etc/profile。</li> <li class="li">进入编辑模式:按下i键。</li> <li class="li">在/etc/profile 文件中添加以下信息:<div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_lhx_pj3_gtb"><code># set java environment</code></pre> </div><div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_x2b_qj3_gtb"><code>export JAVA_HOME=/usr/local /jdk12.0.1</code></pre> </div><div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_i2g_qj3_gtb"><code>export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib</code></pre> </div><div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_p5n_qj3_gtb"><code>export PATH=$JAVA_HOME/bin:$PATH</code></pre> </div></li> <li class="li">按下Esc键退出编辑模式。</li> <li class="li">执行如下命令,保存并关闭文件:<div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_obt_qj3_gtb"><code>:wq</code></pre> </div></li> </ol> </li> <li class="li"> 执行以下命令使/etc/profile里的配置生效: <div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_cl5_rj3_gtb"><code>source /etc/profile</code></pre> </div> </li> <li class="li"> 运行<code class="ph codeph">java -version</code>命令,会显示JDK版本信息,表示 JDK 已经安装成功。 </li> </ol> </section> <section class="section" id="Installation_Steps__section_xpr_lfx_svb"><h2 class="doc-tairway">步骤三:安装tomcat</h2> <ol class="ol" id="Installation_Steps__ol_pcl_nfx_svb"> <li class="li"> 双击打开Putty,连接云服务器ECS实例。 </li> <li class="li"> 解压tomcat安装包到tomcat目录下。 <div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_q53_tj3_gtb"><code>tar -xvf apache-tomcat-8.5.41.tar.gz -C /usr/ local/tomcat/</code></pre> </div><div class="note note note_note" id="Installation_Steps__note_qcl_nfx_svb"><span class="note__title">说明:</span> 可将apache-tomcat-8.5.41.tar.gz替换成您实际下载的tomcat版本,否则解压无法执行。</div> </li> <li class="li"> 进入tomcat的bin目录,执行以下命令安装tomcat。 <div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_t4q_tj3_gtb"><code>cd&nbsp;/usr/local/tomcat/apache-tomcat-8.5.41/ cd bin/</code></pre> </div> </li> <li class="li"> 在tomcat中配置jdk,执行如下命令编辑setclasspath.sh 脚本。 <div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_hly_5j3_gtb"><code>vi setclasspath.sh</code></pre> </div><ol class="ol" type="a" id="Installation_Steps__ol_wkx_ryh_2sb"> <li class="li">在setclasspath.sh 脚本添加以下内容。<div class="p"> <pre class="pre codeblock" id="Installation_Steps__codeblock_ok2_vj3_gtb"><code>export JAVA_HOME=/usr/local/ jdk-12.0.1 export JRE_HOME=/usr/local/ jdk-12.0.1/jre</code></pre> </div></li> <li class="li">按<code class="ph codeph">Esc</code>键退出编辑模式,输入<code class="ph codeph">:wq</code>保存并退出编辑。</li> </ol> </li> <li class="li"> 执行以下命令启动tomcat。 <pre class="pre codeblock" id="Installation_Steps__codeblock_qp2_xj3_gtb"><code>./startup.sh</code></pre></li> </ol> </section>
以上内容是否解决了您的问题?
请补全提交信息!
联系我们

电话咨询

400-151-8800

邮件咨询

fincloud@ocft.com

在线客服

工单支持

解决云产品相关技术问题