Category Archives: tomcat

Tomcatの5種類データベースの構成コード

構成コード:

<?xml version=”1.0″ encoding=”UTF-8″?>

<Context docBase=”F:\XXX\WebApp” path=”/final” reloadable=”true”>
<Resource
auth=”Container”
name=”jdbc/final”
type=”javax.sql.DataSource”
driverClassName=”org.h2.Driver”
username=”sa”
password=””
maxIdle=”20″
maxWait=”-1″
url=”jdbc:h2:tcp://localhost:9092/test_startnews24″
maxActive=”20″/>

<Resource
auth=”Container”
name=”jdbc/final”
type=”javax.sql.DataSource”
driverClassName=”com.mysql.jdbc.Driver”
username=”root”
password=”root”
maxIdle=”2″
maxWait=”5000″
url=”jdbc:mysql://localhost:3306/secondtest?useUnicode=true&amp;characterEncoding=utf-8″
maxActive=”2″/>

<Resource
auth=”Container”
name=”jdbc/finaltest”
type=”javax.sql.DataSource”
driverClassName=”com.ibm.db2.jcc.DB2Driver”
factory=”org.objectweb.jndi.DataSourceFactory”
username=”db2admin”
password=”1″
maxIdle=”20″
maxWait=”-1″
url=”jdbc:db2://172.31.5.94:50000/test_stand”
maxActive=”20″/>

<Resource
auth=”Container”
name=”jdbc/final”
type=”javax.sql.DataSource”
driverClassName=”oracle.jdbc.driver.OracleDriver”
factory=”org.objectweb.jndi.DataSourceFactory”
username=”test_st”
password=”x1″
maxIdle=”20″
maxWait=”-1″
url=”jdbc:oracle:thin:@172.31.5.94:1521:orcl”
maxActive=”20″/>

<Resource
auth=”Container”
name=”jdbc/final”
type=”javax.sql.DataSource”
driverClassName=”net.sourceforge.jtds.jdbc.Driver”
username=”sa”
password=”@1″
maxIdle=”20″
maxWait=”-1″
url=”jdbc:jtds:sqlserver://172.31.5.94:1433/test_st;user=sa;password=@1″
maxActive=”20″/>

</Context>

Ubuntu Server 12.04でTomcat6をインストールする

1.Tomcatのインストール
startnews24_dev@startnews24:~$ sudo tasksel
[*] Tomcat Java server を選択

2.インストール完了
startnews24_dev@startnews24:~$ sudo service tomcat6 status
* Tomcat servlet engine is running with pid 2619
startnews24_dev@startnews24:~$

3.Tomcatが起動
場所の確認
startnews24_dev@startnews24:~$ sudo find /usr | grep startup.sh
/usr/share/tomcat6/bin/startup.sh
startnews24_dev@startnews24:~$

Tomcatが起動
startnews24_dev@startnews24:~$ sudo /usr/share/tomcat6/bin/startup.sh
Using CATALINA_BASE: /usr/share/tomcat6
Using CATALINA_HOME: /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat6/bin/bootstrap.jar
startnews24_dev@startnews24:~$

4.ファイアウォールを有効にする
startnews24_dev@startnews24:~$ sudo ufw allow 8080/tcp

5.トップページの確認
http://XXX:8080

2 / 212