阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Ubuntu 14.10下Apache的安装配置

116次阅读
没有评论

共计 2735 个字符,预计需要花费 7 分钟才能阅读完成。

测试环境: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

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-20发表,共计2735字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中