源码安装Apache

一、下载Apache,源码安装Apache

#下载
[root@localhost opt]# wget -c https://mirrors.aliyun.com/apache/httpd/httpd-2.4.58.tar.gz
[root@localhost opt]# ls
httpd-2.4.58.tar.gz
[root@localhost opt]# tar -xf httpd-2.4.58.tar.gz 
[root@localhost opt]# ls
httpd-2.4.58  httpd-2.4.58.tar.gz
[root@localhost opt]#
[root@localhost opt]# cd httpd-2.4.58

#安装PCRE APR相关优化模块
[root@localhost httpd-2.4.58]# yum  install  pcre-devel apr apr-devel apr-util apr-util-devel –y

#预编译Apache,启用rewrite规则,启用动态加载库。
[root@localhost httpd-2.4.58]# ./configure --prefix=/usr/local/apache2/ --enable-rewrite --enable-so

#编译安装
[root@localhost httpd-2.4.58]# make && make install

#启动服务
[root@localhost opt]# ps -ef |grep apache2
root      40275   7750  0 11:31 pts/0    00:00:00 grep --color=auto apache2
[root@localhost opt]# /usr/local/apache2/bin/apachectl start
[root@localhost opt]# ps -ef |grep apache2
root      40279      1  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
daemon    40280  40279  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
daemon    40281  40279  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
daemon    40282  40279  0 11:31 ?        00:00:00 /usr/local/apache2//bin/httpd -k start
root      40365   7750  0 11:31 pts/0    00:00:00 grep --color=auto apache2
[root@localhost opt]#

二、浏览器测试
输入主机地址:http://192.168.145.129
源码安装Apache_第1张图片

你可能感兴趣的:(apache)