centos64位lamp配置第二步:源码编译apache2.2.25

首先去官网下载apache-2.2.25.tar.gz,然后安装需要的软件yum -y install wget gcc-c++ ncurses ncurses-devel cmake make perl bison openssl openssl-devel gcc* libevent libevent-devel libxml2 libxml2-devel  libmcrypt libmcrypt-devel curl-devel libpng-devel libtool-ltdl-devel libjpeg* libpng* freetype*。

        1.解压: tar -zxvf apache-2.2.25.tar.gz,建立mkdir /usr/local/apache目录

         2.进入apache-2.2.25目录,编译:./configure --prefix=/usr/local/apache --enable-vhost-alias --enable-rewrite --enable-ssl --enable-so --enable-info --enable-deflate=shared --enable-modules=speling

         3.编译完成后,make && make install

         4.复制初始化文件到/etc/init.d下,cp  build/rpm/httpd.init /etc/init.d/httpd

         5.设置apache开机启动:chkconfig --add httpd

chkconfig --level 345 httpd on

          6.vim /usr/local/apache/conf/httpd.conf,找到ServerName那一行,去掉前面的注释

         7.开机启动:

	

cp /opt/httpd-2.2.27/support/apachectl /etc/init.d/httpd

vi /etc/init.d/httpd

在文件开头加入下面几行:

#!/bin/sh

# chkconfig: 2345 85 15

# description: Apache is a World Wide Web server. 

chmod +x /etc/init.d/httpd

/sbin/chkconfig --add httpd

/sbin/chkconfig --list httpd

ln -s /sbin/chkconfig /usr/bin/chkconfig

ln -s /sbin/service /usr/bin/service

              

           启动:/etc/init.d/httpd start或service httpd start

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值