分类: 系统运维
2008-03-28 12:54:41
本文适用于apache
u 下载apache
从 下载httpd-
u 安装apache
将httpd-
#cd /usr/local
#tar zxvf httpd-
#cd httpd-
1. 编译和安装 apr 1.2
#cd srclib/apr
#./configure --prefix=/usr/local/http/apr-httpd/
#make
#make install
2. 编译和安装 apr-util 1.2
#cd ../apr-util
#./configure --prefix=/usr/local/httpd/apr-util-httpd/ --with-apr=/usr/local/httpd/apr-httpd/
然后执行
#make
#make install
u 配置 httpd
cd ../../
./configure --with-apr=/usr/local/httpd/apr-httpd/ --with-apr-util=/usr/local/httpd/apr-util-httpd/
然后执行:
#./configure --prefix=/usr/local/httpd/ --enable-so --enable-vhost-alias --enable-rewrite --enable-deflate -enable-ssl --enable-modules=so --with-mpm=worker --enable-proxy
#Make
#make install
u 相关步骤图解
#cd /usr/local/httpd/conf
#vi httpd.conf
u 修改
Listen 80
改为需要的ip和端口号例:Listen 172.20.16.200:80
u DocumentRoot
改为应用程序所在的目录例:/usr/local/jonas/webapps/autoload/ccb.war
u 将DirectoryIndex index.html index.html.var
更改为
DirectoryIndex index.shtm index.shtml index.jsp index.php
u #cd /usr/local/httpd/conf/extra
#vi httpd-mpm.conf
修改参数
ServerLimit 50
#ThreadLimit must >=ThreadsPerChild
ThreadLimit 200
StartServers 5
#MaxClients <= ServerLimit * ThreadsPerChild and must is ThreadsPerChild*N
MaxClients 5000
MinSpareThreads 25
#MaxSpareThreads must >=MinSpareThreads+ThreadsPerChild
MaxSpareThreads 500
ThreadsPerChild 100
MaxRequestsPerChild 0
u 相关步骤图解
1.启动
# cd /usr/local/httpd/bin
# ./apachectl start
2.停止
# cd /usr/local/httpd/bin
# ./apachectl stop
3.重新启动
# cd /usr/local/httpd/bin
# ./apachectl restart
# cd /usr/local/httpd/bin
# lsof –i:80
u 相关步骤图解
看到有进程启动。
u 在浏览器中输入本机ip地址,即可打开页面。