【apache http server安装】CentOS上编译安装Aapche Http Server详细过程

  1. 下载apache httpd

# wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.4.10.tar.gz

2. 解压 apache httpd

# tar xzvf httpd-2.4.10.tar.gz

  1. 编译apache httpd

[[email protected]]# ./configure

checkingfor chosen layout... Apache

checkingfor working mkdir -p... yes

checkingfor grep that handles long lines and -e... /bin/grep

checkingfor egrep... /bin/grep -E

checkingbuild system type... i686-pc-linux-gnu

checkinghost system type... i686-pc-linux-gnu

checkingtarget system type... i686-pc-linux-gnu

configure:

configure:Configuring Apache Portable Runtime library...

configure:

checkingfor APR... no

configure:error: APR not found.  Please read thedocumentation.

说明需要先安装apr, apr-util和prce后再编译httpd

3. 安装apr

# wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.1.tar.gz

# wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.3.tar.gz

#tar xzvf apr-1.5.1.tar.gz

#cd apr-1.5.1.tar.gz

# ./configure--prefix=/usr/local/apr

#make

#make install

安装apr-util

#tar xzvf apr-util-1.5.3.tar.gz

#cd apr-util-1.5.3

# ./configure --prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config

#make

#make install

4. 安装c++编译器

yum -y install gcc

# yum -y install gcc-c++

5. 安装prce

#wget  http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.35%2F&ts=1407339176&use_mirror=jaist

# tar xzvf pcre-8.35.tar.gz

#cd pcre-8.35

#./configure --prefix=/usr/local/pcre

#make & make install

6. 编译httpd

# ./configure --prefix=/usr/local/apache2--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/  --with-pcre=/usr/local/pcre

#make & make install

7. 将80端口在防火墙上关闭或者关闭防火墙

#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT

#/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT

#/etc/rc.d/init.d/iptables save

重启计算机后,防火墙默认已经开放了80和22两个端口。

临时性的完全关闭防火墙,可以不重启机器:

#/etc/init.d/iptables status                ##查看防火墙状态

#/etc/init.d/iptable stop                   ## 本次关闭防火墙

#/etc/init.d/iptable restart               ## 重启防火墙

或者永久性关闭防火墙:

#chkconfig --level 35 iptables off   ## 注意中间的是两个英式小短线;重启

8. 启动apache httpd

/usr/local/apache2/bin/apachectl

9. 在浏览器中输入:http://192.168.146.128/  显示It works 页面则表示apachehttp server安装成功了!

【apache http server安装】CentOS上编译安装Aapche Http Server详细过程

时间: 2024-08-07 04:07:40

【apache http server安装】CentOS上编译安装Aapche Http Server详细过程的相关文章

CentOS上编译安装OpenCV-2.3.1与ffmpeg-2.1.2

已测试环境: CentOS 6.3 32bit CentOS 6.5 64bit 曾经在CentOS 6.3 32bit安装过OpenCV,参见CentOS 6.3中安装OpenCV2.3.1,如今换了64bit系统,大刀阔斧,重新来一遍. 检查并安装相关程序,确保gtk安装成功,否则无法显示图片 yum install gcc-c++ # g++编译 yum install gtk-devel # 反正是gtk神马的,不一定就是gtk-devel,可以使用*gtk-devel*匹配 yum i

在CentOS上编译安装MySQL+安装问题解决+安全优化

0.说明 当然,MySQL的安装方法多种多样,在CentOS上,你可以采用YUM的方式安装,这样的好处是:快速方便.基本上,它会帮你解决所有的函数库依赖问题,正常情况下,只要YUM执行完成,那么MySQL也就可以使用了. 但我更倾向于使用编译的方式来安装MySQL,原因也很简单:除了有详细的官方文档外,你还可以非常清楚地知道你自己在做什么,这点在以后MySQL运行出现问题时将会有很大的帮助! 但即便是按照官方文档来安装,你也会遇到各种各样的问题,这里,我将呈现一个完整的过程给大家,直到完成下面的

在CentOS上编译安装Nginx+实验环境搭建+测试

0.说明 Nginx作为一款优秀的Web Server软件同时也是一款优秀的负载均衡或前端反向代理.缓存服务软件,很有必要搭建实验环境来对其进行学习. 1.实验环境 本次实验的测试环境使用的宿主机操作系统为Windows 7,在Vmware虚拟机安装CentOS 6.5,说明如下: 宿主机操作系统Windows 7 虚拟机安装的操作系统CentOS 6.5 虚拟机操作系统上网方式NAT 而当使用NAT的方式进行上网时虚拟机.宿主机之间的网络连接关系可如下所示: 关于为什么网络拓扑结构是这样的,这

在Centos上编译安装nginx

实验环境: OS: CentOS 6.6 nginx:nginx-1.6.2.tar.gz 前期准备:安装开发包组件[[email protected] tmp]# yum -y groupinstall "Development tools" "Server Platform Development"[[email protected] tmp]# yum -y install pcre-devel 一. 编译安装: [[email protected] tmp]

在CentOS上编译安装PostgreSQL

http://my.oschina.net/tashi/blog 第一步:准备阶段 获取必需软件包: CentOS中查看是否安装了某个软件的命令:rpm -qa | grep 软件名.which命令可查看某个软件的安装路径.使用 yum install 包名 来安装软件包. 1.GNU make的版本3.80以上[[email protected] ~]# rpm -qa | grep makemake-3.81-20.el6.x86_64 [[email protected] ~]# make

在centos上编译安装mariadb数据库

一.安装前提(准备数据文件.安装其他依赖的软件) 1.准备数据存放的目录 [[email protected] ~]# fdisk /dev/sdb  (fdisk /dev/sdb 创建一个逻辑分区/dev/sdb1)Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0xa592b3

CentOS 7上编译安装 apache 2.4.25

在CentOS 7上编译安装 apache 2.4.25 源码包,并启动此服务. 配置环境 Systemctl disable firewalld Systemctl stop firewalld /etc/selinux/config 关闭selinux Sed –i 's/SELINUX=enforcing/SELINUX=disable/' /etc/selinux/config 重启生效(getenforce查看是否生效) yum install gcc apr-devel apr-ut

CentOS 6上编译安装AMP详解

在CentOS 6上编译安装AMP     A:Apache(httpd)     M:MySQL or MariaDB     P:php 目录: 一.准备工作 二.编译安装Apache(httpd) 三.编译安装MariaDB 四.编译安装PHP 编译安装AMP的优点: 根据生产环境灵活定制程序 优化编译参数,提高性能 解决不必要的软件依赖 一.准备工作 1.需要的软件包及版本号: httpd-2.4.27(apr-1.5.2+ apr-util-1.5.4) + MariaDB-5.5.5

Centos 7编译安装 LAMP 环境

前言 LAMP 是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写 L:Linux 操作系统 A:Apache(httpd) 网页服务 M:MySQL(mariadb) 数据库服务 P:php/perl/python/ruby 脚本编程语言 本文主要以centos 7的环境下进行安装,centos 6兼带部分说明 一.http2.4的安装 Centos 7默认安装httpd 2.4,Centos 6默认安装httpd2.2 Centos 7:如果未安装http2.4,则通过yu