Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2741
  • 博文数量: 1
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 12
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-12 13:24
文章分类
文章存档

2015年(1)

我的朋友
最近访客

分类: LINUX

2015-10-18 19:49:41

原文地址:linux下手动安装apache详解 作者:andyhzw

操作系统:ubuntu12.04

前言:
    linux下,默认安装软件,在开发过程中会经常不知道到什么路径下找到所需的程序,因此手动安装程序对后续的使用会提供非常大的便利。在此,以安装apache为例。


一,准备
    1,安装 apr
        下载地址:

            [root@ubuntu:/work/soft/apache]# tar jxvf apr-1.5.0.tar.bz2

            [root@@ubuntu:/work/soft/apache/apr-1.5.0]# ./configure --prefix=/work/installed/apr

            [root@@ubuntu:/work/soft/apache/apr-1.5.0]# make

            [root@@ubuntu:/work/soft/apache/apr-1.5.0]# make install


    2,安装 apr-util
        下载地址:
            [root@ubuntu:/work/soft/apache]# tar jxvf  apr-util-1.5.3.tar.bz2

            [root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# ./configure --prefix=/work/installed/apr-util --with-apr=/work/installed/apr

            [root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make

            [root@@ubuntu:/work/soft/apache/apr-util-1.5.3]# make install


    3,安装 pcre
        下载地址:
            [root@ubuntu:/work/soft/apache]# tar jxvf  pcre-8.35.tar.bz2

            [root@@ubuntu:/work/soft/apache/pcre-8.35]# ./configure --prefix=/work/installed/pcre

            [root@@ubuntu:/work/soft/apache/pcre-8.35]# make

            [root@@ubuntu:/work/soft/apache/pcre-8.35]# make install


        注意:如果在安装 pcre 时,遇到问题:configure: error: You need a C++ compiler for C++ support.
        解决方法sudo apt-get install build-essential


二,安装apache
        下载地址:
            [root@ubuntu:/work/soft/apache]# tar jxvf  httpd-2.4.9.tar.bz2

            [root@@ubuntu:/work/soft/apache/httpd-2.4.9]#  ./configure --prefix=/work/installed/apache --with-apr=/work/installed/apr --with-apr-util=/work/installed/apr-util --with-pcre=/work/installed/pcre

            [root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make

            [root@@ubuntu:/work/soft/apache/httpd-2.4.9]# make install



三,配置
        1,修改配置文件
            否则会出现问题:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
            解决方法:
            [root@ubuntu:/work/installed/apache]# sudo gedit conf/httpd.conf 
            把:
                ServerName
            改为:
                ServerName localhost:80

    
        2,启动
            [root@ubuntu:/work/installed/apache]# ./bin/apachectl start
            

        3,开机启动
            打开文件:/etc/rc.local
            [root@ubuntu:/]# sudo gedit /etc/rc.local 

            添加:/work/installed/apache/bin/apachectl start
            

四,参考文件
1,http://blog.csdn.net/chenxiaohua/article/details/2047757
2,http://blog.163.com/hlz_2599/blog/static/142378474201182811611382/    

阅读(234) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~