全yum安装,Nginx,Tomcat7 with apr 在CentOS/Scientific Linux X86_64 6.x上
时间:2017-04-20 02:18 来源:linux.it.net.cn 作者:IT
其实最重要的就是yum源吗。初始源的里面既没有nginx也没有tomcat7。
1,搞定nginx,她家自己有源的:
-
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
-
yum -y install nginx
2,搞定OpenJDK,这里我用1.7.0
点击(此处)折叠或打开
-
yum -y install java-1.7.0-openjdk
3,搞定tomcat,这个要靠jpackage的源,tomcat-native还需要epel的源
-
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
-
yum -y install yum-priorities #这个是jpackage依赖的包要先装
-
rpm -Uvh http://mirrors.dotsrc.org/jpackage/6.0/generic/free/RPMS/jpackage-release-6-3.jpp6.noarch.rpm
-
yum -y install tomcat7 tomcat7-webapps tomcat7-admin-webapps tomcat-native
注意了,其中有一个tomcat7-lib-7.0.34-3.jpp6.noarch.rpm 似乎只有哈佛大学有源,速度时快时慢有时候会断,这个时候用向上键重新运行yum命令,也许要数次,它会断点续传的最终会传完并安装。
万恶的EPEL源一定是公务猿管理的,总是断源no more mirror!
启用tomcat-pool
我的server.xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
type="org.apache.catalina.UserDatabase"
-
description="User database that can be updated and saved"
-
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
-
pathname="conf/tomcat-users.xml" />
-
-
-
-
-
-
-
-
maxThreads="2000" minSpareThreads="100"/>
-
-
-
-
-
-
-
port="8080" protocol="org.apache.coyote.http11.Http11AprProtocol"
-
connectionTimeout="20000"
-
redirectPort="8443" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
resourceName="UserDatabase"/>
-
-
-
-
unpackWARs="true" autoDeploy="true">
-
-
-
-
-
-
-
prefix="localhost_access_log." suffix=".txt"
-
pattern="%h %l %u %t "%r" %s %b" />
-
-
-
-
-
蓝色字体是我启用的,还没有优化。
应用里面的DataAccessContext.xml
-
-
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xmlns:jee="http://www.springframework.org/schema/jee"
-
xsi:schemaLocation="
-
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
-
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">
-
-
-
-
java:comp/env/jdbc/orcl #应用里面定义好自己数据源的名字
-
-
-
-
-
-
-
-
-
-
WEB-INF/web.xml
-
-
-
-
-
-
-
-
auth="Container"
-
type="javax.sql.DataSource"
-
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
-
testWhileIdle="false"
-
testOnBorrow="false"
-
testOnReturn="false"
-
validationQuery="SELECT 1"
-
validationInterval="30000"
-
timeBetweenEvictionRunsMillis="30000"
-
maxActive="500"
-
minIdle="50"
-
maxWait="10000"
-
initialSize="50"
-
removeAbandonedTimeout="60"
-
removeAbandoned="true"
-
logAbandoned="true"
-
minEvictableIdleTimeMillis="30000"
-
jmxEnabled="true"
-
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
-
org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
-
username="orcl_user"
-
password="password"
-
driverClassName="oracle.jdbc.driver.OracleDriver"
-
url="jdbc:oracle:thin:@192.168.100.200:1521:orcl"/>
-
这样装出来的Tomcat7有service,启停 service tomcat7 start/stop/restart
如果想给JVM增加内存,可以自行配置JAVA_OPTS
看/etc/tomcat7/tomcat7.conf,请自行理解里面的东东啦!
(责任编辑:IT)
其实最重要的就是yum源吗。初始源的里面既没有nginx也没有tomcat7。 1,搞定nginx,她家自己有源的:
点击(此处)折叠或打开
万恶的EPEL源一定是公务猿管理的,总是断源no more mirror! 启用tomcat-pool 我的server.xml
应用里面的DataAccessContext.xml
这样装出来的Tomcat7有service,启停 service tomcat7 start/stop/restart 如果想给JVM增加内存,可以自行配置JAVA_OPTS 看/etc/tomcat7/tomcat7.conf,请自行理解里面的东东啦! (责任编辑:IT) |