¢º¢¹ jsp °èÁ¤ ¼ÂÆðú ¹öÃß¾óÈ£½ºÆ® ¼³Á¤ ¢·¢¸
html Æú´õ¿¡ ROOT, webapps »ý¼º
¡Ø ¹Ýµå½Ã Æú´õ ¸ÕÀú »ý¼ºÇÒ°Í
drwxr-xr-x 2 root root 4096 8¿ù 21 18:52 ROOT
drwxr-xr-x 2 root root 4096 8¿ù 21 18:52 WEB-INF
drwxr-xr-x 4 root root 4096 8¿ù 24 19:16 webapps
[root@jsp1 html]# cd webapps
drwxr-xr-x 4 root root 4096 8¿ù 22 10:18 WEB-INF
drwxrwxrwx 3 root root 4096 12¿ù 19 2002 manager/web.xml
- ¾ÆÆÄÄ¡ ¼³Á¤
<VirtualHost 211.110.17.171>
DocumentRoot /free/home/seleven/html
ServerName s11.co.kr
ServerAlias www.s11.co.kr
JkMount /*.jsp ajp13
JkMount /webapps/* ajp13
jkMount /ROOT/* ajp13
JkMount /servlet/* ajp13
JkMount /manager ajp13
JkMount /manager/* ajp13
CustomLog logs/access_log vcommon
</VirtualHost>
- ÅèĹ ¼³Á¤
vi /usr/local/jakarta-tomcat/conf/server.xml
<!--epnosamo.org-->
<Host name="epnosamo.org" debug="0" appBase="/free/home/ryune/html" unpackWars="true">
<Context path="/webapps" docBase="webapps" reloadable="true"/>
<Context path="/ROOT" docBase="ROOT" reloadable="true"/>
<Context path="/manager" docBase="/free/home/ryune/html/webapps/manager" debug="0" privileged="true"></Context>
<Alias>www.epnosamo.org</Alias>
</Host>
<!--fauction.co.kr-->
<Host name="fauction.co.kr" debug="0" appBase="/free/home/winbass/html" unpackWars="true">
<Context path="/webapps" docBase="webapps" reloadable="true"/>
<Context path="/ROOT" docBase="ROOT" reloadable="true"/>
<Context path="/manager" docBase="/free/home/winbass/html/webapps/manager" debug="0" privileged="true"></Context>
<Alias>www.fauction.co.kr</Alias>
</Host>
</Engine>
</Service>
- admin tools manager ¼³Á¤
vi /usr/local/tomcat/conf/tomcat-users.xml
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="nayana" password="xxxxxx" roles="admin"/>
<user username="gn5066" password="xxxxx" roles="manager"/>
<user username="ryune" password="xxxxxx" roles="manager"/>
<user username="joungjo" password="xxxxx" roles="manager"/>
<user username="winbass" password="xxxxxx" roles="manager"/>
</tomcat-users>
- admin tools manager ¼³Á¤ÈÄ º¸¾È ¼³Á¤
chmod 400 /usr/local/tomcat/conf/tomcat-users.xml
chown -R gn5066.free /free/home/gn5066/html/webapps/work/gnwater.net/webapps
chown -R ryune.free /free/home/ryune/html/webapps/work/epnosamo.org/webapps
chown -R winbass.free /free/home/winbass/html/webapps/work/fauction.co.kr/webapps
- ¼ºí¸´ ¼³Á¤
vi /etc/profile
JAVA_HOME=/usr/local/java
CATALINA_HOME=/usr/local/tomcat
PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin
CLASSPATH=.:/usr/local/tomcat/common/lib/servlet.jar <--- Ãß°¡
export JAVA_HOME CATALINA_HOME CLASSPATH
vi /usr/local/jakarta-tomcat/conf/web.xml
<!-- The mapping for the invoker servlet -->
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
- ÅèĹ Á¤Áö/½ÇÇà
[root@sph3 bin]# ./shutdown.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JAVA_HOME: /usr/local/jdk
[root@sph3 bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JAVA_HOME: /usr/local/jdk
[root@sph3 bin]# /etc/rc.d/init.d/tomcat restart|stop|start
¢º¢¹ ÀÚ¹ÙÅèÄÏ ¸®½ºÆ® Ãâ·Â ¸·´Â °Í°ú ¿¡·¯ ÆäÀÌÁö ÁöÁ¤ ¢¸
conf/web.xml ¿¡¼¿ä
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
param-value ¸¦ true ¿¡¼ false ·Î ¹Ù²Ù°í http://okjsp.pe.kr/ ·Î µé¾î¿À¸é
404 not found ¿¡·¯ ¸Þ½ÃÁö ÆäÀÌÁö°¡ ¶ß°Ô µË´Ï´Ù.
±×¸®°í ÀÌ 404 ÆäÀÌÁö¸¦ ÀÚ½ÅÀÌ ÁöÁ¤ÇÑ ÆäÀÌÁö·Î °¡°Ô ÇÏ·Á¸é
/conf/web.xml ¿¡
<error-page>
<error-code>404<error-code>
<location>/error.jsp(ÁöÁ¤ÇÑ ÆäÀÌÁö)</location>
</error-page>
À§¿¡ ºÎºÐÀ» Ãß°¡ÇÏ½Ã¸é µË´Ï´Ù...
jsp ±âŸ ȯ°æ¼³Á¤.