1.安装依赖软件
- pcre
- gcc
- expat
- apr(Apache portable Run-time libraries,Apache可移植运行库)
- apr-util
$ yum install gcc
$ yum install pcre-devel
$ yum install expat-devel
$ cd /usr/local/src
$ wget http://mirror.bit.edu.cn/apache//apr/apr-1.6.2.tar.gz
$ wget http://mirror.bit.edu.cn/apache//apr/apr-util-1.6.0.tar.gz
$ tar -zxvf apr-1.6.2.tar.gz
$ cd apr-1.6.2
$ ./configure --prefix=/usr/local/apr
$ make && make install
$ cd ..
$ tar -zxvf apr-util-1.6.0.tar.gz
$ cd apr-util-1.6.0
$ ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
$ make && make install
2.安装apache httpd server
$ cd..
$ wget http://mirrors.aliyun.com/apache/httpd/httpd-2.4.28.tar.gz
$ tar -zxvf httpd-2.4.28.tar.gz
$ cd httpd-2.4.28
$ ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so
$ make && make install
$ /usr/local/httpd/bin/apachectl start
$ ps -aux | grep http #查看进程检查apache是否正常启动
root 1215 0.0 0.2 70900 2136 ? Ss 12:06 0:00 /usr/local/httpd/bin/httpd -k start
daemon 1216 0.0 0.4 359864 4252 ? Sl 12:06 0:00 /usr/local/httpd/bin/httpd -k start
daemon 1217 0.0 0.4 359864 4252 ? Sl 12:06 0:00 /usr/local/httpd/bin/httpd -k start
daemon 1218 0.0 0.4 359864 4252 ? Sl 12:06 0:00 /usr/local/httpd/bin/httpd -k start
root 1305 0.0 0.0 112660 968 pts/0 R+ 12:07 0:00 grep --color=auto httpd