一:依赖安装:apache依赖于apr,apr-util,pcre,所以需要先安装他,并且需要最新的

apr官网:http://apr.apache.org/download.cgi

pcre官网:http://www.pcre.org/

apr,apr-util 与 apache的关系:

http://www.cnblogs.com/Alight/p/3997777.html

apache与pcre的关系:

PCRE被广泛使用在许多开源软件之中最著名的莫过于Apache HTTP服务器和PHP脚本语言R脚本语言此外正如从其名字所能看到的PCRE也是perl语言的缺省正则库
PCRE是用C语言实现的其C++实现版本是PCRE++

今日编译apache时出错:

#./configure --prefix……检查编辑环境时出现:

checking for APR... no
configure: error: APR not found . Please read the documentation

解决办法:

1.下载所需软件包:

wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz  
wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip

2.编译安装:

yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs 

具体步骤如下:

a:解决apr not found问题>>>>>>

[root@xt test]# tar -zxf apr-1.4.5.tar.gz  
[root@xt test]# cd apr-1.4.5
[root@xt apr-1.4.5]# ./configure --prefix=/usr/local/apr
[root@xt apr-1.4.5]# make && make install

b:解决APR-util not found问题>>>>

[root@xt test]# tar -zxf apr-util-1.3.12.tar.gz  
[root@xt test]# cd apr-util-1.3.12
[root@xt apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config
[root@xt apr-util-1.3.12]# make && make install

c:解决pcre问题>>>>>>>>>

[root@xt test]#unzip -o pcre-8.10.zip  
[root@xt test]#cd pcre-8.10
[root@xt pcre-8.10]#./configure --prefix=/usr/local/pcre
[root@xt pcre-8.10]#make && make install

4.最后编译Apache时加上:

--with-apr=/usr/local/apr \

--with-apr-util=/usr/local/apr-util/ \

--with-pcre=/usr/local/pcre

成功编译完成~

二:编译Apache

[root@yahoo httpd-2.3.12-beta]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/  --with-pcre=/usr/local/pcre

[root@yahoo httpd-2.3.12-beta]# make
 [root@yahoo httpd-2.3.12-beta]# make install

[root@yahoo httpd-2.3.12-beta]# /usr/local/apache2/bin/apachectl start

三:把apache加到系统服务里去

Apache加入启动项里面:

echo '/usr/local/apache2/bin/apachectl start ' >> /etc/rc.local

Apache加入到系统服务里面:
cp /安装目录下/apache/bin/apachectl /etc/rc.d/init.d/httpd  (init.d中的脚本就相当于window中的注册表,在系统启动的时候某些指定的脚本被执行)
修改httpd
在文件头部加入如下内容:
###
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 90
# description:http server
###
保存
在打入
#chkconfig --add httpd
#chkconfig --level 345 httpd on

参考:

http://www.111cn.net/sys/linux/49030.htm

http://blog.csdn.net/kobe_lzq/article/details/7976787

linux 下 apache启动、停止、重启命令

基本的操作方法:
本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况

apahce启动命令:
推荐/usr/local/apache2/bin/apachectl start apaceh启动

apache停止命令
/usr/local/apache2/bin/apachectl
stop   停止

apache重新启动命令:
/usr/local/apache2/bin/apachectl restart 重启

要在重启 Apache 服务器时不中断当前的连接,则应运行:

/usr/local/sbin/apachectl graceful

如果apache安装成为linux的服务的话,可以用以下命令操作:

service httpd start 启动

service httpd restart 重新启动

service httpd stop 停止服务

Linux系统为Ubuntu

一、Start Apache 2 Server
/启动apache服务

# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start

二、 Restart Apache 2 Server
/重启apache服务

# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart

三、Stop Apache 2 Server
/停止apache服务

# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop

错误类型:

错误一:启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name

[root@server httpd-2.2.4]# /usr/local/apache/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
 
1)进入apache的安装目录:(视个人安装情况而不同) [root@server ~]# cd /usr/local/apache/conf
 
2)编辑httpd.conf文件,搜索"#ServerName",添加ServerName localhost:80
[root@server conf]# ls
extra  httpd.conf  magic  mime.types  original
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
3)再重新启动apache 即可。
[root@server ~]# /usr/local/apache/bin/apachectl restart

