标签:IV dir /etc 启动 info 字符 权限 test profile
1. 下载tomcat 7
2. 解压缩
注意:是否使用sudo 权限执行请根据具体环境来决定
3. sudo vim /etc/profile
在最下方增加
export CATALINA_HOME=/developer/apache-tomcat-7.0.73
4. source /etc/profile
5. 配置UTF-8字符集
进入tomcat 安装的conf文件夹,编辑server.xml
例如: ${CATALINA_HOME}/conf/server.xml
cd /developer/apache-tomcat-7.0.73/conf sudo vi server.xml
找到配置8080默认端口的位置,在XML 节点末尾增加URIEncoding="UTF-8"
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
6. Tomcat 验证
进入系统解压缩的tomcat目录
进入bin目录
执行./startup.sh
Using CATALINA_BASE: /developer/apache-tomcat-7.0.73 Using CATALINA_HOME: /developer/apache-tomcat-7.0.73 Using CATALINA_TMPDIR: /developer/apache-tomcat-7.0.73/temp Using JRE_HOME: /usr/java/latest Using CLASSPATH: /developer/apache-tomcat-7.0.73/bin/bootstrap.jar:/developer/apache-tomcat-7.0.73/bin/tomcat-juli.jar Tomcat started.
启动成功
打开启动tomcat 机器的IP地址默认端口,本机访问http://localhost:8080 , 由于本人安装tomcat在虚拟机,因此宿主机访问虚拟机的tomcat:http://172.31.8.112:8080
7.Tomcat 学习建议
http://www.imooc.com/learn/166
标签:IV dir /etc 启动 info 字符 权限 test profile
原文地址:https://www.cnblogs.com/likevin/p/8988134.html