前提条件
安装gcc,gcc-c++两个编译器
yum install gcc
yum install gcc-c++
接下来开始安装集群相关环境:
1、下载apr,apr-util,pcre,apache(httpd),tomcat-connector
可通过yum下载安装
2、安装apr,apr-util,pcre
(1)安装apr
tar -zxvf apr-xxxxx.tar.bz
cd apr-xxxx ./configure --prefix=/usr/local/apr make make install
(2)安装apr-util
tar -zxvf apr-util-xxxxx.tar.bz
cd apr-util-xxxx ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make make install
(3)安装pcre
tar -zxvf pcre-xxxxx.tar.bz
cd pcre-xxxx ./configure --prefix=/usr/local/pcre make make install
3、编译apache并安装
编译命令如下:
./configure --with-mpm=worker --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --prefix=/usr/local/apache2
make make install
4、安装tomcat-connector
./configure --with-apxs=/usr/local/httpd安装目录/bin/apxs
make make install
教程如下:
http://blog.csdn.net/gtuu0123/article/details/5814475
5、tomcat配置集群
(1)配置httpd安装包中的conf/httpd.conf 中的ServerName=域名
(2)http://www.blogjava.net/pengo/archive/2011/04/15/348331.html
6、到httpd的安装路径下的bin目录下运行
./apachectl -k start
7、查询apache进程
ps -ef | grep httpd kill-9 pid
静态分离
http://heylinux.com/archives/1769.html