云服务器部署静态网站

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 &quot;%r&quot; %s %b" resolveHosts="false"/>
        <Context path="" docBase="portal/"  reloadable="true" crossContext="true"/>
      </Host>
    </Engine>
这样就能通过http://www.xxx.com访问到我的portal项目首页了

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值