RHEL6 LAMT TOCAT与APACHE整合
生活随笔
收集整理的這篇文章主要介紹了
RHEL6 LAMT TOCAT与APACHE整合
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Linux+Apache+tomcat+mysql安裝說明
軟包版本 Linux enter6.0 32位 Apache httpd-2.4.2.tar.gz Tomcat apache-tomcat-7.0.29.tar.gz JDK jdk-7u6-linux-i586.tar.gz Mysql mysql-5.1.47 tomcat-connectors-1.2.37-src.tar.gzApache補丁 apr-1.4.6.tar.gz apr-util-1.4.1.tar.gz 軟件安裝yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers 先安裝編繹包 tar zxvf httpd-2.4.2.tar.gz cd httpd-2.4.2 cp -rf apr-1.4.6 httpd-2.4.2/srclib/apr cp -rf apr-util-1.4.1 httpd-2.4.2/srclib/apr-util ./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib?--enable-mods-shared=all --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-support --disable-userdir?--with-included-apr 如出錯按如下嘗試 ./configure --prefix=/usr/local/apache2 --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-included-apr Make clean Make install /usr/local/apache2/bin/apachectl start 以上裝APACHE完成,測試一下192.168.3.124 訪問出來:it works代表成功 mkdir /usr/java tar zxf jdk-7u6-linux-i586.tar.gz mv jdk1.7.0_06/ /usr/java vim /etc/profile 編輯 /etc/profile在文件最后添加如下語句 JAVA_HOME=/usr/java/jdk1.7.0_06 export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH CLASSPATH=:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar export CLASSPATH source /etc/profile #使設置立及生效 java –version 以上安裝JDK完成 java –version 查看版本是否生效 tar zxf apache-tomcat-7.0.29.tar.gz -C /usr/local cd /usr/local mv apache-tomcat-7.0.29/ tomcat /usr/local/tomcat/bin/startup.sh netstat -tunlp|grep 8080 以上是安裝tomcat步驟 APACHE與TOMCAT的整合 tar zxf tomcat-connectors-1.2.37-src.tar.gz cd tomcat-connectors-1.2.37-src cd native/ ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-tomcat=/usr/local/tomcat --with-java-home=/usr/java --with-jni make cd apache-2.0 /usr/local/apache2/bin/apxs -i mod_jk.so Vi /usr/local/apache2/conf/httpd.conf?#在配置文件中添加如下配置 LoadModule jk_module modules/mod_jk.so include /etc/httpd/extra/mod_jk.conf?#路徑可根據實際配置 vi /usr/local/apache2/conf/extra/mod_jk.conf?#在配置文件中添加如下配置 #where to find workers.properties jkWorkersFile /etc/httpd/conf/workers.properties #Where to put jk logs JkLogFile /usr/local/apache2/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]" #JkRequestLogFormat set the request format JkRequestLogFormat "%W %V %T" #JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories #Send JSPs for context /examples to worker named worker JkMount /*.jsp worker1 JkMount /examples/* worker1 Vim /usr/local/apache2/conf/workers.properties #在配置文件中添加如下配置 # Define 1 real worker using ajp13 worker.list=worker1 # Set properties for worker1 (ajp13) worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 worker.worker1.lbfactor=50 worker.worker1.cachesize=10 worker.worker1.cache_timeout=600 worker.worker1.socket_keepalive=1 worker.worker1.socket_timeout=300 修改httpd.conf做個別外記錄,用于測試 Vim /usr/local/apache2/conf/httpd.conf?#在配置文件中添加如下配置 #Static files in the examples webapp are seved by apache Alias /examples "/usr/localtomcat/webapps/examples" #The following line prohibits users from directly access WEB-INF <Directory "/examples/WEB-INF"> AllowOverride None deny from all </Directory> #All JSP will goes to worker1 JkMount /*.jsp worker1 #All servlets goes to worker1 JkMount /*/servlet/ worker1 重啟APACHE,TOMCAT /usr/local/apache2/bin/apachectl stop /usr/local/apache2/bin/apachectl start /usr/local/tomcat/bin/shutdown.sh /usr/local/tomcat/bin/startup.sh netstat -tunlp | grep 80 在瀏覽器輸入http://192.168.3.124/examples/?#出現APACHE Tomcat Examples代表成功轉載于:https://blog.51cto.com/myjiang/1036220
總結
以上是生活随笔為你收集整理的RHEL6 LAMT TOCAT与APACHE整合的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android Prefence 总结
- 下一篇: 如何让 Hyper-V 和 VMware