Ubuntu14.04配置Apache服务 (httpd-2.4.12)
来源:互联网 发布:淘宝网手机版 编辑:程序博客网 时间:2024/05/21 00:53
2015-02-19 wcdj
摘要:本文主要记录在Ubuntu14.04环境下通过源码编译方式配置Apache服务,当然也可以简便使用包管理工具apt-get install apache2来安装Apache。
1, 下载apache
http://httpd.apache.org/download.cgi#apache24
wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.12.tar.gz
2, 安装依赖
(1) 下载apr
http://apr.apache.org/download.cgi
wget http://apache.dataguru.cn//apr/apr-1.5.1.tar.gz
./configure && make && make install
(2) 下载apr-util
wget http://apache.dataguru.cn//apr/apr-util-1.5.4.tar.gz
./configure --with-apr=/usr/local/apr && make && make install
(3) 安装pcre
http://ftp.exim.llorien.org/pcre/
wget http://ftp.exim.llorien.org/pcre/pcre-8.36.tar.gz
注意:Ubuntu默认并不提供C/C++的编译环境,因此在安装pcre前需要先在Ubuntu安装C/C++环境。
sudo apt-get install build-essential
3, 编译apache
./configure --enable-so --with-mpm=prefork && make && make install
--with-mpm=MPM Choose the process model for Apache to use by
default. MPM={event|worker|prefork|winnt} This will
be statically linked as the only available MPM
unless --enable-mpms-shared is also specified.
http://php.net/manual/en/install.unix.apache2.php
4, 修改apache配置
vi /usr/local/apache2/conf/httpd.conf
(1) 修改端口,由于本机80端口已被其他服务占用,故更换为其他端口:
Listen 8081
(2) 将ServerName节点的注释去除:
ServerName www.example.com:80
5, 运行apache
/usr/local/apache2/bin/apachectl start
6, 测试
http://104.131.173.242:8081/
注意:在Ubuntu上,源码安装apache的web root路径是/usr/local/apache2/htdocs,而apt-get方式安装的apache2的web root路径是/var/www/html,且日志目录为/var/log/apache2。
参考
http://httpd.apache.org/docs/2.4/
http://httpd.apache.org/docs/2.4/mod/directives.html
- Ubuntu14.04配置Apache服务 (httpd-2.4.12)
- Apache服务以及httpd.conf配置详解
- 详解Apache服务以及httpd.conf配置
- Apache服务以及httpd.conf配置详解
- Apache服务以及httpd.conf配置详解
- httpd-apache服务
- Linux中Apache(httpd)安装、配置、加为服务
- CentOS 7.2 配置Apache服务(httpd)--上篇
- CentOS 7.2 配置Apache服务(httpd)--下篇
- Linux下Apache httpd安装及配置为服务
- CentOS 7.2配置Apache服务httpd(上)
- CentOS 7.2配置Apache服务httpd(下)
- CentOS 7.2 配置Apache服务(httpd)--上篇
- CentOS7.2配置Apache服务(httpd)--上篇
- web服务之httpd基础配置与源码安装apache
- Apache httpd 2.4 alias 别名配置
- Apache httpd安装配置
- httpd-apache服务器配置
- 使用 Zend Opcache 加速 PHP
- Android中连续点击版本号打开开发者选项的实现方式
- Drazil and Factorial - CodeForces 513 C 水题
- Shell文本处理 (4) sed、awk、diff、patch、
- fjnu2013校赛G
- Ubuntu14.04配置Apache服务 (httpd-2.4.12)
- Linux多线程实践(10) --使用 C++11 编写 Linux 多线程程序
- Drazil and Tiles - CodeForces 513 D 搜索
- struts2错误类型
- UIKit结构图
- DLX算法合集 I
- MQTT协议的特点
- C#WPF 格式化输出- IValueConverter接口的使用 Convert和ConvertBack
- Android中有四大组件的简单总结