linux tomcat安装

1.下载Tomcat

在下面的地址下载Tomcat的二进制版

    http://mirrors.ccs.neu.edu/Apache/dist/jakarta/tomcat-4/binaries/

即下载文件

    tomcat-4.1.18.tar.gz

  二、下载到本地后,进行解压

    #tar zxvf apach-tomcat-6.0.16.tar.gz
    #mv apach-tomcat-6.0.16 /usr/local

   三、进行tomcat环境的配置(前提需要安装jdk)
    #vi /etc/profile

    export JAVA_HOME=/usr/local/jdk1.6.0_04
    export TOMCAT_HOME=/usr/local/apach-tomcat-6.0.16
   
    保存退出
      
    # source /etc/profile  //让当前配置立即生效
   
    四、启动tomcat服务器
    $ /usr/local/apach-tomcat-6.0.16/bin/startup.sh
    我的电脑上会出现如下内容:
    Using CATALINA_BASE:   /usr/local/apache-tomcat-6.0.16
    Using CATALINA_HOME:   /usr/local/apache-tomcat-6.0.16
    Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.16/temp
    Using JRE_HOME:       /usr/local/jdk1.6.0_04
 

 五、在浏览器中输入http://localhost:8080/就可以看到tomcat的log了
    tomcat的安装到此结束。
 

修改conf/server.xml中的Host节点

 <Host name="jdwtest" appBase="/usr/local/web/webdata"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
        <Context path="" docBase="" debug="0" />
        <Context path="/mytest" docBase="www" debug="0" />
        <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />
      </Host>
      <Host name="localhost" appBase="/usr/local/web/webdata"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
        <Context path="" docBase="" debug="0" />
     </Host>

 

增加tomcat   admin管理用户

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="admin" password="" roles="admin,manager"/>
</tomcat-users>

你可能感兴趣的:(tomcat,linux,host,Server.xml,休闲)