apache和tomcat整合

來源:互聯網
上載者:User

apache和tomcat整合
 需要的軟體包:httpd-2.2.21.tar.gz  tomcat-connectors-1.2.32-src.tar.gz  jdk-7-linux-x64.rpm  apache-tomcat-7.0.23.tar.gz首先安裝gcc做編譯前的環境。。
  www.2cto.com  首先rpm -ivh jdk-7-linux-x64.rpm 安裝完成以後 建立一個串連 ln -s /usr/java/jdk1.7.0/ /usr/jdk編譯apachetar zxvf httpd-2.2.21.tar.gz -C /usr/local/src/cd /usr/local/src/httpd-2.2.21/./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-proxy --enable-proxy-ajpmake && make install編譯tomcat-connectors-1.2.32-src.tar.gz tar zxvf tomcat-connectors-1.2.32-src.tar.gz -C /usr/local/src/cd /usr/local/src/tomcat-connectors-1.2.32-src/cd native/./configure --with-apxs=/usr/local/apache2/bin/apxsmake && make install解壓apache-tomcat-7.0.23.tar.gztar zxvf apache-tomcat-7.0.23.tar.gz -C /usr/local/src/cd /usr/local/src/apache-tomcat-7.0.23/vim -o startup.sh shutdown.sh在啟動和關閉檔案分別添加:export JAVA_HOME=/usr/jdk然後到tomcat的webapss裡面建立一個檔案夾叫jspcd到jsp裡面vim index.jsp開啟添加 <%=new java.util.Date() %>修改tomcat設定檔vim /usr/local/src/apache-tomcat-7.0.23/conf/server.xml修改以下內容cd /usr/local/apache2/htdocsmkdir wwwecho "111111111111111" > index.htmlcd /usr/local/apache2/confvim httpd.conf修改Directoryindex index.jsp index.html添加include conf/extra/httpd-vhost.confinclude conf/extra/httpd-jk.confcd extravim httpd-vhost.confvim httpd-jk.conf vim workers.properties 重新啟動apache tomcat測試:   

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.