Linux 环境下手工编译安装Apache
2018-05-24 12:19
447 查看
手工编译安装Apache
实验准备:
1.VMwore 12 环境下Red Hat 6.5版本虚拟机一台
2.相关软件包:apr、apr-util、httpd
备注:apache官网下载http://www.apache.org/ 将实验所需的软件包下载好,并解压到指定文件夹
``一、Apache安装
1.首先解压软件包http、apr、apr-util(支持Apache上层应用跨平台,提供底层接口库)至/opt目录下
tar xzvf http-2.4.2.tar.gz -C /opttar xzvf apr-1.4.6.tar.gz -C /opt
(支持Apache上层应用跨平台,提供底层接口库)
tar xzvf apr-util-1.4.1.tar.gz -C /opt
2.进入软件包目录,将apr和apr-util包复制到httpd目录下
cp -R apr /opt/httpd-2.4.2/srclib/aprcp -R apr-util /opt/httpd-2.4.2/srclib/apr-util
3.安装 gcc 、 gcc-c++ 、 make 、 pcre、pcre-devel 四个包
yum install gcc gcc-c++ make pcre pcre-devel -y4.进入httpd目录下,配置configure
cd /opt/httpd-2.4.25.配置
./configure \--prefix=/usr/local/apache \
--enable-so \
--enable-rewrite \
--enable-mods-shared=most \
--with-mpm=worker \
--disable-cgid \
--disable-cgi
6.编译及安装
make && make install7.过滤掉注释行(#)并复制 httpd服务文件到/etc/init.d/
grep -v "#" /usr/local/apache/bin/apachectl > /etc/init.d/httpd8.修改配置文件vim /etc/init.d/httpd 在文章的最下面插入下面的行
#!/bin/shchkconfig:2345 85 15
description:Apache is a World Wide Web server
9.给httpd文件添加执行权限
chmod +x /etc/init.d/httpd10.添加httdp服务,设置为init3、init5 时开机自启动。
chkconfig --add httpdchkconfig --list httpd
chkconfig --level 35 httpd on
11.建立/etc/httpd.conf文件的软链接,便于后期管理
ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf12.修改配置文件httpd.conf
vim /etc/httpd.confListen:#监听IP地址,这里修改为自己的本地IP地址。
ServerName:主机名.域名
13.重启httpd服务
service httpd shopservice httpd start
14.关闭防火墙
service iptables stopsetenforce 0
最终测试
如果出现上图界面就说明Apache已经安装成功了,另外主页存放路径为 /usr/local/apache/htdocs/index.html 可以在编辑此文件修改主页上的内容
相关文章推荐
- Linux环境下apache阿帕奇安装配置失败报错,编译失败的解决方案,Apache安装升级OpsenSSL步骤
- Linux+php+apache+oracle环境搭建之CentOS下源码编译安装PHP
- 在Linux上编译安装php开发环境(install apache)-2
- wdOS系统下源码编译安装LAMP环境(linux+apache+php+mysql)
- linux下LAMP环境配置之apache-2.4.27编译安装
- linux下LAMP环境配置之apache-2.4.27编译安装
- Linux环境编译安装Apache+PHP
- Linux下Php5+Mysql5+Apache2+GD2+Zend3最新版本软件编译安装步骤
- Apache Httpd在linux环境下安装配置指南
- Linux 环境编译安装MySQL 5.0.45
- LAMP攻略: LAMP环境搭建,Linux下Apache,MySQL,PHP安装与配置
- Apache服务器的编译安装和 LAMP 环境的构建
- Redhat5 Linux (Tikanga)下手工编译安装SVN Server.
- Linux下让编译安装的Apache自动启动
- Linux下让编译安装的Apache自动启动
- 在ubuntu linux下以编译方式安装LAMP(apache mysql php)环境
- Linux下配置交叉编译环境,配置编译内核及uboot安装
- apache1.3 + php5 linux环境下 个人安装总结
- Linux环境的AMP安装--APACHE安装
- 在ubuntu linux下以编译方式安装LAMP(apache mysql php)环境