首页 > 代码库 > httpd的编译安装
httpd的编译安装
1.环境介绍
系统:2.6.32-279.el6.i686
2.准备编译环境
[root@localhost ~]# yum groupinstall "Server Platform Development" "Development tools" -y[root@localhost ~]# yum install pcre-devel -y
3.下载安装需要软件
[root@localhost ~]# cd /usr/src #切换到src目录[root@localhost ~]# wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz #下载apr文件[root@localhost src]# wget ftp://ftp.mirrorservice.org/sites/ftp.apache.org/apr/ apr-util-1.5.4.tar.gz #下载apr-util文件[root@localhost src]# wget http://mirrors.cnnic.cn/apache//httpd/ httpd-2.4.25.tar.bz2 #下载httpd文件[root@localhost src]# lsapr-1.5.2.tar.gz apr-util-1.5.4.tar.gz debug httpd-2.4.25.tar.bz2 kernels
4.安装apr,apr-tuil
[root@localhost src]# tar xf apr-1.5.2.tar.gz #解压[root@localhost src]# cd apr-1.5.2[root@localhost apr-1.5.2]# ./configure --prefix=/usr/local/apr/ #编译[root@localhost apr-1.5.2]# make && make install #安装
[root@localhost src]# tar xf apr-util-1.5.4.tar.gz [root@localhost src]# cd apr-util-1.5.4[root@localhost apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr [root@localhost apr-1.5.2]# make && make install
5.编译httpd
[root@localhost src]# tar xf httpd-2.4.25.tar.bz2 [root@localhost src]# cd httpd-2.4.25[root@localhost httpd-2.4.25]# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --enable-modules=most --enable-mpms-shared=all --with-mpm=event --with-include-apr[root@localhost httpd-2.4.25] make && make install
6.其他必要的配置
[root@localhost httpd-2.4.25]# ln -sv /etc/httpd24/ /etc/httpd #创建符号链接`/etc/httpd‘ -> `/etc/httpd24/‘[root@localhost httpd-2.4.25]# vim /etc/profile.d/httpd.sh #添加path变量[root@localhost httpd-2.4.25]# cat /etc/profile.d/httpd.sh export PATH=/usr/local/apache/bin:$PATH[root@localhost httpd-2.4.25]# source /etc/profile.d/httpd.sh #生效httpd.sh文件[root@localhost httpd-2.4.25]# httpd -v #查看版本Server version: Apache/2.4.25 (Unix)Server built: Apr 3 2017 19:00:32[root@localhost httpd-2.4.25]# vim /etc/man.config #配置man文档#添加行MANPATH /usr/local/apache/man
7启动httpd
[root@localhost httpd-2.4.25]# apachectl start #启动AH00558: httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain. Set the ‘ServerName‘ directive globally to suppress this messagehttpd (pid 2863) already running[root@localhost httpd-2.4.25]# elinks -source 192.168.168.152 #测试网页<html><body><h1>It works!</h1></body></html>
httpd的编译安装
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。