任务:在CENT6.8系统中安装Apache(版本为:httpd-2.4.41)

前提:由于源码包必须先编译后安装,所以必须先安装编译器:gcc

理论步骤

1.检测gcc软件包,如果不存在则进行安装。

2.下载Aache的源码包(压缩包形式)并上传到CENTOS服务器中

3.解压源码包后进入解压后的目录,执行配置,编译,安装。

  3.1 配置:使用 ./configure 进行安装目录的设置

3.2 编译:使用 make 命令直接执行

3.3 安装:使用 make install 命令直接执行。

4.如果无意外,按照“理论步骤',完成后即可在CENTOS服务器启用httpd服务(运行apache)中,使用浏览器访问

http://localhost/       或   http://127.0.0.1       或    http://192.168.253.129

实际过程:

检测gcc服务包:

[root@cent001 ~]# rpm -q gcc
gcc-4.4.7-23.el6.x86_64

说明gcc服务包已经安装。进入”理论步骤“2

下载Aache的源码包(压缩包形式)并上传到CENTOS服务器中:

访问:http://mirror.bit.edu.cn/apache/httpd/

找到:httpd-2.4.41.tar.gz  然后下载到本地。

然后通过FTP上传到CENTOS的个人源码包专用目录/usr/local/src  下边。进入”理论步骤“3

解压源码包

进入源码包压缩包的存储目录:

[root@cent001 ~]# cd /usr/local/src

解压httpd-2.4.41.tar.gz源码压缩包(会生成httpd-2.4.41目录):

[root@cent001 src]# tar -zxvf httpd-2.4.41.tar.gz 

查看解压后的源码包大小:(此操作不是必须)

[root@cent001 src]# du -sh httpd-2.4.41

46M httpd-2.4.41

进入源码包解压后目录:

[root@cent001 src]# cd httpd-2.4.41

开始进行”理论步骤“3.1

配置:使用 ./configure 进行安装目录的设置

执行命令进行配置:(注意:官方手册推荐使用 /usr/local/apache2 作为httpd的源码安装路径)

