免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1258 | 回复: 0
打印 上一主题 下一主题

Linux下tar安装apache服务 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-23 17:58 |只看该作者 |倒序浏览

               
在linux下安装apache的方法
首先从官方网站上下载httpd-2.2.3.tar.gz安装文件,将文件放在/usr/local目录下
下面开始开装httpd-2.2.3.tar.gz文件
1.# cd /usr/local                   //进入此目录
2.# tar zxvf httpd-2.2.3.tar.gz    //解压httpd-2.2.3.tar.gz
3.# cd httpd-2.2.3                //进入httpd-2.2.3目录
4.# mkdir -p /usr/local/apache    //生成/usr/local/apache目录
5.# ./configure \
  >--prefix=/usr/local/apache \
  >--enable-modules=so \
  >--enable-rewrite              // 检查目录
[注释:
–prefix      //指定安装目录   
–sysconfdir  //指定配置文件存放目录,即httpd.conf
–enable-mods-shared要以DSO
               加载的模块,most是大部分,还有可选all即全部  
–with-mpm  
//服务器处理请求的模式,是worker(多线程模式)还是prefork(多进程模式) –with-port  //端口

6.#make && make install         //安装apache
7.把httpd加入到系统服务中
# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
注释:注释:加入到系统服务中,就可以通过service httpd start|stop|restart等进行管理
8.把httpd加入到开机启动项中
先修改
# vi /etc/init.d/httpd
# chkconfig –add  httpd
# chkconfig httpd –level 345 on
9.# /usr/local/apache/bin/apachectl -k start //启动apahce
用浏览器查看http://localhost 得到 It Works说明apache已经配置成功了。
# /usr/local/apache/bin/apachectl -k stop //停止apache。
10.其他
这样安装,服务器默认根目录是/usr/local/httpd/htdocs,要更改该目录,可以在修改vim
/etc/httpd/httpd.conf 中的DocumentRoot,安装httpd后,一般新模块的安装一般通过
./configure的时候指定–with-apxs=/usr/local/httpd/bin/apxs即可,某些特殊模块有其独特编译安装方式
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/110103/showart_2158612.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP