第6集 Apache源码编译与安装

发布于 2020-02-20  1480 次阅读


1.依赖包
yum -y install pcre-devel zlib-devel openssl-devel apr*

2.解压源码包
tar xzf httpd-2.4.41.tar.gz
cd httpd-2.4.41

2.编译安装
./configure --prefix=/usr/local/apache --enable-mpms-shared=all
make
make install

连写

./configure --prefix=/usr/local/apache --enable-mpms-shared=all && make && make install

3.配置文件检测
/usr/local/apache/bin/apachectl -t

4.修改配置文件
vi /usr/local/apache/conf/httpd.conf
ServerName 127.0.0.1:80

5.启动apache服务
/usr/local/apache/bin/apachectl start

6.apache服务开机启动
vi /etc/rc.local
/usr/local/apache/bin/apachectl start

7.关闭apache服务
pkill httpd

8.查看进程
pstree |grep httpd

9.查看端口
netstat -tunpl |grep httpd