标签:col style tar 解压 ntp ted color inf alt
第一个历程:获取tar包
官网地址:
1 http://tomcat.apache.org/
我是使用浏览器下载的tar包,再传输到linux中去的(lrzsz)
第二个历程:解压并移动安装包到/usr/local/tomcat 目录下
tar zxvf apache-tomcat-8.0.53.tar.gz
(自己创建tomcat8的目录)
mv apache-tomcat-8.0.53 /usr/local/tomcat8
(将数据包放到这个目录的好处就是不需要再修改环境变量)
[root@ntp bin]# pwd
/usr/local/tomcat8/bin
启动tomcat服务
[root@ntp bin]# pwd /usr/local/tomcat8/bin [root@ntp bin]# ls bootstrap.jar configtest.sh startup.sh catalina.bat daemon.sh tomcat-juli.jar catalina.sh digest.bat tomcat-native.tar.gz catalina-tasks.xml digest.sh tool-wrapper.bat ciphers.bat setclasspath.bat tool-wrapper.sh ciphers.sh setclasspath.sh version.bat commons-daemon.jar shutdown.bat version.sh commons-daemon-native.tar.gz shutdown.sh configtest.bat startup.bat [root@ntp bin]# ./startup.sh Using CATALINA_BASE: /usr/local/tomcat8 Using CATALINA_HOME: /usr/local/tomcat8 Using CATALINA_TMPDIR: /usr/local/tomcat8/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/local/tomcat8/bin/bootstrap.jar:/usr/local/tomcat8/bin/tomcat-juli.jar Tomcat started.
访问测试:(默认端口是8080)
停止tomcat服务
/usr/local/tomcat8/bin/shutdown.sh
放置页面的目录是在/usr/local/tomcat8/webapps
[root@ntp webapps]# pwd /usr/local/tomcat8/webapps [root@ntp webapps]# ll total 4 drwxr-x--- 16 root root 4096 Mar 16 19:04 docs drwxr-x--- 6 root root 83 Mar 16 19:04 examples drwxr-xr-x 2 root root 24 Mar 16 19:10 hello drwxr-x--- 5 root root 87 Mar 16 19:04 host-manager drwxr-x--- 5 root root 103 Mar 16 19:04 manager drwxr-x--- 3 root root 283 Mar 16 19:04 ROOT [root@ntp webapps]#
可以选择新建一个目录,不需要修改该目录属主属组(和nginx不一样)
比如:我在这里创建的一个hello目录
[root@ntp webapps]# cat hello/index.html <html> <body> <h1>Hello,Liushiya!</h1> </body> </html> You have new mail in /var/spool/mail/root [root@ntp webapps]#
访问测试:
标签:col style tar 解压 ntp ted color inf alt
原文地址:https://www.cnblogs.com/liushiya/p/12534275.html