1.apache简介我们经常要浏览网页,提供这样的服务是apache。提供apache服务的软件是httpd服务。
Apache支持許多特性,大部分通过编译的模块实现。這些特性從伺服器端的程式語言支援到身份認證方案。一些通用的语言接口支持Perl,Python,Tcl, 和PHP。流行的认证模块包括mod_access,mod_auth和mod_digest。其他的例子有SSL和TLS支持(mod_ssl),代理服务器(proxy)模块,很有用的URL重写(由mod_rewrite实现),定制日志文件(mod_log_config),以及过滤支持(mod_include和mod_ext_filter)。Apache日志可以通过网页浏览器使用免费的脚本AWStats或Visitors来进行分析。
apache的服务配置是非常有讲究的,我们首先来提供服务,包括Perl、Python、PHP。最后在提供服务的基础上要实现它的安全性。

上图就是我们apache服务器的一个基本架构。
--------------------------------------分割线 --------------------------------------
在Ubuntu 14.04 LTS系统中设置Apache虚拟主机 http://www.linuxidc.com/Linux/2014-06/102871.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
LAMP+Xcache 环境搭建 http://www.linuxidc.com/Linux/2014-05/101087.htm
-------------------------------------分割线 --------------------------------------
2.配置apache服务1)首先我们要来安装apache服务,安装文件是httpd:

还好,我们的httpd是已经安装了的。启动httpd服务,发现我们的主机名是需要修改的:

修改/etc/hosts文件,添加本机IP和域名之间的对照:


再次启动之后,我们发现之前的提示已经不见了:

服务终于启动了,我们的apache的默认发布目录是:/var/www/html,默认的发布文件是那个目录地下的index.html.
我们先简单的写一个index.html文件(就在默认发布目录底下创建):


我们可以看到这个文件对于任何人都是可读的:

接着我们来访问这个服务器:

呵呵,可是看不到所发布的内容。想想我们刚刚看到了权限是可读的,那问题应该是出在了防火墙上了。我们在没有涉及防火墙学习的情况下,先关闭它:


然后重启httpd服务,再次访问本服务器:

再次访问:

这次就可以看到了。