linux系统apachetomcat虚拟主机安装配置是怎样的

linux系统apache tomcat虚拟主机安装配置是怎样的,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

专注于为中小企业提供成都网站建设、成都做网站服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业个旧免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了成百上千企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

多年不用tomcat,应一朋友要求,搭建一个java环境的虚拟主机,经过多次测试,现在把可以正常运行的配置记录下来。

安装jdk

cd /usr/local

sh /mnt/MySQL/jdk-6u14-linux-i586.bin

ln -s jdk1.6.0_14/ jdk

echo "export JAVA_HOME=/usr/local/jdk

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib" >> /etc/profile.d/java.sh

chmod +x /etc/profile.d/java.sh

安装tomcat

wget http://apache.freelamp.com/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz

tar xzf apache-tomcat-6.0.20.tar.gz -C /usr/local/

cd /usr/local/

ln -s apache-tomcat-6.0.20/ tomcat

vi ~/.bash_profile

TOMCAT_HOME=/usr/local/tomcat

export PATH TOMCAT_HOME

source ~/.bash_profile

安装jk connector

wget http://labs.xiaonei.com/apache-mirror/tomcat/tomcat-connectors/jk/source/jk-1.2.28/tomcat-connectors-1.2.28-src.tar.gz

tar xfz tomcat-connectors-1.2.28-src.tar.gz -C /usr/local/src/

cd /usr/local/src/tomcat-connectors-1.2.28-src/

cd native/

./configure –with-apxs=/usr/local/httpd/bin/apxs

make

cp apache-2.0/mod_jk.so /usr/local/httpd/modules/

apche配置

vim /usr/local/httpd/conf/extra/httpd-vhosts.conf

LoadModule jk_module modules/mod_jk.so

Include /usr/local/httpd/conf/mod_jk.conf

JkMountCopy On

ServerName edu.veryi.com

DirectoryIndex index.jsp index.html index.jsp index.htm

DocumentRoot /usr/local/tomcat/webapps/ROOT

#DocumentRoot /usr/local/www/edu.veryi.com/html

#

Order allow,deny

Allow from all

CustomLog "|/usr/local/sbin/cronolog /var/log/httpd/edu.veryi.com-access_log.%Y%m%d" combined

ErrorDocument 404 /missing.html

vim /usr/local/httpd/conf/mod_jk.conf

JkWorkersFile /usr/local/httpd/conf/workers.properties

# Where to put jk logs

JkLogFile /usr/local/httpd/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"

# servlet 和jsp请求通过ajp13的协议送给Tomcat

JkMount /servlet/* worker1

JkMount /*.jsp worker1

——————————

/usr/local/httpd/conf/workers.properties

# Defining a worker named worker1 and of type ajp13

worker.list=worker1

# Set properties for worker1

worker.worker1.type=ajp13

worker.worker1.host=localhost

worker.worker1.port=8009

#worker.worker1.lbfactor=50

#worker.worker1.socket_keepalive=1

#worker.worker1.socket_timeout=300

tomcat配置

vim /usr/local/tomcat/conf/server.xml

unpackWARs="true" autoDeploy="true">           

prefix="tomcat_access_log." suffix=".log" pattern="common" resolveHosts="false"/>       

prefix="tomcat_file_log." suffix=".log" timestamp="true"/>

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注创新互联行业资讯频道,感谢您对创新互联的支持。


当前题目:linux系统apachetomcat虚拟主机安装配置是怎样的
URL链接:http://pwwzsj.com/article/jggeoo.html