1.安装jdk
2.配置Java环境变量
3.部署tomcat
4.项目打成war包 放入tomcat中webapps文件夹下
5.防火墙端口放行 http://jingyan.baidu.com/article/f96699bbadafca894f3c1b7a.html
远程连接oracle的话需要注意
这么写是服务名:
jdbc:oracle:thin:@192.168.0.10:1521/eduCode2013DB
这么写是SID搜索
jdbc:oracle:thin:@192.168.0.10:1521:eduCode2013DB
项目细节问题
1.不需要数据项目名称就可以访问项目的配置方法如下:
首先到你的Tomcat下的conf文件夹下找到server.xml文件,打开后修改为:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="reportSystem" debug="0" reloadable="true"/>
上面的:reportSystem就是你在webapps下面部署的项目名称
path就是在访问的时候后面要跟上的项目路径,不写就代表不输入就可以。docBase代表要访问的项目,这个是在webapps下面的项目名
2.不需要数据端口号就可以访问项目的配置方法(并且防止乱码)如下:
找到8080端口,然后修改为80端口,最后再重启Tomcat
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8" useBodyEncodingForURI="true"
redirectPort="8443" />
3.如果装了IIS的话会占用80端口,将tomcat的端口号改为80 再启动tomcat会报错,解决方法
将IIS端口号改成别的
4.域名+ip 都能访问+默认为域名访问
<Engine name="Catalina" defaultHost="www.xzriyitong.com">(需要修改)
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<!-- 新配置一个用以域名访问 -->
<Host name="www.xzriyitong.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
<Context path="" docBase="Demo" debug="0" reloadable="true"/>
</Host>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
2.配置Java环境变量
3.部署tomcat
4.项目打成war包 放入tomcat中webapps文件夹下
5.防火墙端口放行 http://jingyan.baidu.com/article/f96699bbadafca894f3c1b7a.html
远程连接oracle的话需要注意
这么写是服务名:
jdbc:oracle:thin:@192.168.0.10:1521/eduCode2013DB
这么写是SID搜索
jdbc:oracle:thin:@192.168.0.10:1521:eduCode2013DB
项目细节问题
1.不需要数据项目名称就可以访问项目的配置方法如下:
首先到你的Tomcat下的conf文件夹下找到server.xml文件,打开后修改为:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="reportSystem" debug="0" reloadable="true"/>
上面的:reportSystem就是你在webapps下面部署的项目名称
path就是在访问的时候后面要跟上的项目路径,不写就代表不输入就可以。docBase代表要访问的项目,这个是在webapps下面的项目名
2.不需要数据端口号就可以访问项目的配置方法(并且防止乱码)如下:
找到8080端口,然后修改为80端口,最后再重启Tomcat
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
URIEncoding="UTF-8" useBodyEncodingForURI="true"
redirectPort="8443" />
3.如果装了IIS的话会占用80端口,将tomcat的端口号改为80 再启动tomcat会报错,解决方法
将IIS端口号改成别的
4.域名+ip 都能访问+默认为域名访问
<Engine name="Catalina" defaultHost="www.xzriyitong.com">(需要修改)
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<!-- 新配置一个用以域名访问 -->
<Host name="www.xzriyitong.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
<Context path="" docBase="Demo" debug="0" reloadable="true"/>
</Host>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>