[root@cent001 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... no
configure: error: APR not found. Please read the documentation.

出现问题,大概意思是说apr软件包不存在,导致配置不成功,它还说让我们去读安装说明文档(目录中的INSTALL、README文档)

首先确认一下,是否apr软件包真不存在:

[root@cent001 httpd-2.4.41]# rpm -q apr
apr-1.3.9-5.el6_9.1.x86_64

很明显,apr软件包已经存在了,这跟配置出错提示的”APR not found“根本两相矛盾了。

所以,这时你就猜测地想到:依赖的apr版本冲突了,是完成操作,必须依赖于其它版本的apr。那重新指定依赖的版本行了吧,不使用默认的,于是:

[root@cent001 httpd-2.4.41]# ./configure -help | grep apr
--with-included-apr Use bundled copies of APR/APR-Util
--with-apr=PATH prefix for installed APR or the full path to
apr-config
--with-apr-util=PATH prefix for installed APU or the full path to

可以知道,利用--width-apr=PATH 可以通过配置apr安装目录来指定特定版本的apr,于是 ./configure 操作可以重新执行为如下形式:

[root@cent001 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2 --with-apr=能被正确依赖的apr版本的安装目录

这时要解决的问题是:

哪个(哪些)版本的apr能够被正确依赖(由于兼容性原因,猜测的话,一般最新版本最好,当然不排除最新版本的apr不兼容老旧版本的httpd的情况)

由于不是十分肯定是否最新版本apr(或其它软件包)能被正确依赖,我们在解决办法有两个:

办法-1。按照“Please read the documentation”的提示,去读INSTALLREADME文档,以便确定肯定我们上边的猜测。

办法-2。尝试安装某些版本的apr(或其它软件包)直到可行,比如尝试:apr-1.4.2等等。

*****先按照办法-1来进行,如果不行的话则进入办法-2。******

先按办法-1去做:

[root@cent001 httpd-2.4.41]# vim INSTALL

然后/apr 搜索一下,可以以下相关内容:

* Consider if you want to use a previously installed APR and
APR-Util (such as those provided with many OSes) or if you
need to use the APR and APR-Util from the apr.apache.org
project. If the latter, download the latest versions and
unpack them to ./srclib/apr and ./srclib/apr-util (no
version numbers in the directory names) and use
./configure's --with-included-apr option. This is required
if you don't have the compiler which the system APR was
built with. It can also be advantageous if you are a
developer who will be linking your code with Apache or using
a debugger to step through server code, as it removes the
possibility of version or compile-option mismatches with APR
and APR-Util code. As a convenience, prepackaged source-code
bundles of APR and APR-Util are occasionally also provided
as a httpd-2.X.X-deps.tar.gz download.

这段内容的大概意思是:

。。。。。。(不说了,看下边)==>

官方在线的安装说明文档(http://httpd.apache.org/docs/2.4/install.html)中还有一个比较简要的说明:

APR and APR-Util
Make sure you have APR and APR-Util already installed on your system. If you don't, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from Apache APR, unpack them into /httpd_source_tree_root/srclib/apr and /httpd_source_tree_root/srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution must be under /httpd_source_tree_root/srclib/apr/) and use ./configure's --with-included-apr option. On some platforms, you may have to install the corresponding -dev packages to allow httpd to build against your installed copy of APR and APR-Util.
apr 和 apr-Util

确保你系统中已经安装了apr和apr-Util。如果没有安装过,或者安装了却不想用它,那就下载最新版本的apr和apr-Util的源码压缩包并解压后放到:httpd源码目录/srclib/apr与 和 httpd源码目录/srclib/apr-util (命名中不要带版本号)。例如:

apr源码必须放在:httpd源码目录/srclib/apr 中,并且执行./configure时使用: --with-included-apr

上边的内容就我们当前的情况来举例,其操作原由和过程就是:

不想用内置的RPM版本的APR(因为默认使用时发生版本冲突),那就从网址:http://apr.apache.org/  中下载最新的apr与apr-util(其推荐版本为:apr-1.7.0.tar.gz 与 apr-util-1.6.1.tar.gz )

然后解压为:

apr-1.7.0  目录,重命名为 apr(即去掉版本号信息)

apr-util-1.6.1  目录,重命名为 apr-util(即去掉版本号信息)

将apr目录与apr-util目录复制(或剪贴)到  httpd源码目录(即:/usr/local/src/httpd-2.4.41/)

此时httpd源码目录为:

/usr/local/src/httpd-2.4.41/

/usr/local/src/httpd-2.4.41/apr

/usr/local/src/httpd-2.4.41/apr-util

。。。

最后,使用:./configure 时,用  --with-included-apr,这是因为:

[root@cent001 httpd-2.4.41]# ./configure -help | grep with-included-apr
--with-included-apr Use bundled copies of APR/APR-Util

可知:配置时使用--with-included-apr,会使用httpd源码目录/srclib/下的apr与apr-util
注意:不要被--with-included-apr 名称迷惑,它同时作用于apr与apr-util。也就是说,没有:--with-included-apr-util参数项。

以上便是官方中提到的说明,它提到的最重要的3条是:

1。最新版本(或当前推荐版本)的apr及apr-util是可用于当前各版本的httpd的,不会出现版本冲突。(我们之前遇到的问题“哪个(哪些)版本的apr能够被正确依赖” ,这1条就是答案---使用最新版本推荐版本

2。可以使用系统内置的apr和apr-util(我们之前使用的就是这种方式,然后遇到了问题,一步步解决后,剩下的版本问题,并最终到达了上边第1条)

3。一种用于配置依赖的源码放置方式及命令参数--with-included-apr进行./configure操作。

因为我想以源码包的形式手动安装apr与apr-util,所以暂时不按上边的第3条操作,而是根据第1条,回到我们先前的问题处,即:

[root@cent001 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2 --with-apr=最新版本或推荐版本的apr安装目录

由于指定的是“安装目录”,所以必须已进行了相应安装,才存在”安装目录“,我们还没有对最新版本或推荐版本的apr进行安装,于是,先进行安装推荐版本的apr:(假设已经下载并解压)

[root@cent001 apr-1.7.0]# ls
apr-1-config apr.spec config.layout emacs-mode libapr.rc misc README time
apr-config.in atomic config.log encoding libtool mmap README.cmake tools
apr.dep build config.nice file_io LICENSE network_io shmem user
apr.dsp buildconf config.status helpers locks NOTICE strings
apr.dsw build.conf configure include Makefile NWGNUmakefile support
apr.mak build-outputs.mk configure.in libapr.dep Makefile.in passwd tables
apr.pc CHANGES docs libapr.dsp Makefile.win poll test
apr.pc.in CMakeLists.txt dso libapr.mak memory random threadproc

[root@cent001 apr-1.7.0]# vim README

....

Configuring and Building APR on Unix
====================================

Simply;

./configure --prefix=/desired/path/of/apr
make
make test
make install

....

[root@cent001 apr-1.7.0]# ./configure --prefix=/usr/local/apr

[root@cent001 apr-1.7.0]# make

[root@cent001 apr-1.7.0]# make install

至此,最新版本(推荐版本)的apr源码安装成功。有了安装目录:/usr/local/apr,于是,开始执行以下操作:

[root@cent001 apr-1.7.0] cd /usr/local/src/httpd-2.4.41

[root@cent001 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr

checking for chosen layout... Apache

checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure:
configure: Configuring Apache Portable Runtime library...
configure:
checking for APR... yes
setting CC to "gcc"
setting CPP to "gcc -E"
setting CFLAGS to " -g -O2 -pthread"
setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... no
configure: error: APR-util not found. Please read the documentation.

出现的问题是apr-util找不到,根据之前的官方文档,发现与apr问题相似,于是,先安装推荐版本的apr-util(假设已经进行了下载和解压)

[root@cent001 apr-util-1.6.1]# ls
aprutil.dep build configure.in include Makefile.win redis
aprutil.dsp buildconf crypto ldap memcache renames_pending
aprutil.dsw build.conf dbd libaprutil.dep misc strmatch
aprutil.mak build-outputs.mk dbm libaprutil.dsp NOTICE test
apr-util.pc.in CHANGES docs libaprutil.mak NWGNUmakefile uri
apr-util.spec CMakeLists.txt encoding libaprutil.rc README xlate
apu-config.in config.layout export_vars.sh.in LICENSE README.cmake xml
buckets configure hooks Makefile.in README.FREETDS

[root@cent001 apr-util-1.6.1]# vim README

[root@cent001 apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... no
configure: error: APR could not be located. Please use the --with-apr option.

出现错误,要求用--with-apr 参数指明apr的安装路径,于是:

[root@cent001 apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

[root@cent001 apr-util-1.6.1]# make

此时出现错误信息有:

xml/apr_xml.c:35:19: 错误:expat.h:没有那个文件或目录
xml/apr_xml.c:66: 错误:expected specifier-qualifier-list before ‘XML_Parser’
xml/apr_xml.c: 在函数‘cleanup_parser’中:
xml/apr_xml.c:364: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:365: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c: 在文件层:
xml/apr_xml.c:384: 错误:expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
xml/apr_xml.c: 在函数‘apr_xml_parser_create’中:
xml/apr_xml.c:401: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:402: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:410: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:411: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:412: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:424: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:424: 错误:‘default_handler’未声明(在此函数内第一次使用)
xml/apr_xml.c:424: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
xml/apr_xml.c:424: 错误:所在的函数内也只报告一次。)
xml/apr_xml.c: 在函数‘do_parse’中:
xml/apr_xml.c:434: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:438: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c:442: 错误:‘apr_xml_parser’没有名为‘xp_err’的成员
xml/apr_xml.c:442: 错误:‘apr_xml_parser’没有名为‘xp’的成员
xml/apr_xml.c: 在函数‘apr_xml_parser_geterror’中:
xml/apr_xml.c:500: 错误:‘apr_xml_parser’没有名为‘xp_err’的成员
xml/apr_xml.c:500: 错误:‘apr_xml_parser’没有名为‘xp_err’的成员
make[1]: *** [xml/apr_xml.lo] 错误 1
make[1]: Leaving directory `/usr/local/src/apr-util-1.6.1'
make: *** [all-recursive] 错误 1

百度了一下,根据:https://blog.csdn.net/dn1115680109/article/details/80847924

于是对缺少的expat库进行安装:

[root@cent001 apr-util-1.6.1]# yum install -y  expat-devel

执行后就安装了:expat-devel.x86_64 0:2.0.1-11.el6_2,然后清理后再次编译:

[root@cent001 apr-util-1.6.1]# make clean

[root@cent001 apr-util-1.6.1]# make

[root@cent001 apr-util-1.6.1]# make install

至此,最新版本(推荐版本)的apr-util 源码安装成功。有了安装目录:/usr/local/apr-util,于是,开始执行以下操作:

[root@cent001  apr-util-1.6.1] cd /usr/local/src/httpd-2.4.41

[root@cent001 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util

...

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking how to run the C preprocessor... gcc -E

checking for gcc option to accept ISO C99... -std=gnu99

checking for pcre-config... false

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

出错原因:pcre模块没有配置。于是我们查看一下pcre:

[root@cent001 httpd-2.4.41]# rpm -q pcre

pcre-7.8-7.el6.x86_64

说明默认是有的,可能还是版本冲突原因,依据http://pcre.org/下载个最新版(如果该网上不去,可以换成https协议访问:https://pcre.org/ ,或者访问:https://sourceforge.net/projects/pcre/files/

下载最新版本的pcre(暂时不用:pcre2):pcre-8.43.tar.gz

[root@cent001 pcre-8.43]# ls

查看到有INSTALL安装说明文档

[root@cent001 pcre-8.43]# vim INSTALL

一些安装说明:

configure、make、make check、make install、make installcheck、

make maintainer-clean、make uninstall、make  distcheck、./configure --help

[root@cent001 pcre-8.43]# ./configure --prefix=/usr/local/pcre

[root@cent001 pcre-8.43]# make

[root@cent001 pcre-8.43]# make install

至此,最新版本的pcre 源码安装成功。有了安装目录:/usr/local/pcre,于是,开始执行以下操作:

[root@cent001  apr-util-1.6.1] cd /usr/local/src/httpd-2.4.41

[root@cent001 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util -with-pcre=/usr/local/pcre

...

configure: summary of build options:

Server Version: 2.4.41
Install prefix: /usr/local/apache2
C compiler: gcc -std=gnu99
CFLAGS: -g -O2 -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E

至此,httpd服务安装过程中的配置正确地完成,进入”理论步骤“3.2

编译:使用 make 命令直接执行

[root@cent001 httpd-2.4.41]# make clean

[root@cent001 httpd-2.4.41]# make

...

/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserCreate'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetUserData'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ErrorString'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetEntityDeclHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserFree'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetElementHandler'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_StopParser'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_Parse'
/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetCharacterDataHandler'
collect2: ld returned 1 exit status
make[2]: *** [htpasswd] 错误 1
make[2]: Leaving directory `/usr/local/src/httpd-2.4.41/support'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/usr/local/src/httpd-2.4.41/support'
make: *** [all-recursive] 错误 1

出错原因:猜测是由于apr-util引起的。

如果是这样的话,那么:之前猜想着“官方都极力推荐了那么应该没问题”是有问题的,apr-util推荐版本可以针对任何版本都可行这种想法就是错误的。

现在是真的是apr-util的问题吗?推荐版本的apr-util究竟是真的可靠吗?

明眼看上去,确实apr-util很有问题!官方办法行不通了,于是采用土法:

按办法-2去做

于是更换一下低版本的apr-util 来试试:

重新下载低版本的apr-util:

网址:http://archive.apache.org/dist/apr/  (此网址包含各版本的apr与apr-util,但速度较慢,建议使用百度搜索:archive.apache.org/dist/apr/  然后以百度快照 形式进入下载)

下载 apr-util-1.3.11.tar.gz  (下载速度太慢,有时真的下不动。推荐从其它地方下载)

然后进行解压。移除之前版本(直接重命名),进行当前版本安装:

[root@cent001 httpd-2.4.41]# cd /usr/local/

[root@cent001 local]# mv apr-util apr-util.bak2

[root@cent001 local]# cd /usr/local/src/apr-util-1.3.11

[root@cent001 apr-util-1.3.11]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

[root@cent001 apr-util-1.3.11]# make clean

[root@cent001 apr-util-1.3.11]# make

[root@cent001 apr-util-1.3.11]# make install

至此,apr-util已经替换为低版本,重新执行:

[root@cent001  apr-util-1.6.1] cd /usr/local/src/httpd-2.4.41

[root@cent001 httpd-2.4.41]# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util -with-pcre=/usr/local/pcre

[root@cent001 httpd-2.4.41]# make clean

[root@cent001 httpd-2.4.41]# make

至此,编译任务成功,进入”理论步骤“3.3

安装:使用 make install 命令直接执行

[root@cent001 httpd-2.4.41]# make install

至此,安装任务成功,进入”理论步骤“4

 这里直接说明了:”官方极力推荐的版本并不一定适用“,比如apr适用,而apr-util就不适用。

启用httpd服务(运行apache)中,使用浏览器访问

启动服务,使用:安装目录/bin/apachectl start    (要停止服务则使用:安装目录/bin/apachectl stop)

[root@cent001 httpd-2.4.41]# /usr/local/apache2/bin/apachectl start
AH00557: httpd: apr_sockaddr_info_get() failed for cent001
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

这种情况,可以参照 https://www.cnblogs.com/xiaoqian1993/p/6027907.html  ,进行2步修改:

1。修改HOSTS文件:

[root@cent001 httpd-2.4.41]# vim /etc/hosts

添加一行(注意其中的cent001为主机名):       127.0.0.1   localhost.localdomain localhost cent001

2。修改HTTPD配置文件:

[root@cent001 httpd-2.4.41]# vim /usr/local/apache2/conf/httpd.conf

查找#ServerName,添加一行:ServerName localhost:80

再次启动(或停止后再次启动):

[root@cent001 httpd-2.4.41]# /usr/local/apache2/bin/apachectl start
浏览:http://localhost/       或   http://127.0.0.1       或    http://192.168.253.129    

正常的话显示:It works!

httpd (pid 119873) already running

至此,整个httpd-2.4.41安装过程算是暂时可行。另外还有一些其它的问题:系统有时也默认安装了httpd服务(RPM形式):

如果是RMP包的APACHE可以直接进行如下操作:
查看RPM的APACHE版本:
[root@cent001 httpd-2.4.41]# rpm -q httpd
httpd-2.2.15-53.el6.centos.x86_64

或者:

[root@cent001 httpd-2.4.41]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: May 11 2016 19:28:33

查看RPM的APACHE状态:
[root@cent001 httpd-2.4.41]# service httpd status
httpd 已停

RPM的APACHE启动方式:

[root@cent001 httpd-2.4.41]# service httpd start

正在启动 httpd:                                           [确定]

[root@cent001 httpd-2.4.41]# service httpd status
httpd (pid 120138) 正在运行...

使用启动命令后没有出错信息的情况下,通过查询状态为“正在运行”就可以表明已经成功启动服务。

如果启动失败,信息如下显示时,则代表已经有服务占用了80端口(可能是源码包的APACHE已经启动了,要使用RPM的APACHE的话就可以先停止源码版的)
正在启动 httpd:(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[失败]

另外,如果像源码版的APACHE服务,启动时显示:

AH00557: httpd: apr_sockaddr_info_get() failed for cent001

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

则可以按照源码版,同时修改HOSTS文件及配置文件:

其中HOSTS文件是同一个(即说到HOSTS文件的时候,就是指:/etc/hosts

而RPM版的APACHE的配置文件,是在:/etc/httpd/conf/httpd.conf  (可以通过:# rpm -ql httpd | more  看到)

[root@cent001 httpd-2.4.41]# vim /etc/httpd/conf/httpd.conf

按照上边源码版的修改同样修改就可以!

==================================================================

END OF 《Apache源码包在LINUX(CENTOS6.8)中的安装(出现问题及解决)》

==================================================================

转载于:https://www.cnblogs.com/dreamyoung/p/11396094.html

Apache源码包在LINUX(CENTOS6.8)中的安装(出现问题及解决)相关推荐

  1. linux卸载tgz安装包,源码包(*.tgz与*.tar.bz2)安装与卸载

    一.安装源码包(*.tar.gz或*.tar.bz2) 1.查看源码包的文件列表 [root@Mylinux ~]# tar -ztvf   zip-2.3-27.tar.gz(或者tar   -jt ...

  2. 从桌面下载源码包到linux,Ubuntu kylin安装微信客户端过程(源码包安装方法)

    Ubuntu kylin 17.10系统自带的微信客户端不能使用,删除后重新用源码包安装就可以使用了.本文最后的相关主题采用的方法是通过Snap在Ubuntu中安装微信,源码包安装详细过程如下: 1. ...

  3. Linux下载源码编译出错,linux下fortran中编译代码时“undefined reference to `_gfortran_st_”错误...

    在linux系统下fortran与c/c++混合编译的时候出现下列的错误: /mnt/hgfs/subrar/ts/src/extra/../SAVE_DATAQ.f:117: undefined r ...

  4. Linux软件包管理之源码包、脚本安装包

    目录 1.源码包和RPM包的区别 RPM包和源码包默认安装位置: 由于安装位置不同带来的影响 2.源码包安装 ①.安装准备 ②.安装注意事项 ③.安装源码包 3.源码包卸载 4.脚本安装包 5.总结 ...

  5. linux源码编译rpm,Linux的RPM和源码包(CentOS)

    Liunx的软件包有源码包和二进制(RPM)包,源码包即是包含全部的源代码,绝大部分是使用c语言开发,其未经过编译,所以安装时要经过一系列编译,将其变成机器语言才能安装.RPM包是事先经过编译,其安装 ...

  6. linux安装更换yum源,更换YUM源,更换扩展源,源码包安装

    更换yum 源 将系统默认的安装源修改成国内的安装源 更换 更换扩展源 扩展源里有很多默认源没有的安装包 yum install -y epel-release yum 下载rpm 包 只下载不安装 ...

  7. RedHat6.4系统下LAMP环境的搭建---(源码包编译安装)---v1.0

    一:配置本地yum源 :--目录 作者:李文轩 座右铭:一个愿意为理想奋斗终生的人! 联系QQ:838997384 网站地址:www.74cto.com 说明:本篇安装的系统版本RedHat6.4(6 ...

  8. Linux-什么是二进制包,源码包,RPM包,软件仓库

    博文说明[前言]: 本文将通过个人口吻介绍什么是二进制包,RPM包,源码RPM包(SRPM包),源码包,以及RPM常用命令,源码rpm的安装(*.src.rpm),源码包的安装步骤知识(./confi ...

  9. centos5.8安装mysql_Centos5.8上面用Shell脚本一键安装mysql5.5.25源码包

    最近在研究mysql集群,至少要安装部署2台或者多台mysql数据库,操作起来即麻烦又很耗时,今天根据安装步骤写了一个Shell脚本,只需执 行以下脚本就可以快速安装mysql数据库,对初学者或者想学 ...

最新文章

  1. Python知识点1——基础
  2. SAP CRM中间件队列CSAPR_HIERR3MATCLASS
  3. leetcode1070. 产品销售分析 III(SQL)
  4. 【Web】JavaWeb开发技术笔记整理
  5. Postgresql的一些命令
  6. Bailian3711 字符串移位包含问题【字符串循环匹配】(POJ NOI0107-19)
  7. Android studio3.5调用Numcpp库方法
  8. centos7下安装zmap
  9. 精选 Hive 高频面试题11道,附答案详细解析(好文收藏)
  10. bilibili缓存视频批量转换成mp4格式,方便学习
  11. 三星有钱还是阿里有钱?
  12. MYSQL的字符串支持保存表情,比如微信表情
  13. Excel表格如何设置成不可编辑的模式?
  14. Android 模拟器硬件加速
  15. Adobe Acrobat 虚拟打印机安装方法
  16. 20个有用的iOS图标和应用模板资源
  17. Source Insight 4.0 代码自动排版 2019
  18. 回顾《JavaScript高级程序设计》目录篇
  19. windows系统流氓软件太厉害卸载不掉怎么办?看我弄死它们
  20. 【深度】人工智能或重演 2002 互联网泡沫 ! 95% 的企业会倒闭?

热门文章

  1. SQL Server Extended Events 进阶 3:使用Extended Events UI
  2. innodb force recovery
  3. 数据挖掘的一些经典算法
  4. Mnist数据集简介
  5. fcm算法的MATLAB实现,FCM算法的matlab程序(初步)
  6. mysql数据库验证登陆不上_MySQL数据库连接不上、密码修改问题
  7. java跨函数跳转_C语言中将绝对地址转换为函数指针以及跳转到内存指定位置处执行的技巧...
  8. mysql新建表96k_innodb表 手工导入导出
  9. xp系统安装oracle乱码,linux中安装Oracle汉字乱码完整解决方案
  10. oracle查询不走索引全表扫描,使用索引快速全扫描(Index FFS)避免全表扫描的若干场景-Oracle...