Ubuntu14.04配置Apache服务 (httpd-2.4.12)
2015-02-19 18:24
716 查看
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服务,当然也可以简便使用包管理工具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
相关文章推荐
- CentOS Apache httpd cgi (CentOS上配置httpd服务运行cgi程序)
- Apache服务以及httpd.conf配置详解
- ubuntu14.04 server ftp 服务安装配置详解
- ZH奶酪:Ubuntu 14.04配置LAMP(Linux、Apache、MySQL、PHP)
- Ubuntu 14.04, Apache vhost 配置
- Ubuntu上配置SVN,Apache服务以及常见问题解决方法
- Ubuntu Apache配置文件httpd.conf
- Ubuntu 14.04配置nfs服务
- centos7 安装配置apache httpd服务
- 阿里云主机Ubuntu 14.04下安装php5.5.9+mysql+Apache配置多主机
- Ubuntu Server 14.04 配置邮件服务发送邮件
- Ubuntu 14.04 Web服务器--Apache的安装和配置
- CentOS6服务管理之WEB-Apache httpd配置文件详解
- Ubuntu 14.04 配置VNC服务 配置Xfce4桌面
- Ubuntu Apache 服务之 PHP 配置
- Ubuntu 14.04 mysql-apache-php 的安装和配置
- 离线配置ubuntu 14.04 web服务环境
- window下Apache-http-server(httpd-2.4.12)安装与配置
- ubuntu14.04配置Apache使用CGI
- Ubuntu 14.04 手动编译安装apache httpd 服务器