AJAX+JAVA±â¹ÝÀÇ webmail-claros in touch ¼³Ä¡ ¹æ¹ý - ¼Ò½º ¼³Ä¡ ÆÄÀÏ Æ÷ÇÔ
ÅÍÅ°»ç¶÷µé¿¡ ÀÇÇØ °ø°³µÈ ajax ±â¹ÝÀÇ À¥¸ÞÀÏ·Î ´Ù¸¥ °ø°³¹öÀü¿¡ ºñ±³Çؼ ±â´É°ú µðÀÚÀÎÀÌ ¿ì¼öÇÏ´Ù.
¼³Ä¡¹æ¹ýÀº,
´Ù¿î·Îµå »çÀÌÆ® : http://www.claros.org
1. Download Java SE Development Kit 6u20 for Linux x64, Multi-language
http://java.sun.com/products/archive/j2se/6u2/index.html
Àڽſ¡°Ô ¸Â´Â OS¿Í ºñÆ®¸¦ ¼±ÅÃÇÏ¿© ´Ù¿î·ÎµåÇÑ´Ù.
jdk-6u20-linux-x64-rpm.bin (¸®´ª½º, 64ºñÆ®¹öÀü) ¸¦ ´Ù¿î·ÎµåÇÑ´Ù.
[root@localhost ~]# chmod +x jdk-6u20-linux-x64-rpm.bin
[root@localhost ~]# ./jdk-6u20-linux-x64-rpm.bin
Sun Microsystems, Inc. Binary Code License Agreement
for the JAVA SE DEVELOPMENT KIT (JDK), VERSION 6
SUN MICROSYSTEMS, INC. ("SUN") IS WILLING TO LICENSE THE
SOFTWARE IDENTIFIED BELOW TO YOU ONLY UPON THE CONDITION
THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS BINARY
CODE LICENSE AGREEMENT AND SUPPLEMENTAL LICENSE TERMS
(COLLECTIVELY "AGREEMENT"). PLEASE READ THE AGREEMENT
CAREFULLY. BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT
YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE
AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER
LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL
AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF
YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH
TO BE BOUND BY THE TERMS, THEN YOU MUST NOT USE THE
SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE
SOFTWARE IS CONTAINED.
<»ý·«>
»ó±â¹öÀüÀ» ¼³Ä¡Çϸé, ´ÙÀ½Ã³·³ ¿¡·¯°¡ ¹ß»ýÇÑ´Ù.
Extracting...
./jdk-6u20-linux-x64-rpm.bin: line 547: ./install.sfx.2886: cannot execute binary file
Installing JavaDB
´ÙÀ½ ¹öÀüÀ¸·Î ´Ù¿î·Îµå¸¦ ´Ù½ÃÇÏ°í, À§ÀÇ °úÁ¤À» ¹Ýº¹ÇÏ¸é ¿¡·¯ ¾øÀÌ ¼³Ä¡°¡ °¡´ÉÇÏ´Ù.
jdk-6u20-linux-i586-rpm.bin
Á¤»ó¼³Ä¡°¡ µÇ¸é ¾Æ·¡ ó·³ ¸Þ½ÃÁö°¡ ³ªÅ¸³´Ù.
<»ý·«>
Installing JavaDB
Áغñ Áß... ########################################### [100%]
1:sun-javadb-common ########################################### [ 17%]
2:sun-javadb-core ########################################### [ 33%]
3:sun-javadb-client ########################################### [ 50%]
4:sun-javadb-demo ########################################### [ 67%]
5:sun-javadb-docs ########################################### [ 83%]
6:sun-javadb-javadoc ########################################### [100%]
Java(TM) SE Development Kit 6 successfully installed.
Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Sun products, services and training
* Access to early releases and documentation
Product and system data will be collected. If your configuration
supports a browser, the Sun Product Registration form for
the JDK will be presented. If you do not register, none of
this information will be saved. You may also register your
JDK later by opening the register.html file (located in
the JDK installation directory) in a browser.
For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html
Press Enter to continue.....
Done.
2. ÅèĹ ´Ù¿î·Îµå ¼³Ä¡
wget http://apache.mirror.cdnetworks.com/tomcat/tomcat-6/v6.0.26/bin/apache-tomcat-6.0.26.tar.gz
tar xzvf apache-tomcat-6.0.26.tar.gz
mv apache-tomcat-6.0.26 /usr/local/tomcat
vi tomcat -- µ¥¸ó ÆÄÀÏ ¸¸µé±â
#!/bin/bash
#
# tomcat This shell script takes care of starting and stopping
# tomcat.
#
# chkconfig: 35 85 15
#!/bin/bash
#
# tomcat This shell script takes care of starting and stopping
# tomcat.
#
# chkconfig: 35 85 15
# description: start/stop Script for the Tomcaat Server
#
# processname: tomcat
# Source function library.
. /etc/rc.d/init.d/functions
export JAVA_HOME=/usr/local/java
export TOMCAT_HOME=/usr/local/tomcat/
export CLASSPATH="."
PRGDIR="$TOMCAT_HOME/bin"
EXECUTABLE=startup.sh
UNEXECUTABLE=shutdown.sh
# Check that target executable exists
if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "This file is needed to run this program"
exit 1
fi
case "$1" in
start)
echo -n "Starting Tomcat service: "
echo
daemon "$PRGDIR"/"$EXECUTABLE"
;;
stop)
echo -n "Shutting down Tomcat service: "
echo
daemon "$PRGDIR"/"$UNEXECUTABLE"
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
echo
exit 0
"tomcat" [New] 60L, 959C written
[root@localhost JAVA]# chmod 755 tomcat
[root@localhost JAVA]# cp tomcat /etc/rc.d/init.d/
[root@localhost JAVA]# chkconfig --add tomcat
[root@localhost JAVA]# chkconfig --level 345 tomcat on
[root@localhost JAVA]# service tomcat start
Starting Tomcat service:
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/java
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar
[ OK ]
vi /etc/profile
¸Ç ¹Ø¿¡ Ãß°¡
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=$CLASSPATH:$JAVA_HOME/lib
ÀúÀåÇÏ°í
source /etc/profile
set ¸í·É¾î ½ÇÇàÈÄ, PATH¿Í CLASSPATH°¡ µé¾î ÀÖ´ÂÁö¸¦ È®ÀÎÇÑ´Ù.
3. MYSQL ¼³Ä¡Çϱâ
4. Download Claros Intouch 2.2 (°³¹ß¹öÀüÀ» ´Ù¿î·Îµå)
claros-intouch-2.2-beta.zip
unzip claros-intouch-2.2-beta.zip
cp claros-intouch2-2.2-beta/intouch2.war /usr/local/tomcat/webapps/
cd /usr/local/tomcat/webapps/
¾ÐÃàÀ» jar ¸í·É¾î¸¦ »ç¿ëÇؼ Ǭ´Ù.
jar xvf intouch2.war
5. EDITING THE CONFIG.XML FILE:
Where you see 0.0.0.0, put the IP address of your email server/s:
(Server port 143 for imap, and 993 for secure imap)
login>mysqlusername
6. CREATE YOUR MYSQL DATABASE:
From terminal:
localhost#mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 49290
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
mysql>create database intouch;
mysql>grant all privileges on intouch.* to ¾ÆÀ̵ð@localhost identified by 'ºñ¹Ð¹øÈ£';
mysql>exit
localhost#mysql intouch < /claros-intouch-2.1-bin/SQL/intouch-mysql.sql
Now check to see if the script created the tables:
localhost#mysql
mysql>use intouch
mysql>show tables;
mysql>exit
7. ÆÛ¹Ì¼Ç ÁÖ±â
chmod 777 /tmp /usr/local/tomcat/logs /usr/local/tomcat/temp
8. ÅèĹ ½ÇÇàÇϱâ
Á¤»ó ½ÇÇàÇÏ¸é ¾Æ·¡¿Í °°Àº ¸Þ½ÃÁö°¡ ³ªÅ¸³´Ù.
[root@localhost JAVA]# service tomcat restart
Shutting down Tomcat service:
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.6.0_20
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar
2010. 5. 25 ¿ÀÈÄ 5:50:14 org.apache.catalina.startup.Catalina stopServer
½É°¢: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.
at java.net.Socket.
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:408)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:338)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
[ OK ]
Starting Tomcat service:
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.6.0_20
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar
[ OK ]
8. ºê¶ó¿ìÀú¿¡¼ ½ÇÇàÇϱâ
¾ÆÆÄÄ¡ ±âº» ÆäÀÌÁö º¸±â
http://localhost:8080/
À¥¸ÞÀϺ¸±â(·ÎÄ®½ÇÇà)
http://localhost:8080/intouch2
À¥¸ÞÀϺ¸±â(ÀÎÅͳݽÇÇà)
http://SERVER-IP-ADDRESS:8080/intouch2
*¾ÈµÉ °æ¿ì¿¡´Â iptables -L ½ÇÇàÇÏ¿© 8080Æ÷Æ®¸¦ ¿¾îÁÖ¾î¾ß ÇÑ´Ù.
9. ÅèĹ ÁßÁöÇϱâ
service tomcat stop
10. PROTECT YOUR CONFIG.XML FILE