安装apache2.4.10的更多相关文章

  1. CentOS安装Apache-2.4.10+安全配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Nginx之前,请确保已经使用yum安装了各基础组件,并且配置了www用户和用户组,具体见<CentOS ...

  2. CentOS 编译安装Apache2.4.10

    1.准备编译环境 yum -y install gcc make cmake autoconf libtool libevent 安装apache必须的依赖包 yum -y install apr-u ...

  3. ubuntu 11.10 安装apache2 tomcat6

    ubuntu 11.10 安装apache2 tomcat6 导读 Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目 ...

  4. Windows+Apache2.4.10+PHP7.0+MySQL5.6.21安装

    一.安装包下载 apache2.4.10 http://www.apachelounge.com/download/win64/ PHP7.0.7 http://windows.php.net/dow ...

  5. Centos6.7安装Apache2.4+Mysql5.6+Apache2.4

    首先说下思路,因为一开始系统上已经跑了一套完成的 PHP 环境,那时候都是快速自动安装的,如果是跑一些5.3以下版本的话,很简单,几个指令,10分钟搞定了. 但现在要升级,彻底一点的话,唯有推倒重来了 ...

  6. Debian安装Apache2+MySQL5+PHP5(zz)

    转载:http://hi.baidu.com/lostdays/item/1d5e7e4833b4d20fc116134b 终于在Debian用apt-get安装好LAMP了,之前在CentOS使用编 ...

  7. linux下安装apache2.4

    linux安装Apache2步骤如下 apr 下载地址 http://mirrors.cnnic.cn/apache//apr/apr-1.5.2.tar.gz 安装过程 tar -xzvf apr- ...

  8. ubuntu 安装apache2,mysql,php5,phpmyadmin等软件

    1.安装apache2  sudo apt-get install apache2  输入Y回车  apache2 安装完成  检测:在浏览器输入localhost 出现It works则成功. 2. ...

  9. RedHat 6.5 离线安装 apache2.4.23

    第一部分:安装gcc等 rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm rpm -ivh cpp- ...

随机推荐

  1. Hadoop中的辅助类ToolRunner和Configured的用法详解

    在开始学习hadoop时,最痛苦的一件事就是难以理解所写程序的执行过程,让我们先来看这个实例,这个测试类ToolRunnerTest继承Configured的基础上实现了Tool接口,下面对其用到的基 ...

  2. TortoiseGit's Settings

    将鼠标停放在Settings-TortoiseGit窗体上的editbox,checkbox上,有些会弹出有用的提示信息. 2.35.1. General settings: 设定自己偏好的语言,Gi ...

  3. linux 从命令行自动识别文件并将其打开的命令

    若是shell是 zsh,则可: 使用 alias -s 定义后缀别名 (zsh) % alias -s pl=perl % script.pl perl script.pl % alias -s p ...

  4. windows平台下,快速删除所有.svn文件夹

    新建一个注册表文件名为:DELSVN.reg编辑其内容如下: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Cla ...

  5. Office 365 plans, SharePoint Online, and SharePoint 2013 on-premises 功能对比列表

    Andrew ConnellSharePoint大牛整理了一个各个版本SharePoint功能对比列表,是SharePoint相关人员必备资料.赶紧收藏起来. SharePoint 2013 Feat ...

  6. 面试题收集——Java基础部分(一)

    原博文出自于: http://www.cnblogs.com/xdp-gacl/p/3641769.html 感谢! 1.一个".java"源文件中是否可以包括多个类(不是内部类) ...

  7. 我所改造的JSocket适用于任何DELPHI版本

    JSOCKET是异步选择模式的通信控件,简单而强大,传奇的早期版本就是使用它作通信. { ******************************************************* ...

  8. Python的高级Git库 Gittle

    Gittle是一个高级纯python git 库.构建在dulwich之上,提供了大部分的低层机制 Gittle是一个高级纯python git 库.构建在dulwich之上,提供了大部分的低层机制. ...

  9. 转载sublime text注册码

    直接输入注册码就可以了 ----- BEGIN LICENSE ----- Andrew Weber Single User License EA7E-855605 813A03DD 5E4AD9E6 ...

  10. redis安装配置与测试

    phpredis: https://github.com/nicolasff/phpredis http://www.cnblogs.com/ikodota/archive/2012/03/05/ph ...