手机版
你好,游客 登录 注册
背景:
阅读新闻

Ubuntu 14.10下Apache的安装配置

[日期:2015-05-18] 来源:Linux社区  作者:chrisDuan [字体:大 中 小]

测试环境:Ubuntu Server 14.10

1、安装准备

a)        cd  /usr/local/src

b)        sudo  wget  http://mirror.bit.edu.cn/apache/apr/apr-1.5.1.tar.gz

c)        sudo  wget  http://mirror.bit.edu.cn/apache/apr/apr-util-1.5.4.tar.gz

d)        sudo            wget    http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.12.tar.gz

2、安装必要的工具

sudo  apt-get  install  libpcre3  libpcre3-dev openssl  libssl-dev

3、解压缩及配置

a)        tar –zxvf httpd-2.4.12

b)        tar –zxvf arp-1.5.1

c)        tar –zxvf arp-util-1.5.4

d)        cp –rf apr-1.5.1 httpd-2.4.12/srclinb/apr

e)        cp –rf apr-util-1.5.4 httpd-2.4.12/srclinb/apr-util

f)          cd httpd-2.4.12/

g)        sudo./configure .

--prefix=/usr/local/apache

--with-apr=/usr/local/apr

--with-apr-util=/usr/local/apr-util

--with-pcre=/usr/local/pcre

--with-included-apr

 --with-ssl

--enable-ssl

--enable-module=so

--enable-rewrite

--enable-cgid

--enable-cgi    #配置

注释: apache安装的check过程中出错

        Checking for APR-util…no

        Configure: error: APR-util not found. Please read the docummention.

                  需要在/usr/local目录下安装pcre

                  # tar -zxvf pcre-8.32.tar.gz

                #cd pcre-8.32

                #./configure--prefix=/usr/local/pcre

                #make

                #make install

h)        sudo make –j4

i)          sudo make install

                                           

4、安装完毕,进行简单配置

a)        sudo cp build/rpm/httpd.init /etc/init.d/httpd

b)        sudo chmod 755 /etc/init.d/httpd

c)        sudo ln -fs /usr/local/apache/ /etc/httpd

d)        sudo ln -fs /usr/local/apache/bin/httpd /usr/sbin/httpd

e)        sudo ln -fs /usr/local/apache/bin/apachectl /usr/sbin/apachectl

f)          sudo ln -fs /usr/local/apache/logs /var/log/httpd

g)        sudo ln -s /usr/local/apache/conf/httpd.conf /etc/

5、简单测试

a)        修改./apache/conf/httpd.cof配置文件

                      i.              查找到Listen 80,打开注释并修改为0.0.0.0:8081,80端口有可能被其他服务占用。

                      ii.              在DirectoryIndex中添加index.php

                      iii.              去掉以下2个注释:
1.# include conf/extra/httpd-mpm.cof
2.# include conf/extra /httpd-default.cof

                      iv.              查找到ServerName, 打开注释将ServerName的值修改为对应的IP地址

b)        保存httpd.cof文件的修改,启动apache服务

                        i.              sudo apachectl start

                      ii.              netstat –ant 查看httpd服务是否启动

c)        如果正常就可用IP:8081 访问 显示 It works!表示成功。

-------------------------------------我是分割线 -------------------------------------

Ubuntu下Apache的Rewrite如何启用  http://www.linuxidc.com/Linux/2010-10/29027.htm

Ubuntu 14.04中Apache 2.2升级到2.4后的几个要点 http://www.linuxidc.com/Linux/2015-01/111914.htm

Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm

CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm

RedHat 5.4下Web服务器架构之源码构建LAMP环境及应用PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm

LAMP源码环境搭建WEB服务器Linux+Apache+MySQL+PHP http://www.linuxidc.com/Linux/2013-05/84882.htm

--------------------------------------分割线 --------------------------------------

Apache 的详细介绍:请点这里
Apache 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-05/117656.htm

linux
相关资讯       Apache安装  Apache安装配置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载��引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款