Apache手工编译安装(内附软件包)
2018-08-28 23:55
766 查看
Apache http server 是开源软件的杰出代表,基于标准的HTTP网络协议提供网页浏览服务,apache服务器可以运行在Linux UNIX Windows等多种操作系统平台。
Apache的主要特点
开放源代码跨平台应用
支持各种Web编程语言
模块化设计
运行非常稳定
良好的安全性
环境部署
redhat6.5系统ip地址:192.168.100.101
相关软件包:百度云
1.查看系统是否安装httpd服务,如有卸载。
# rpm -q httpd httpd-2.2.15-29.el6_4.x86_64 # yum remove httpd -y
2.创建一个目录,挂载宿主机上的共享出来的apache软件包
# mkdir /abc # mount.cifs //192.168.100.3/linux /abc # ls /abc/LAMP apr-1.4.6.tar.gz apr-util-1.4.1.tar.gz httpd-2.4.2.tar.gz
3.解压Apache压缩包到/opt下
# tar zxvf httpd-2.4.2.tar.gz -C /opt # tar zxvf apr-1.4.6.tar.gz -C /opt # tar zxvf apr-util-1.4.1.tar.gz -C /opt
4.将解压后的包复制到/opt/httpd-2.4.2/srclib下分别改名为apr和apr-util
# cp -R apr-1.4.6/ httpd-2.4.2/srclib/apr # cp -R apr-util-1.4.1/ httpd-2.4.2/srclib/apr-util
5.yum安装相关环境包
# yum install gcc gcc-c++ make perl pcre-devel expat-devel libxml2-devel -y
6.配置软件模块
cd /opt/httpd-2.4.2 ./configure \ --prefix=/usr/local/apache \ --enable-so \ --enable-rewrite \ --enable-mods-shared=most \ --with-mpm=worker \ --disable-cgid \ --disable-cgi
配置信息
./configure \ --prefix=/usr/local/apache \ 安装路径 --enable-so \ 启动内核 --enable-rewrite \ 启动重写功能 --enable-mods-shared=most \ 模块共享 --with-mpm=worker \ 用户多进程 --disable-cgid \ 通用网关接口 --disable-cgi
7.编译安装
# make && make install
8.过滤apachectl的# 重定向保存到/etc/init.d/httpd中 (启动脚本)
# grep -v "#" /usr/local/apache/bin/apachectl > /etc/init.d/httpd # vi /etc/init.d/httpd 在开头插入下面 #!/bin/sh # chkconfig:2345 85 15 # description:Apache is a World Wide Web server.
9.给httpd脚本开启执行权限、添加服务
# chmod +x /etc/init.d/httpd //给httpd开启执行权限 # chkconfig --add httpd //添加httpd服务 # chkconfig --list httpd //查看httpd服务 # chkconfig --level 35 httpd on //把httpd服务的3 5开启
10.给httpd.conf 创建一个软连接 方便管理
# ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf # vim /etc/httpd.conf Listen:192.168.100.101:80 //修改监听IP #Listen:80 #ipv6的需要关闭 ServerName www.benet.com:80 //修改域名
11.重启httpd服务、关闭防火墙
# service httpd stop # service httpd star # service iptables stop # setenforce 0
12.修改首页内容测试
echo "<h1>this is web</h1>" > /usr/local/apache/htdocs/index.html
相关文章推荐
- 手工编译安装php后,重启apache时,libphp5.so: cannot restore segment prot after reloc: Permission denied 错误的解决办法
- 手工编译安装apache
- 手工编译安装apache
- Apache服务【手工编译安装】
- 手工编译安装Apache
- 搭建LAMP架构— 1、手工编译安装Apache
- Linux 环境下手工编译安装Apache
- 手工编译安装Apache网站(赠送源码包)
- LAMP论坛架构三部曲之一 手工编译安装Apache
- LAMP架构之手工编译安装Apache
- 用Linux虚拟机手工编译安装Apache
- 手工编译安装apache
- 深入理解软件包的配置、编译与安装
- linux apache(httpd)编译安装和启动
- [转]深入理解软件包的配置、编译与安装
- linux centos6.5 2.6.32-431.el6.x86_64 php5.5.9 apache2.4.7 mysql5 最新快速编译安装
- 编译安装apache-2.4.6
- LAMP-apache编译安装
- 深入理解软件包的配置、编译与安装
- ubuntu上编译安装apache2.4