1、安装安装java和tomcat
下载对应的linux版本的java和tomcat版本,解压对应文件:tar -zxvf filename
2、云服务器配置
- 申请好的云服务器域名进行解析
- 必填项:域名是你申请的域名;主机记录是你申请的云服务器IP
- 在使用之前必须先通过实名认证,否则域名无法识别,最后测试域名是否和IP绑定成功
3、linux主机配置
添加对应的主机映射
添加一行记录:127.0.0.1 www.xxx.com(你的域名)
4、linux tomcat 配置
修改tomcat/conf/server.xml文件,红色为修改的地方
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
<Engine name="Catalina" defaultHost="www.xxx.com">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="www.xxx.com" appBase="webapps"
unpackWARs="true" autoDeploy="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="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" resolveHosts="false"/>
<Context path="" docBase="portal/" reloadable="true" crossContext="true"/>
</Host>
</Engine>
这样就能通过http://www.xxx.com访问到我的portal项目首页了