Mac terminal Tomcat environment configuration process

Tomcat is a core project of the Apache Software Foundation (Apache Software Foundation) in Jakarta project by the Apache, Sun and other companies and individuals to develop from. Tomcat server is a free open source Web application server, are lightweight application server, it is not widely used in many occasions small and medium systems and concurrent user access is the preferred development and debugging JSP program. We must first of its profits. The tomcat configuration environment to configure the selected version is 9.0.30, other versions are made.

Download the official website: http://tomcat.apache.org/

    解压:
    tar -zxv -f apache-tomcat-9.0.30.tar.gz 
    mv apache-tomcat-9.0.30 /usr/local    该路径为安装tomcat路径,没有强制要求,方便即可。

    环境变量配置
    vim /etc/profile
    export CATALINA_HOME=/usr/local/apache-tomcat-9.0.30    安装路径
    source /etc/profile    使profile文件无须重启终端而立即生效

    字符集配置
    pwd = /usr/local/apache-tomcat-9.0.30
    cd conf
    vim server.xml    编辑文件中69~71行左右
    类似:
    69  <Connector port="8080" protocol="HTTP/1.1"
    70  connectionTimeout="20000"
    71  redirectPort="8443" />”    在其末为添加URIEncoding="UTF-8”
    即:
    69  <Connector port="8080" protocol="HTTP/1.1"
    70  connectionTimeout="20000"
    71  redirectPort="8443" URIEncoding="UTF-8” />    该部分内容中的port等内容可根据自己喜好定义

    启动tomcat
    pwd = /usr/local/apache-tomcat-9.0.30
    cd  bin
    ./startup.sh    执行启动脚本,成功启动内容大致如下(如需关闭tomcat, 在bin文件目录下执行./shutdown.sh即可):
    "Using CATALINA_BASE:   /usr/local/apache-tomcat-9.0.30
     Using CATALINA_HOME:   /usr/local/apache-tomcat-9.0.30
     Using CATALINA_TMPDIR: /usr/local/apache-tomcat-9.0.30/temp
     Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
     Using CLASSPATH:       /usr/local/apache-tomcat-9.0.30/bin/bootstrap.jar:/usr/local/apache-tomcat-9.0.30/bin/tomcat-juli.jar
     Tomcat started."

    环境配置验证
    浏览器搜索:localhost:8080    如图即为成功完成了tomcat的环境配置,这样简单的server环境已搭建完毕。

Guess you like

Origin www.cnblogs.com/Clancy0779/p/12150998.html