1、Apache 主要特点:
(1)开放源代码、跨平台应用
(2)支持多种网页编程语言。
(3)模块化设计、运行非常稳定、良好的安全性。
2、编译安装httpd服务器
准备工作: 卸载httpd及相关依赖包
rpm -e httpd --nodeps
解压缩软件包并进入源代码目录: tar zxf httpd--C /usr/src
cd /usr/src/httpd (*代表键盘上的Tab键)
配置: 检测系统是否满足安装要求
.configure --prefix=/usr/local/httpd --enable-so --enable-rewrite
选项:--prefix=/安装目录 指定软件安装目录的路径
-enbale-so 动态加载模块
--enable-rewrite 支持网页地址重写
编译: 将源代码转换为二进制文件
Make
安装: 将二进制文件复制到系统中
Make install
启动httpd服务:
/usr/local/httpd/bin/apachectl restart
3.httpd 主要目录和文件
服务器根目录:/usr/local/httpd 由--perfix指定
配置文件目录: conf
主配置文件名为: httpd.conf
网页目录: htdocs
执行程序目录: bin
启 动 命 令 :apachectl
日志目录: logs
有2个日志文件: 访问日志: access_log
错误日志: error log
语法检查命令: /usr/local/httpd/bin/apachectl -t