问题一:通过连接软件连上阿里云服务器,安装配置tomcat以后,输入IP+端口号不能访问tomcat主页
解决办法:虽然在服务器上开启了端口,但是阿里云控制台的安全组里并没有放行端口,所以需要在安全组里面添加端口实现放行
1.
2.添加安全组规则
问题二:阿里云域名与tomcat配置文件
解决办法:
1.首先解析域名
2.在服务器中:
cd /opt/tomcat/apache-tomcat-8.5.34/conf/
vim server.xml
<Host name="ctyl.cloud-info.cn" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="/usr/local/tomcat/apache-tomcat-8.5.34/webapps/ctyl01" debug="0" reloadable="false" crossContext="true"/>
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="ctyl.cloud-info.cn_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
修改完毕需要关闭tomcat(有可能会报错,是内存不够,修改配置文件即可),然后再开启tomcat
3.浏览器验证