[原创]Apache 2.2.4和Tomcat 5.5集成安装【新手教程】

C、C++和Java语言
回复
foxgst
帖子: 21
注册时间: 2006-08-03 9:56
送出感谢: 0
接收感谢: 0

[原创]Apache 2.2.4和Tomcat 5.5集成安装【新手教程】

#1

帖子 foxgst » 2007-03-20 13:45

software
--------
Ubuntu 6.10 (Without DNS or AMP)
(synaptic lib) lynx
(zlib.net) zlib.tar.gz
(apache.org) httpd-2.2.4.tar.gz
(synaptic lib) sun-java5-jdk
(synaptic lib) tomcat 5.5


preparing
---------
# before you do fllow me, change your /etc/apt/sources.list, and make sure that you can get sun-java5-jdk and tomcat 5.5
# if you're chinanetcom' user, you can use the source provided by Taiwan which works well

# Install basic tools

代码: 全选

sudo aptitude install build-essential
# remove apache and apache if you have install it
# Ubuntu server 6.10 dont't have these by default

代码: 全选

sudo apt-get remove --purge apache apache2
# you can install lynx to get src package easily
# if you would download source files by wget, you need not to install it

代码: 全选

sudo apt-get install lynx
# Download apache 2.2
# you can download it by others ways, e.g. wget

代码: 全选

lynx http://httpd.apache.org/download.cgi
# Download zlib 1.2.3

代码: 全选

lynx http://www.zlib.net/        
# you can download it with wget
# wget http://www.zlib.net/zlib-1.2.3.tar.gz

Installing
----------

# Extract zlib

代码: 全选

gzip -d zlib-1.2.3.tar.gz
tar xvf zlib-1.2.3.tar
cd zlib-1.2.3
# Build and install zlib 1.2.3

代码: 全选

sudo ./configure --prefix=/usr/local/
sudo make
sudo make install
# Extract apache 2.2

代码: 全选

cd ..
gzip -d httpd-NN.tar.gz
tar xvf httpd-NN.tar
cd httpd-NN
# Build and install apr 1.2

代码: 全选

cd srclib/apr
sudo ./configure --prefix=/usr/local/apr-httpd/
sudo make
sudo make install
# Build and install apr-util 1.2

代码: 全选

cd ../apr-util
sudo ./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
sudo make
sudo make install
# Build and install httpd 2.2

代码: 全选

sudo cd ../../
sudo ./configure --prefix=/usr/local/apache2 -enable-mods-shared=all -enable-deflate -enable-proxy -enable-proxy-balancer -enable-proxy-http  --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ --with-zlib=/usr/local
sudo make
sudo make install
# Install and configure jdk

代码: 全选

sudo apt-get install sun-java5-jdk
vi ~/.bashrc
append

代码: 全选

export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
# Install Tomcat 5.5

代码: 全选

sudo apt-get install tomcat5.5
# Configure httpd.conf

代码: 全选

sudo vi /usr/local/apache2/conf/httpd.conf
append
ProxyPass /images !
ProxyPass /css !
ProxyPass /js !
ProxyPass / http://localhost:8180/
or

代码: 全选

ProxyPass /images !
ProxyPass /css ! 
ProxyPass /js !

ProxyPass / balancer://example/
<Proxy balancer://example/>
BalancerMember http://server1:8180/
BalancerMember http://server2:8180/
BalancerMember http://server3:8180/
</Proxy>

# Logout and login to active the configuration

代码: 全选

logout
# login

# Start apache 2.2 and tomcat 5.5

代码: 全选

sudo /etc/init.d/tomcat5.5 start
sudo /usr/local/apache2/apachectl start
# Finish now
mara
帖子: 24
注册时间: 2008-01-19 16:37
送出感谢: 0
接收感谢: 0
联系:

#2

帖子 mara » 2008-02-18 13:42

什么乱七八糟的,能不能负点责任啊?都是新手啊!
回复

回到 “C/C++/Java”