yum仓库搭建和apache编译安装

查看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
yum仓库搭建和apache编译安装python

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

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

1下载源码并解包vim

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

源代码--》预处理--》编译--》汇编---》连接---》执行缓存

configure生成makefile’
yum仓库搭建和apache编译安装
yum仓库搭建和apache编译安装
原来的httpd版本
yum仓库搭建和apache编译安装
yum仓库搭建和apache编译安装
须要安装development Tool
yum groupinstall “development Tool”
Yum groupinstall 软件组 安装指定软件组
Yum groupremove 软件组 卸载指定软件组app

查看包组
[root@centos7 httpd-2.4.29]#yum grouplistyum仓库搭建和apache编译安装
先卸载以前的版本
[root@centos7 ~]#yum remove httpdide

运行configure
 configure脚本的通用功能:
            一、指定安装路径:
                    –prefix=/usr/local/packagename 指定安装路径
                    –sysconfdir=/etc/packagename 指定配置文件的存放路径
yum仓库搭建和apache编译安装
运行报错
yum仓库搭建和apache编译安装
装上[root@centos7 httpd-2.4.29]#yum install apr-devel
在执行,在报错,再安装,缺啥补啥
[root@centos7 httpd-2.4.29]#yum install apr-util-devel
yum仓库搭建和apache编译安装
安装完成,生成Makefile文件
yum仓库搭建和apache编译安装
查看文件夹大小
[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变量中
yum仓库搭建和apache编译安装
再启动APACHE服务
[root@centos7 httpd24]#apachectl
[root@centos7 httpd24]#ss -ntl
LISTEN 0 128 :::80
网页能够打开了
yum仓库搭建和apache编译安装
总结
$ CC="pgcc" CFLAGS="-O2" \
./configure --prefix=/sw/pkg/apache \
--enable-rewrite=shared \
--enable-speling=shared
一、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 察看详细的说明帮助。
二、make,这一步就是编译,大多数的源代码包都通过这一步进行编译(固然有些perl或python编写的软件须要调用perl或python来进行编译)。若是 在 make 过程当中出现 error ,你就要记下错误代码(注意不单单是最后一行),而后你能够向开发者提交 bugreport(通常在 INSTALL 里有提交地址),或者你的系统少了一些依赖库等,这些须要本身仔细研究错误代码。
三、make insatll,这条命令来进行安装(固然有些软件须要先运行 make check 或 make test 来进行一些测试),这一步通常须要你有 root 权限(由于要向系统写入文件)
http://www.178linux.com/39759测试

相关文章
相关标签/搜索