码迷,mamicode.com
首页 > Web开发 > 详细

apache2: 安装和配置

时间:2015-05-23 17:00:38      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:apache

LAMP:linux+apache+mysql+php

LNMP:linux+nginx+mysql+php


apacheweb服务器,依賴php,就像windowsIIS依赖ASP


nginxhttp和反向代理服务器,也是IMAP/POP3/SMTP代理服务器.


##############################################

apache安装和配置:


直接安装:

sudoapt-get install apache2

修改配置在web测试

/etc/apache2/apache2.conf

ServerName localhost:80


安装包安装:

apache2改名httpd,依赖aprapr-utilpcre


安装aprapr-util

cpapr apr-util httpd/srclib

cdhttpd/srclib/apr

./configure --prefix=/usr/local/apr

make

makeinstall


cdhttpd/srclib/apr-util

./configure --prefix=/usr/local/apr-util

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

make

makeinstall


安装pcre

cdpcre

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

make

makeinstall


安装apache:

./configure --prefix=/usr/local/apache2

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

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

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

make

makeinstall


更改配置:

sudovi /usr/local/apache2/conf/httpd.conf

ServerName localhost:80


启动服务:

/usr/local/apache2/bin/apachectl–k start/stop/restart


web测试:

http://localhost:80


web页面在/usr/local/apache2/htdocs/


很多应用依赖apache,需要根据需要修改配置即可.

直接安装的配置文件是: /etc/apache2/apache2.conf

手动安装的配置文件是: /usr/local/conf/httpd.conf


apache2: 安装和配置

标签:apache

原文地址:http://blog.csdn.net/wowotouweizi/article/details/45934855

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!