码迷,mamicode.com
首页 > 其他好文 > 详细

centos6.4 源码安装httpd

时间:2014-05-13 04:25:29      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:centos6.4 源码 httpd

         什么是源码  编译器 可运行档

     在 Linux 系统上面,一个文件能不能被运行看的是有没有可运行的那个权限 (具有 x permission),不过,Linux 系统上真正认识的可运行档其实是二进位文 ( binary program), /usr/bin/passwd, /bin/touch 这些个文件即为二进位程序码

     在 Linux 上面最标准的程序语言为 C ,所以我使用 C 的语法进行原始程序码的书写,写完之后,以 Linux 上标准的 C 语言编译器 gcc 这支程序来编译,就可以制作一支可以运行的 binary program 罗

      

  • 开放源码:就是程序码,写给人类看的程序语言,但机器并不认识,所以无法运行; 

  • 编译器:将程序码转译成为机器看的懂得语言,就类似翻译者的角色; 

  • 可运行档:经过编译器变成二进位程序后,机器看的懂所以可以运行的文件。 

 

        操作系统    centos 6.4 x86_64(最小化安装)

        安装前提    Development Tools,Server  Platform Development,Desktop Platform Development

        安装软件    httpd-2.2.25.tar.bz2  

 

        如不是最小化安装  请先检查系统中是否已安装 httpd,   rpm -q httpd 如安装请先卸载

        rpm -e httpd

        error: Failed dependencies:
        httpd >= 2.2.0 is needed by (installed) gnome-user-share-2.28.2-3.el6.x86_64

        出现以上提示  是RPM 包存在依赖关系 需先卸载gnome-user-share

        rpm -e gnome-user-share

        rpm -e httpd

 

        现在可以安装httpd

        上传 httpd-2.2.25.tar.bz2 到服务器上 (可以事先YUM安装lrzsz,方便上传)

         放在/usr/local/ 目录下

        1 解压缩

           tar -jxvf  httpd-2.2.25.tar.bz2 

 

        2 cd httpd-2.2.25

           ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite

            --prefix=/usr/local/apache 安装目录

            --enable-so                      允许模块化使用

            --enable-rewrite                允许地址重写

            检查一下有无错误,没有错误提示,继续

        3  make

        4  make install

        安装完成后,进入安装目录 /usr/local/apache, bin目录下可以看到apachectl文件

        1 在当前目录 ./apachectl start

        2 /usr/local/apache/bin/apachectl start

        如要想直接使用 apachectl start 启动,需配置PATH变量

        在 /etc/profile.d/下新建有一个httpd.sh 文件

        Vim  /etc/profile.d/httpd.sh

        export PATH=/usr/local/apache/bin/apachectl:$PATH

        保存退出

        使系统重新读取配置文件  source /etc/profile.d/httpd.sh

        

        为使系统认识到httpd软件的库文件 头文件 帮助文件  需要如下配置

        库文件

        在 /etc/ld.so.conf.d/目录下新建 httpd.conf

        vim /etc/ld.so.conf.d/httpd.conf

        /usr/local/apache/lib

        保存退出

        让系统重新生成库文件缓存

         ldconfig -v

        ldconfig -p | grep /usr/local/apache/lib

        可以看到系统认识到的httpd的库文件

        

        头文件

        ln -sv /usr/local/apache/include /usr/include/httpd

 

        帮助文件

        Vim /etc/man.conf

         添加一行

         MANPATH=/usr/local/apache/man

        保存退出

    

        启动服务

        apachectl start

        查看IP地址

        ifconfig eth0  

        打开浏览器输入IP

        it works

        安装成功

 

 

 

 

 

 

  

 

centos6.4 源码安装httpd,布布扣,bubuko.com

centos6.4 源码安装httpd

标签:centos6.4 源码 httpd

原文地址:http://168322.blog.51cto.com/158322/1409709

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!