[LNMPA搭建四]Apache详细安装步骤
来源:互联网 发布:战地2 for mac 百度云 编辑:程序博客网 时间:2024/05/22 08:23
1.参考网址
主要参考网址:
http://blog.csdn.net/leshami/article/details/50144179
2.安装目录结构
3.准备工作
进入安装目录
cd /data/soft/mkdir apache
下载依赖包:
wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gzwget http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
下载apache 源码包:
wget http://archive.apache.org/dist/httpd/httpd-2.4.9.tar.gz
4.扩展库安装(2.4版本必须)
apr扩展安装
tar -xvf apr-1.5.2.tar.gzmkdir aprcd apr-1.5.2./configure --prefix=/data/soft/apache/aprmakemake install
错误说明:(./configure)
rm: cannot remove `libtoolT’: No such file or directory
解决方案:
编辑configure这个文件,将
RM“ cfgfile” 那行注释掉 ,然后重新编译即可。arp-util 扩展安装
tar -xvf apr-util-1.5.4.tar.gz mkdir apr-utilcd apr-util-1.5.4 ./configure --prefix=/data/soft/apache/apr-util --with-apr=/data/soft/apache/aprmakemake install
5.Apache安装
tar -xvf httpd-2.4.9.tar.gzmkdir apache2.4cd httpd-2.4.9./configure --prefix=/data/soft/apache/apache2.4 --with-apr=/data/soft/apache/apr --with-apr-util=/data/soft/apache/apr-util --sysconfdir=/data/conf/apache --enable-so --enable-cgi --enable-rewrite --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork --with-z=/data/soft/nginx/zlib --with-pcre=/data/soft/nginx/pcre --enable-ssl --with-ssl=/data/soft/nginx/opensslmakemake install
以下为几个主要的配置项
--sysconfdir=/etc/httpd24 指定配置文件路径 --enable-so 启动模块动态装卸载 --enable-ssl 编译ssl模块 --with-ssl=/data/soft/nginx/openssl 指明的openssl安装目录目录 --enable-cgi 支持cgi机制(能够让静态web服务器能够解析动态请求的一个协议) --enable-rewrite 支持url重写 --with-zlib 支持数据包压缩 --with-pcre=/data/soft/nginx/pcre --with-apr=/data/soft/apache/apr 指明的apr安装目录目录 --with-apr-util=/data/soft/apache/apr-util 指明的apr-util安装目录 --enable-modules=most 启用的模块 --enable-mpms-shared=all 以共享方式编译的模块 --with-mpm=prefork 指明httpd的工作方式为prefork
可能出现的错误:
错误一:ARP not find 解决方案:执行第四步骤
错误二:undefined SSLv2_client_method
undefined SSLv3_client_method
解决方案:
yum install openssl-devel
配置改为如下:
./configure --prefix=/data/soft/apache/apache2.4 --with-apr=/data/soft/apache/apr --with-apr-util=/data/soft/apache/apr-util --sysconfdir=/data/conf/apache --enable-so --enable-cgi --enable-rewrite --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork --with-z=/data/soft/nginx/zlib --with-pcre=/data/soft/nginx/pcre --enable-ssl --with-ssl
6.配置启动脚本及更改端口
cp /data/soft/apache/apache2.4/bin/apachectl /etc/init.d/httpdcd /etc/init.d/vi httpd
在第一行#!/bin/sh下一行添加如下几行
## chkconfig: 2345 10 90# description: Activates/Deactivates Apache Web Server#
让Apache服务加入到开机启动指令管理的服务列表中
chkconfig --add httpd
设置成开机启动
chkconfig httpd on vi /data/soft/apache/apache2.4/conf/httpd.conf
Listen 80 改为 Listen 8080
ServerName www.example.com 改为 ServerName localhost
service httpd start
浏览器浏览 http://ip:8080/ 显示 It works! 表示安装成功
本人本篇的研究笔记资料:链接:http://pan.baidu.com/s/1bpvMsQN 密码:gfsu
1 0
- [LNMPA搭建四]Apache详细安装步骤
- [LNMPA搭建三]mariadb详细安装配置步骤
- [LNMPA搭建六]Apache服务器详细【配置】
- [LNMPA搭建二]PHP详细安装搭建
- [LNMPA搭建七]PHP详细安装搭建【先安装Apache篇】
- [LNMPA搭建一]Nginx服务器详细安装
- [LNMPA搭建五]Nginx服务器详细【配置】
- [LNMPA搭建零]局域网linux安装(虚拟机)
- [LNMPA搭建六]PHP扩展安装
- Linux 下 安装 Apache 的详细过程以及安装步骤
- Centos7环境安装下安装Apache+php7+mysql详细步骤
- LNMP/LAMP/LNMPA安装
- LNMPA 一键安装
- 在mac系统安装Apache Tomcat的详细步骤
- 在mac系统安装Apache Tomcat的详细步骤
- 在mac系统安装Apache Tomcat的详细步骤
- 在mac系统安装Apache Tomcat的详细步骤
- 在mac系统安装Apache Tomcat的详细步骤
- 从按下键盘到屏幕上显示字符计算机经过了哪些过程
- POJ 2299 Ultra-QuickSort 树状数组
- Android开发-如何去掉一个页面的标题栏和状态栏
- Poj 2387 单源最短路径
- mybatis ForEach Collection集合等规范解析(转)
- [LNMPA搭建四]Apache详细安装步骤
- 伸展树(splay)
- python中的setattr的使用
- mac El Capitan+ brew update error 无法访问
- 所谓数据结构
- HDU1372 Knight Moves
- hdu1044 Collect More Jewels —— dfs + bfs
- vs如何运行外部 C++ 文件
- NYOJ小白的成长之路 A+B problem