在Centos7上源码编译httpd

在Centos7上源码编译httpd

安装源码包

首先在http://httpd.apache.org下载所需要的安装包
小编在这里下载的是httpd-2.4.27.tar apr-1.6.2.tar apr-util-1.6.0.tar
首先编译安装apr-1.6.2.tar.gz 
#1 tar -zxf apr-1.6.2.tar.gz #先解压安装包
#2 cd apr-1.6.2/#cd到解压的目录下
#3 ./configure --prefix=/usr/local/apr#指定安装的路径
#4 make && make install
#1 然后安装apr-util-1.6.0.tar.gz
#2 cd apr-util-1.6.0/
#3 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
#4 make && make install
#5 yum install pcre-devel
#1 最后安装httpd-2.4.27.tar.bz2 
#2 tar -jxf httpd-2.4.27.tar.bz2
#3 cd httpd-2.4.27/
#4 ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --sysconfdir=/etc/httpd
#5 make && make install

安装好后的配置

#1 导出二进制程序目录至PATH环境变量中,编辑文件/etc/profile.d/NAME.sh 
#2 echo "export PATH=/usr/local/httpd/bin/:$PATH" > /etc/profile.d/httpd.sh
#3 source /etc/profile #重读
#4 systemctl stop firewalld.service #关闭防火墙
#5 netstat -nltp|grep 80
#6 如果发现80端口没有处在监听状态
#7 cd /usr/local/httpd/conf/
#8 vim httpd.conf
#9 找到#ServerName www.example.com:80 把#号去掉
#10 然后运行httpd start 就ok拉

然后在浏览器上输入你虚拟机的地址测试下

在Centos7上源码编译httpd

原创文章,作者:N27_flypig,如若转载,请注明出处:https://www.178linux.com/85249

赞 (2)
N27_flypigN27_flypig
上一篇 2017-08-21 20:53
下一篇 2017-08-21 21:46

相关推荐

  • Linux 基础知识(六.二)

    1、复制/etc/rc.d/rc.sysinit至/tmp目录,将/tmp/rc.sysinit文件中的以至少一个空白字符开头的行的行首加# [root@server01 tmp]# cp /etc/rc.d/rc.sysinit /tmp/ [root@server01 tmp]# sed -n "s@^[[:space:]]\+@#&@…

    Linux干货 2016-11-14
  • 磁盘管理

    磁盘管理

    Linux干货 2017-10-27
  • nmap ncat tcpdump浅析

    nmap 的使用 nmap — 网络探测工具和安全/端口扫描器 Usage:nmap [ <扫描类型> …] [ <选项> ] { <扫描目标说明> } 扫描目标说明 -iL inputfilename (从列表中输入) 从 inputfilename中读取目标说明 [root@localhost&…

    Linux干货 2017-03-15
  • 源码安装http

    http://xxlii.blog.51cto.com/10277731/1841570     哈哈!

    Linux干货 2016-08-24
  • Linux 常用命令之cp,一个可以煮饭的工具;

    cp 复制目录和文件 对于系统管理员来说,在文件系统中将文件和目录从一个位置复制到另外一个位置是家常便饭,而cp就是可以煮饭的工具之一。cp需要源对象和目标对象,源对象在前,目标对象在后面。 1. 常用选项 基本用法 [root@local tmp]# ll total 0 -rw-rw-r–. 1 gen…

    Linux干货 2016-08-02
  • 第六周作业

    1、复制/etc/rc.d/rc.sysinit文件至/tmp目录,将/tmp/rc.sysinit文件中的以至少一个空白字符开头的行的行首加#;          cp/etc/rc.d/rc.sysinit /tmp/     &nbs…

    Linux干货 2017-09-04