web server and tomcat
Server Category:
hardware servers and software server
web server:
provide resources for others to access the
web:
web pages mean resources.
Web resource classification:
dynamic web resources: the content is likely to change the
static web resources: the content is static (. almost invisible)
web development techniques:
dynamic web development technologies: servlet jsp php .net
static web development technologies: html css ....
What javaweb
pages written by java language called javaweb
web communication mechanism:
based on a request-response mechanism
once again in response to the request, responsive to the request prior
Common web server:
server name Manufacturer Features
weblogic oracle support javaee large fee for all standardized server
server webspere IBM large-scale support of all charges javaee specifications
tomcat free support small and medium servlet and jsp specifications apache server organization
tomcat:
Frequently Asked Questions (configuration):
1 . Start time flashed correctly configured: JAVA_HOME
2 . port conflict
modify the port number of tomcat.
Open tomcat / conf / server.xml
probably have about 70 lines of code as follows:
<Connector = port "8080" = Protocol "the HTTP / 1.1"
connectionTimeout = "20000"
the redirectPort = "8443" />
modify the value of the latter can be a port NOTE: 1024 left by the port number of systems
port 80 is left http protocol used. we can use this port number
3 . issues that may arise (configuration CATALINA_HOME environment variables)
deleted
tomcat目录结构:(了解)
bin:存放的可执行程序
conf:配置文件
lib:存放的是tomcat和项目运行时需要的jar包
logs:日志 注意:catalina
temp:临时文件
★★webapps:存放项目的目录
★work:存放jsp文件在运行时产生的java和class文件
web项目的目录结构:★★★
myweb(项目名称) web2.5版本标准的目录结构
|
|---- html css js image等目录或者文件
|
|---- WEB-INF(特点:通过浏览器直接访问不到 目录)
| |
| |--- lib(项目的第三方jar包)
| |--- classes(存放的是我们自定义的java文件生成的.class文件)
| |--- web.xml(当前项目的核心配置文件)
| |
常用的项目发布方式:(虚拟目录映射) ★方式1:将项目放到tomcat/webapps下
(了解)方式2:修改 tomcat/conf/server.xml 大概130行: 在host标签下 添加如下代码 <Context path="/项目名" docBase="项目的磁盘目录"/> 例如: <Context path="/my" docBase="G:\myweb"/>
(了解)方式3: 在tomcat/conf/引擎目录/主机目录下 新建一个xml文件 文件的名称就是项目名 文件的内容如下: <Context docBase="G:\myweb"/>