1.Apache2 安裝
1)下載: Apache2 download page: http://httpd.apache.org/download.cgi 使用版本
2) 解壓: tar -zxvf httpd-2.2.15.tar.gz
3)安裝: 執行如下命令:(一般地,把PREFIX替換成/usr/local/apache2/)
$ ./configure --prefix=PREFIX
$ make
$ make install
$ PREFIX/bin/apachectl start
4)運行apache2 :
cd PREFIX/bin/
./apachectl start
使用瀏覽器訪問,http://localhost/ ,返回頁面: It works!
截止這裏,Apache2安裝完成。
2. Tomcat6安裝 (這個過程,可以參考http://www.howtogeek.com/howto/linux/installing-tomcat-6-on-ubuntu/)
1) 下載: Tomcat6 download page : http://tomcat.apache.org/ 使用版本
2) 解壓: tar -zxvf apache-tomcat-6.0.26.tar.gz
3.使用mod_jk實現apache2與tomcat連接
完全參考這裏http://www3.ntu.edu.sg/home/ehchua/programming/howto/apache_tomcat_howto.html;但是,也遇到一些問題.
1)從源碼編譯mod_jk
$> cd native
$> ./configure --with-apxs=/usr/sbin/apxs (or where ever the apxs/apxs2 is)
$> make
$> su -c 'make install'
2)這中間關鍵的一步是:找到apxs(在通過個源代碼安裝的apache2版本中,bin/下已經包含了該文件)
在之前直接使用apt-get install apache2 後,找不到apxs. 這時候,就需要: Use “apt-file” to look for specific files to be installed.