[CentOS 7系列]源码包安装

前端之家收集整理的这篇文章主要介绍了[CentOS 7系列]源码包安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

源码包相对yum的安装方式来说,是一种很复杂的安装方式。中间涉及的每一步出错,会导致安装失败。因此在安装源码包的时候,每一步我们都要使用“echo $?”命令查看运行是否正常,确保源码包能够无误的安装上。


源码包的安装主要分为三个步骤:

1、./configure 配置参数

2、make 编译

3、make install 编译安装


下面将演示安装Apache:

[root@server01src]#ls
httpd-2.2.32httpd-2.2.32.tar.gz
[root@server01src]#cdhttpd-2.2.32
[root@server01httpd-2.2.32]#./configure--prefix=/usr/local/apache2
......
config.status:creatingsupport/dbmmanage
config.status:creatingsupport/envvars-std
config.status:creatingsupport/log_server_status
config.status:creatingsupport/logresolve.pl
config.status:creatingsupport/phf_abuse_log.cgi
config.status:creatingsupport/split-logfile
config.status:creatingbuild/rules.mk
config.status:creatingbuild/pkg/pkginfo
config.status:creatingbuild/config_vars.sh
config.status:creatinginclude/ap_config_auto.h
config.status:executingdefaultcommands
[root@server01httpd-2.2.32]#echo$?##如果显示不正常,可能是gcc没有安装
0##返回0表示运行正常
[root@server01httpd-2.2.32]#make
......
gcc-g-O2-pthread-DLINUX-D_REENTRANT-D_GNU_SOURCE-I/usr/local/src/httpd-2.2.32/srclib/pcre-I.-I/usr/local/src/httpd-2.2.32/os/unix-I/usr/local/src/httpd-2.2.32/server/mpm/prefork-I/usr/local/src/httpd-2.2.32/modules/http-I/usr/local/src/httpd-2.2.32/modules/filters-I/usr/local/src/httpd-2.2.32/modules/proxy-I/usr/local/src/httpd-2.2.32/include-I/usr/local/src/httpd-2.2.32/modules/generators-I/usr/local/src/httpd-2.2.32/modules/mappers-I/usr/local/src/httpd-2.2.32/modules/database-I/usr/local/src/httpd-2.2.32/srclib/apr/include-I/usr/local/src/httpd-2.2.32/srclib/apr-util/include-I/usr/local/src/httpd-2.2.32/srclib/apr-util/xml/expat/lib-I/usr/local/src/httpd-2.2.32/modules/proxy/../generators-I/usr/local/src/httpd-2.2.32/modules/ssl-I/usr/local/src/httpd-2.2.32/modules/dav/main-c/usr/local/src/httpd-2.2.32/server/buildmark.c
/usr/local/src/httpd-2.2.32/srclib/apr/libtool--silent--mode=linkgcc-g-O2-pthread-ohttpdmodules.lobuildmark.o-export-dynamicserver/libmain.lamodules/aaa/libmod_authn_file.lamodules/aaa/libmod_authn_default.lamodules/aaa/libmod_authz_host.lamodules/aaa/libmod_authz_groupfile.lamodules/aaa/libmod_authz_user.lamodules/aaa/libmod_authz_default.lamodules/aaa/libmod_auth_basic.lamodules/filters/libmod_include.lamodules/filters/libmod_filter.lamodules/loggers/libmod_log_config.lamodules/Metadata/libmod_env.lamodules/Metadata/libmod_setenvif.lamodules/Metadata/libmod_version.lamodules/http/libmod_http.lamodules/http/libmod_mime.lamodules/generators/libmod_status.lamodules/generators/libmod_autoindex.lamodules/generators/libmod_asis.lamodules/generators/libmod_cgi.lamodules/mappers/libmod_negotiation.lamodules/mappers/libmod_dir.lamodules/mappers/libmod_actions.lamodules/mappers/libmod_userdir.lamodules/mappers/libmod_alias.lamodules/mappers/libmod_so.laserver/mpm/prefork/libprefork.laos/unix/libos.la-lm/usr/local/src/httpd-2.2.32/srclib/pcre/libpcre.la/usr/local/src/httpd-2.2.32/srclib/apr-util/libaprutil-1.la/usr/local/src/httpd-2.2.32/srclib/apr-util/xml/expat/libexpat.la/usr/local/src/httpd-2.2.32/srclib/apr/libapr-1.la-lrt-lcrypt-lpthread-ldl
make[1]:离开目录“/usr/local/src/httpd-2.2.32”
[root@server01httpd-2.2.32]#echo$?
0
[root@server01httpd-2.2.32]#makeinstall
......
Installingicons
mkdir/usr/local/apache2/icons
mkdir/usr/local/apache2/logs
InstallingCGIs
mkdir/usr/local/apache2/cgi-bin
Installingheaderfiles
Installingbuildsystemfiles
Installingmanpagesandonlinemanual
mkdir/usr/local/apache2/man
mkdir/usr/local/apache2/man/man1
mkdir/usr/local/apache2/man/man8
mkdir/usr/local/apache2/manual
make[1]:离开目录“/usr/local/src/httpd-2.2.32”
[root@server01httpd-2.2.32]#echo$?
0
[root@server01httpd-2.2.32]#ls/usr/local/apache2
binbuildcgi-binconferrorhtdocsiconsincludeliblogsmanmanualmodules

源码包的卸载就是删除安装文件

原文链接:https://www.f2er.com/centos/377026.html

猜你在找的CentOS相关文章