wap网站的域名,教人做网站的视频,中国建设会计协会网站,2023网页游戏排行榜前十名程序包编译安装#xff1a;源码包#xff1a;name-VERSION-release.src.rpmrpm由源码包安装后#xff0c;使用rpmbuild命令制作成二进制格式的rpm包#xff0c;而后再安装源代码– 预处理– 编译(gcc)– 汇编– 链接– 执行源代码组织格式#xff1a;…程序包编译安装源码包name-VERSION-release.src.rpmrpm由源码包安装后使用rpmbuild命令制作成二进制格式的rpm包而后再安装源代码– 预处理– 编译(gcc)– 汇编– 链接– 执行源代码组织格式多文件文件中的代码之间很可能存在跨文件依赖关系C 、C make ( 项目管理器configure – Makefile.in – makefile)java: mavenC代码编译安装三步骤1、./configure(1)通过选项传递参数指定启用特性、安装路径等执行时会参考用户的指定以及makefile.in 文件生成makefile(2)检查依赖到的外部环境2、make根据makefile文件构建应用程序3、make install:复制文件到相应路径开发工具autoconf生成configure 脚本automake生成Makefile.in注意安装前查看INSTALLREADME开源程序源代码的获取官方自建站点apache.org (ASF)mariadb.org…代码托管SourceForge.netGithub.comcode.google.comc/c 编译器: gcc (GNU C Complier)编译C源代码前提提供开发工具及开发环境开发工具make, gcc等开发环境开发库头文件glibc标准库通过“包组”提供开发组件CentOS:Development Tools,Server Platform Development第一步configure 脚本选项指定安装位置、指定启用的特性–help获取其支持使用的选项(进入到解压的文件中执行命令)选项分类安装路径设定–prefix/PATH指定默认安装位置, 默认为/usr/local/–sysconfdir/PATH配置文件安装位置Optional Features可选特性–disable-FEATURE–enable-FEATURE[ARG]Optional Packages可选包,–with-PACKAGE[ARG], 依赖包–without-PACKAGE, 禁用依赖关系第二步make第三步make install安装后的配置(1) 二进制程序目录导入至PATH 环境变量中编辑文件/etc/profile.d/NAME.shexport PATH/PATH/TO/BIN:$PATH(2) 导入库文件路径编辑/etc/ld.so.conf.d/NAME.conf添加新的库文件所在目录至此文件中让系统重新生成缓存ldconfig [-v](3)导入头文件基于链接的方式导出头文件至/usr/include文件中2种实现方式导出整个目录为1个符号链接导出每个文件为符号链接ln -sv(4)导入帮助手册编辑/etc/man.config|man_db.conf 文件添加一个MANPATH注以下shell脚本问自己手动编写如若出现任何问题本人概不负责编译安装后自动配置脚本(自动完成上述4步操作)#!/bin/bash#desricptino auto make dir of configue make make install#version 0.1#author gaomeng#date 20160822#read -p Please input service dir path: dir//检测该目录是否存在不存在则报错退出if [ -e $dir ];thenecho dir is exist.elseecho dir is not exist.exitfibindir$dir/binlibdir$dir/libincludedir$dir/includemandir$dir/man//检测该目录下的binlibincludeman目录是否存在不存在则报错退出if [ -e $bindir ];thenecho bin dir is exist.elseecho bin dir is not exist.exitfiif [ -e $libdir ];thenecho lib dir is exist.elseecho lib dir is not exist.exitfiif [ -e $includedir ];thenecho include dir is exist.elseecho include dir is not exist.exitfiif [ -e $mandir ];thenecho man dir is exist.elseecho man dir is not exist.exitfinamebasename $dir//检测对应目录下(/etc/profile.d/ /etc/ld.so.conf.d/ /usr/include/)的以路径基名为文件名的文件是否存在存在则报错退出if [ -e /etc/profile.d/$name.sh ]; thenecho /etc/profile.d/${name}.sh is exist.exitelsetouch /etc/profile.d/${name}.shecho PATH$bindir:$PATH /etc/profile.d/${name}.shecho /etc/profile.d/${name}.sh add success.echo -e \033[42;31mplease execute: source /etc/profile.d/http.sh\033[0mfiif [ -e /etc/ld.so.conf.d/${name}.conf ]; thenecho /etc/ld.so.conf.d/${name}.conf is exist.exitelseecho $libdir /etc/ld.so.conf.d/${name}.confldconfigecho /etc/ld.so.conf.d/${name}.conf add success.fiif [ -e /usr/include/${name} ]; thenecho /usr/include/${name} is exist.exitelseln -sv $includedir /usr/include/${name}echo /usr/include/${name} add success.fi//向/etc/man.config文件中最近一条man帮助文件路径echo MANPATH $mandir /etc/man.configecho $mandir add in /etc/man.config.自动卸载脚本(自动删除上述4步所建目录和安装文件目录)#!/bin/bash#description auto del service configue file and service file#version 0.1#auther gaomeng#date 20160823#read -p Please input service dir path: dir//检测该目录是否存在不存在则报错if [ -e $dir ];thenecho dir is exist.elseecho dir is not exist.read -p you want go or exit,please input anscase $ans in[yY]|[yY][sS][eE]);;[nN]|[nN][oO])exit;;*)exit;;esacfinamebasename $dir//检测对应目录下(/etc/profile.d/ /etc/ld.so.conf.d/ /usr/include/)的以路径基名为文件名的文件是否存在存在则删除文件不存在则退出if [ -e /etc/profile.d/$name.sh ]; thenrm -f /etc/profile.d/${name}.shecho /etc/profile.d/${name}.sh is deleted.elseecho /etc/profile.d/${name}.sh is not exist.fiif [ -e /etc/ld.so.conf.d/${name}.conf ]; thenrm -f /etc/ld.so.conf.d/${name}.confecho /etc/ld.so.conf.d/${name}.conf is deletes.elseecho /etc/ld.so.conf.d/${name}.conf is not exist.fiif [ -e /usr/include/${name} ]; thenrm -f /usr/include/${name}echo /usr/include/${name} is deletes.elseecho /usr/include/${name} is exist.fi//删除/etc/man.config文件中的该服务的man帮助路径sed -i sMANPATH /usr/local/${name}/man /etc/man.configfgrep sMANPATH /usr/local/${name}/man /etc/man.configecho ${name}/man delete from /etc/man.config.//删除该服务文件rm -rf $dir作业源码安装http2.2.29[rootCentOS6 ~]# lftp 10.1.0.1/pub //下载源码包cd ok, cwd/publftp 10.1.0.1:/pub cd Sources/sources/httpd/lftp 10.1.0.1:/pub/Sources/sources/httpd get httpd-2.2.29.tar.bz25625498 bytes transferredlftp 10.1.0.1:/pub/Sources/sources/httpd bye[rootCentOS6 ~]# tar xf httpd-2.2.29.tar.bz2 //解压源码包[rootCentOS6 ~]# cd httpd-2.2.29[rootCentOS6 httpd-2.2.29]# ./configure prefix/usr/local/apache2 //安装3步骤[rootCentOS6 httpd-2.2.29]# make[rootCentOS6 httpd-2.2.29]# make install[rootCentOS6 httpd-2.2.29]# which apachectl //apachectl的二进制程序路径/usr/sbin/apachectl[rootCentOS6 httpd-2.2.29]# /root/makeautoadd.sh //执行编译安装后自动配置脚本Please input service dir path: /usr/local/apache2dir is exist.bin dir is exist.lib dir is exist.include dir is exist.man dir is exist.please execute: source /etc/profile.d/http.sh/etc/profile.d/apache2.sh add success./etc/ld.so.conf.d/apache2.conf add success./usr/include/apache2 - /usr/local/apache2/include/usr/include/apache2 add success./usr/local/apache2/man add in /etc/man.config.[rootCentOS6 httpd-2.2.29]# source /etc/profile.d/apache2.sh[rootCentOS6 httpd-2.2.29]# which apachectl //apachectl的二进制程序路径改变了/usr/local/apache2/bin/apachectl[rootCentOS6 httpd-2.2.29]# echo ServerName localhost:80 /usr/local/apache2/conf/httpd.conf[rootCentOS6 httpd-2.2.29]# apachectl start //启动服务[rootCentOS6 httpd-2.2.29]# ip addr show eth02: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000link/ether 00:0c:29:dd:9f:c8 brd ff:ff:ff:ff:ff:ffinet 10.1.143.1/8 brd 10.255.255.255 scope global eth0 //ip地址inet6 fe80::20c:29ff:fedd:9fc8/64 scope linkvalid_lft forever preferred_lft forever服务启动成功原创文章作者megedugao如若转载请注明出处http://www.178linux.com/39210