查看yum的配置文件 [root@centos7 ~]#cat /etc/yum.conf rpm -k 检查包的完整性 yum仓库这个下面创建 [root@centos7 ~]#cd /etc/yum.repos.d/ 创建yum源和yum仓库 vim /etc/yum.repos.d/base2.repo

yun clean all清缓存 [root@centos7 yum.repos.d]#yum repolist 查看yum源列表 [root@centos7 yum.repos.d]#yum install httpd 这就能下载

**编译安装** 第一步安装:

1下载源码并解包

2 准备编译环境 yum groupinstall "Development Tools" 运行.configre 程序包编译安装:

源代码--》预处理--》编译--》汇编---》链接---》执行

configure生成makefile’ 原来的httpd版本 需要安装development Tool yum groupinstall “development Tool” Yum groupinstall 软件组 安装指定软件组 Yum groupremove 软件组 卸载指定软件组

查看包组 [root@centos7 httpd-2.4.29]#yum grouplist 先卸载之前的版本 [root@centos7 ~]#yum remove httpd

运行configure  configure脚本的通用功能:             1、指定安装路径:                     –prefix=/usr/local/packagename 指定安装路径                     –sysconfdir=/etc/packagename 指定配置文件的存放路径 运行报错 装上[root@centos7 httpd-2.4.29]#yum install apr-devel 在执行,在报错,再安装,缺啥补啥 [root@centos7 httpd-2.4.29]#yum install apr-util-devel 安装完成,生成Makefile文件 查看文件夹大小 [root@centos7 httpd-2.4.29]#du -sh 45M 接下来进行编译 make -j 4 其实可以make &&make install 下面make install安装 [root@centos7 httpd-2.4.29]#make install 查看app下面有没有生成目录 [root@centos7 httpd-2.4.29]#ls /app 12 sl-5.02-1.el7.x86_64.rpm httpd24
[root@centos7 httpd-2.4.29]#du -sh /app/httpd24 31M /app/httpd24 把httpd24下面的bin文件夹的路径放到path变量中 再启动APACHE服务 [root@centos7 httpd24]#apachectl [root@centos7 httpd24]#ss -ntl LISTEN 0 128 :::80
网页可以打开了 总结 $ CC="pgcc" CFLAGS="-O2"
./configure --prefix=/sw/pkg/apache
--enable-rewrite=shared
--enable-speling=shared 1、configure,这一步一般用来生成 Makefile,为下一步的编译做准备,你可以通过在 configure 后加上参数来对安装进行控制,比如代码:./configure –prefix=/usr 意思是将该软件安装在 /usr 下面,执行文件就会安装在 /usr/bin (而不是默认的 /usr/local/bin),资源文件就会安装在 /usr/share(而不是默认的/usr/local/share)。同时一些软件的配置文件你可以通过指定 –sys-config= 参数进行设定。有一些软件还可以加上 –with、–enable、–without、–disable 等等参数对编译加以控制,你可以通过允许 ./configure –help 察看详细的说明帮助。 2、make,这一步就是编译,大多数的源代码包都经过这一步进行编译(当然有些perl或python编写的软件需要调用perl或python来进行编译)。如果 在 make 过程中出现 error ,你就要记下错误代码(注意不仅仅是最后一行),然后你可以向开发者提交 bugreport(一般在 INSTALL 里有提交地址),或者你的系统少了一些依赖库等,这些需要自己仔细研究错误代码。 3、make insatll,这条命令来进行安装(当然有些软件需要先运行 make check 或 make test 来进行一些测试),这一步一般需要你有 root 权限(因为要向系统写入文件) http://www.178linux.com/39759