1、安装apr
yum -y install gcc gcc-c++ openssl-devel pcre-devel tar xf apr-1.4.6.tar.bz2 cd apr-1.4.6 ./configure --prefix=/usr/local/apr --disable-ipv6 make && make install
2、安装apr-util
tar xf apr-util-1.4.1.tar.bz2 cd apr-util-1.4.1 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make && make install
3、安装apache
tar zxf httpd-2.4.17.tar.gz cd httpd-2.4.17 ./configure \ ./configure \ --prefix=/usr/local/apache \ --sysconfdir=/etc/httpd \ --enable-so \ --enable-ssl \ --enable-cgi \ --enable-rewrite \ --with-zlib \ --with-pcre \ --with-apr=/usr/local/apr \ --with-apr-util=/usr/local/apr-util \ --enable-modules=most \ --enable-mods-shared=most \ --enable-mpms-shared=all \ --with-mpm=event make && make install
4、设置服务控制脚本
cp build/rpm/httpd.init /etc/init.d/httpd vim /etc/init.d/httpd httpd=${HTTPD-/usr/local/apache/bin/httpd} pidfile=${PIDFILE-/usr/local/apache/logs/${prog}.pid} lockfile=${LOCKFILE-/var/lock/subsys/${prog}} RETVAL=0 # check for 1.3 configuration check13 () { CONFFILE=/etc/httpd/httpd.conf echo "PATH=/usr/local/apache/bin:$PATH" >> /etc/profile.d/http.sh . /etc/profile.d/http.sh ln -s /usr/local/apache/include/ /usr/include/httpd vim /etc/httpd/httpd.conf ServerName localhost:80 chkconfig --add httpd chkconfig httpd on service httpd start
转载于:https://blog.51cto.com/linux10000/1717541