jdk+tomcat

apache+php的安装过程就省略了
1安装jdk
#chmod 755 jdk-1_5_0_06-linux-i586.bin
#./jdk-1_5_0_06-linux-i586.bin
将该文件移动到/usr/local/java 目录下
# mv jdk1.5.0_06 /usr/local/java/
到/usr/bin目录下,把原用的java,javac文件删除:
#rm -rf /usr/binjava
#rm �Crf /usr/binjavac
在/usr/bin 下建立 软连接 java
# ln -s /usr/local/java/bin/java /usr/bin/java
# ln -s /usr/local/java/bin/javac /usr/bin/javac
为了方便下在的工作建立两个软链接:
#ln -s /usr/local/java  /usr/local/jdk
#ln -s /usr/local/java/jre /usr/local/jre
测试版本
#java -version
2安装tomcat
# tar zxvf jakarta-tomcat-5.0.29.tar.gz
# mv jakarta-tomcat-5.0.29 /home/tomcat
启动关闭服务文件放在  /home/tomcat/bin
  配置文件              /home/tomcat/conf
  web文件              /home/tomcat/webapps
  默认访问目录         /home/tomcat/webapps/ROOT
设置环境变量,
在/etc/profile中末尾加入:
# JAVA
export JAVA_HOME=/usr/local/jdk
export TOMCAT_HOME=/home/tomcat
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
改变tomcat目录的属主和属组
# chown -R daemon:daemon /home/tomcat/
# chmod 755 /home/tomcat/
启动与关闭tomcat
#cd /home/tomcat/bin
#./startup.sh   (关闭服务:#./shutdown.sh)
测试: [url]http://192.168.10.2:8080/[/url]
(apache2.2.0是目前较新的版本。和apache2.0版本比较,它首先需要安装   apr-1.2.2.tar.tar和 apr-util-1.2.2.tar.tar
才能正常的运行)
安装:apr-1.2.2和apr-util-1.2.2
# tar zxvf apr-1.2.9.tar.gz
# cd apr-1.2.9
#./configure --prefix=/usr/local/apr-httpd/
#make
#make install
# tar zxvf apr-util-1.2.8.tar.gz
#cd apr-util-1.2.8
#./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
#make
#make install
# tar zxvf jakarta-tomcat-connectors-1.2.13-src.tar.gz
# cd jakarta-tomcat-connectors-1.2.13-src/jk/native2/
#./configure --with-apxs=/Data/apps/apache-2.2.4/bin/apxs \ ()
--with-java-home=/usr/local/jdk \
--with-tomcat41=/home/tomcat \
--with-apr-lib=/Data/apps/apache-2.2.4/lib
#make
#make install
(mod_jk.so会自动被复制到 /usr/local/apache2/modules目录下)
# cp jakarta-tomcat-connectors-1.2.13-src/jk/conf/workers.properties /Data/apps/apache-2.2.4/conf/
整和apache与tomcat
# vi /Data/apps/apache-2.2.4/conf/httpd.conf
#ad mod_jk module
LoadModule jk_module modules/mod_jk.so
# Update this path to match your modules location
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
  JkWorkersFile /Data/apps/apache-2.2.4/conf/workers.properties
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
  JkLogFile     /Data/apps/apache-2.2.4/logs/mod_jk.log
# Set the jk log level [debug/error/info]
  JkLogLevel    info
# Select the log format
  JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
  JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
  JkRequestLogFormat     "%w %V %T"
# Send everything for context /examples to worker named worker1 (ajp13)
  JkMount  /*.jsp worker1
重启apache
# /Data/apps/apache-2.2.4/bin/apachectl -k restart

你可能感兴趣的:(tomcat,linux,职场,休闲,linux总结)