我们今天来学习一下如何安装源码包。以安装Apache为例(注意要把系统自带的删除掉)

   1.下载httpd源码包并解压

2.0.png

   2.安装Development tools包组(这个包组里有make等工具。)

2.1.png

   3.查看README INSTALL文件

   4.编译安装:

   (1)./configure --prefix=/app/apache22 --sysconfdir=/etc/apache22 --enable-rewrite

   (2)make(路径要在包里面)

   (3)make install (需root权限)

2.3.png

   5.将路径添加到PATH变量中,开启Apache

        export PATH=$PATH:/app/apache24/bin

        apachectl start

2.4.png

   6.清空防火墙

       centos7:systemctl stop firewalld.service

       systemctl disable firewalld.service

       centos6:service iptables stop

       service iptables save

2.5.png

   7.查看端口:

    netstat -tnl

2.7.png

   8.修改文件;并在浏览器打开

    vim /app/apache24/htdocs/index.html

2.8.png2.6.png