'WAS/Tomcat'에 해당되는 글 11건

[Tomcat] 7.Host

WAS/Tomcat 2016. 4. 25. 18:20
donaricano-btn

Host


1. Composition

1_1. server.xml

<Engine name="Catalina" defaultHost="localhost">

 <Host name="localhost"  appBase="webapps"

            unpackWARs="true" autoDeploy="true">

1_2. Add a host

<Host name="myhost"  appBase="webapps2"

            unpackWARs="true" autoDeploy="true">


2. Characteristic

2_1. The application will be called by each address

        

        
 

 [source:https://www.youtube.com/channel/UCSDurTMDxYJT1qVL4ERelKg]


3. Example

3_1. server.xml


3_2. To set up a hosts

a. Case of Window

- c:\windows\System32\drivers\etc\hosts


b. Case of Linux

- etc/hosts


3_3. Application's location

3_4. Execution

- http://www.myserver.com:8080

- http://mail.myserver.com:8080


4. Host manager

4_1. config

<role rolename="admin-gui"/>
<user username="tomcat" password="s3cret" roles="admin-gui"/>






        




        




          




'WAS > Tomcat' 카테고리의 다른 글

[Tomcat] 2. 설치이후 환경설정  (0) 2017.08.20
[Tomcat] 1. 설치환경 및 설치  (2) 2017.08.20
[Tomcat] 6. Interwork DB  (0) 2016.04.24
[Tomcat] 5. Batch - Parallel deployment  (0) 2016.04.24
[Tomcat] 4. Batch  (0) 2016.04.22
블로그 이미지

리딩리드

,
donaricano-btn

Interwork DB


1. JDBC Connection pool

a. JVM sent a session to DB to use a SQL 

b.  And then There will be made a Connection pool between JVM and DB



2. Config Connection pool

- Context.xml

<Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"

               maxActive="50" maxIdle="30" maxWait="10000"

               username="mysqluser" password="mysqlpassword" 

               driverClassName="com.mysql.jdbc.Driver"

               url="jdbc:mysql://localhost:3306/testdb"/>


3. JDBC Driver

- We have to set up a JDBC Driver

a. setenv

#JDBC Driver Classpath

CLASSPATH=/app/lib/jdbc.jar


b. lib

CATALINA_HOME/lib/jdbc.jar


4. JNDI Look up

a. context.xml

<Resource name="jdbc/test" ..../>

b. web.xml

<resource-ref>

<res-ref-name>jdbc/text</res-ref-name>

<res-type>javax.sql.DataDource</res-type>

<res-auth>Container</res-auth>

</resouce-ref>

c. java source

ds = ctx.lookup("java:comp/env/jdbc/test")


5. Tomcat + Spring + Mybatis?


a. context.xml


b. app.propertes

c. context-datasource.xml(JNDI Config)

d. context-sqlmap.xml

e. sql-ers-map-config.xml







'WAS > Tomcat' 카테고리의 다른 글

[Tomcat] 1. 설치환경 및 설치  (2) 2017.08.20
[Tomcat] 7.Host  (0) 2016.04.25
[Tomcat] 5. Batch - Parallel deployment  (0) 2016.04.24
[Tomcat] 4. Batch  (0) 2016.04.22
[Tomcat] 3. Config  (0) 2016.04.21
블로그 이미지

리딩리드

,
donaricano-btn

Batch - Parallel deployment


1. Hot deploy vs Auto deploy

1_1 Hot deploy

- Server on 

- we can deploy our sources while server is working

- Source is in the webapps folder

- we deploy our sources by using context.xml or manager

- server.xml

- autoDelploy = true/false? 

-> If source is in a webapps, Will you deploy a souce automatically?

1_2 Auto deploy

- JSP

- CATALINA_HOME/conf/web.xml

   <servlet>

        <servlet-name>jsp</servlet-name>

        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>

        <init-param>

            <param-name>fork</param-name>

            <param-value>false</param-value>

        </init-param>

        <init-param>

            <param-name>xpoweredBy</param-name>

            <param-value>false</param-value>

        </init-param>

         <init-param>

            <param-name>development</param-name>

            <param-value>false</param-value>

        </init-param>

        <init-param>

            <param-name>checkInterval</param-name>

            <param-value>1</param-value>

        </init-param>

        <load-on-startup>3</load-on-startup>

    </servlet>

- Servlet

- context.xml

<Context reloadable = "true"/>


2. Parallel Deploy


2_1. Parallel?

-  There are two app versions

1. app ver.01 (old)

2. app ver.02 (New)

- If A user is using a old version, User can keep using it until User's session is connected

- New user will be used a app ver.02 When New user connect to the Server 


2_2. How to use

a. Naming

-  webapp##version

sample##01

sample##02

b. deploy

- by webapp

- by context.xml

- sample##01.xml

- sample##02.xml







'WAS > Tomcat' 카테고리의 다른 글

[Tomcat] 7.Host  (0) 2016.04.25
[Tomcat] 6. Interwork DB  (0) 2016.04.24
[Tomcat] 4. Batch  (0) 2016.04.22
[Tomcat] 3. Config  (0) 2016.04.21
[Tomcat] 2. Set up a native lib  (0) 2016.04.21
블로그 이미지

리딩리드

,

[Tomcat] 4. Batch

WAS/Tomcat 2016. 4. 22. 17:45
donaricano-btn

Batch


1. web application


 Which web application can run on the Tomcat?


- Web application has a WEB-INF folder 

- WEB-INF

- lib

- web.xml

- classes


2. by Manager


To use a Manager


2_1 . http://localhost:8080/

- If you get a error, You will change your port number(server.xml)


2_2. Access to Manager App

- Have to config a login id/pw

- /CONF/tomcat-users.xml

- add a 

<role rolename="manager-gui"/>

<user username="admin" password="admin" roles="manager-gui"/>


2_3. WAR file to deploy

- window : jar cvf sample.war ./sample


2_4. Click a sample file that was maded

2_5. Check a wepapps folder


3. webapps DIR

- Copy and Paste


4. context.xml

4_1. path

- CATALINA_HOME/conf/context.xml

- CATALINA_HOME/conf/[enfinename]/[hostname]/context.xml.default

CATALINA_HOME/conf/[enfinename]/[hostname]/[webapp].xml


4_2. example

a. webapplication

- WebApplication was located in  ROOT

C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.69-windows-x64


b. sample.xml

- C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.69-windows-x64\apache-tomcat-7.0.69\conf\Catalina\localhost

- sampe.xml

<?xml version="1.0" encoding="UTF-8"?>


<Context path="sample" docBase="C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.69-windows-x64\sample" debug="0" 

reloadable="true" crossContext="true" privileged="true"/>


- path = localhost:8080/sample

- docBase = location that was located in webapplication 




'WAS > Tomcat' 카테고리의 다른 글

[Tomcat] 6. Interwork DB  (0) 2016.04.24
[Tomcat] 5. Batch - Parallel deployment  (0) 2016.04.24
[Tomcat] 3. Config  (0) 2016.04.21
[Tomcat] 2. Set up a native lib  (0) 2016.04.21
[Tomcat] 1. Why do we use a tomcat?  (0) 2016.04.21
블로그 이미지

리딩리드

,