顯示包含「Tomcat」標籤的文章。顯示所有文章
顯示包含「Tomcat」標籤的文章。顯示所有文章

2012/11/13

reverse proxy without apache http server



在 $tomcat_home\conf\server.xml 中修改以下內容

 

<host appbase="" name="localhost" p="">unpackWARs="true" autoDeploy="true"  
 xmlValidation="false" xmlNamespaceAware="false"&gt;  
 <valve classname="org.apache.catalina.valves.AccessLogValve" directory="logs" p="">prefix="appName_access_log." suffix=".txt"  
 pattern="%h %l %u %t "%r" %s %b" resolveHosts="false"/&gt;  
 <context docbase="webapps/appName" path="" reloadable="false"></context>  
 </valve>
</host>  

2012/11/12

Amazon EC2 Running Tomcat on port 80

SSH command:

#sudo /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

#sudo /sbin/service iptables save

server.xml:


#service tomcat7 restart

2012/07/20

Install Tomcat 6 in CentOS 5.8


  1. Install Tomcat 6 Process
    1. cd /etc/yum.repos.d
    2. wget 'http://www.jpackage.org/jpackage50.repo'
    3. yum update
    4. yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps
    5. service tomcat6 start
  2. If you have problems accessing the server from another machine you may need to do the following:
    1. setup
    2. "Firewall configuration"
    3. "Customize"
    4. "Other ports" 8080:tcp
    5. "Ok"
    6. service tomcat6 restart
  3. If you get a dependency error:
    1. rpm -Uvh 'http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm'
  4. tomcat_home: /usr/share/tomcat6
  5. "tomcat" is a default execute tomcat server user.

2008/09/17

Tomcat (5.5.X) + SSL (簡易憑證)

1.製作憑證 
(利用 jdk 中附的 keytool 製作簡易憑證) 指令 : keytool -genkey -alias maAlias -keypass myKeyPass -keystore myKeystore.jks -storepass myKeyPass -keyalg DSA -validity 730

[需要輸入內容]
您的名字與姓氏為何? 
[Unknown]: 
localhost (這個好像不能亂打,要打domain name.. ) (CN)
您的編制單位名稱為何? 
[Unknown]:OU
您的組織名稱為何? 
[Unknown]:O 
您所在的城市或地區名稱為何? 
[Unknown]:L 
您所在的州及省份名稱為何? 
[Unknown]:S 
該單位的二字國碼為何 
[Unknown]:TW 
CN=localhost, OU=OU, O=O, L=L, S=S, C=tw 正確嗎? 
[否]: Y 
 

注意事項 :
1.keypass 與 keystorepass 必須相同
2.其餘指令請參照
keytool中文說明 或是 Sun官方說明文件

2.設定Tomcat中 ${CATALINA_HOME}\conf\server.xml
(將產生好的憑證放置${CATALINA_HOME}\keystore\)

---
....
Connector port="8443" minprocessors="5" maxprocessors="75" uriencoding="UTF-8" enablelookups="true" disableuploadtimeout="true" acceptcount="100" debug="0" scheme="https" secure="true" clientauth="false" sslprotocol="TLS" keystorefile="keystore\myKeystore.jks" keystorepass="myKeyPass" keyalias="myAlias" algoritym="MD5" / >
....
---

3.連線 : https://localhost:8443/
3.1需要將憑證匯入至瀏覽器,使其信任憑證。
3.2亦可將憑證換成具有第三方簽署過的憑證(VeriSign. 等組織均預設存在於瀏覽器的信任憑證,當然與瀏覽器的預設有關),可以不需要做匯入動作。

4.完成!

NGINX SSL/設定檔案

#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #...