使用到的软件:apache-tomcat-7.0.8.tar.gz jdk-6u26-linux-x64.bin
# sh jdk-6u26-linux-x64.bin
# mv jdk1.6.0_26/ /usr/local/
# cd /usr/local/
# mv jdk1.6.0_26/ jdk
#vim /etc/profile
export JAVA_HOME=/usr/local/jdk
export CLASSPATH=:$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin
# source /etc/profile
# echo $JAVA_HOME
/usr/local/jdk
# echo $CLASSPATH
:/usr/local/jdk/lib
# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin:/usr/local/jdk/bin:/usr/local/jdk/bin
# tar xf apache-tomcat-7.0.8.tar.gz -C /usr/local/
# cd /usr/local/
# mv apache-tomcat-7.0.8/ tomcat
# cd /usr/local/tomcat/bin
# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
# vim /usr/local/nginx/conf/nginx.conf
location ~ \.jsp$ {
proxy_pass
}
//关于nginx的详细配置请参考http://blog.chinaunix.net/space.php?uid=26118446&do=blog&id=2889850
# cd /usr/local/tomcat/webapps/ROOT
# vim index.jsp
The time is: <%= new java.util.Date() %>
如果把nginx换成apache的话:
# yum install httpd -y
# mv mod_jk-1.2.31-httpd-2.2.x.so /etc/httpd/modules
//我这里用的是x86_64 的,一定要对应,要不服务起不起来
# vim /etc/httpd/conf.d/htp-jk.conf
LoadModule jk_module modules/mod_jk-1.2.31-httpd-2.2.x.so
JkShmFile logs/mod_jk.shm
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount /servlet/* ajp13
JkMount /*.jsp ajp13
JkMount /*.do ajp13
AddType application/x-jsp .jsp
阅读(1310) | 评论(0) | 转发(0) |