搭建局域网yum仓库

#安装web服务
yum install httpd
service httpd start

#把rpm包放到网站RPMS下 做为仓库地址

yum install createrepo

createrepo  /var/www/html/RPMS     //如果报错  可能是python版本有问题  用centos系统自带的版本就可以

 

 

chmod -R ugo+rx /var/www/html

如果不能访问,出现403错误(在实体机上常见),即you don't have permission to access / on this server(Apache Server权限访问问题),则需要在/etc/httpd/httpd.conf中添加如下配置:

复制代码
<Directory "/var/www/icons">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Alias /CDH4-RPMS/ "/var/www/html/CDH4-RPMS/"
<Directory "/var/wwww/html/CDH4-RPMS">
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order allow,deny
  Allow from all
</Directory>

Alias /CM4-RPMS/ "/var/www/html/CM4-RPMS/"
<Directory "/var/www/html/CM4-RPMS">
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order allow,deny
  Allow from all
</Directory>

Alias /IMPALA-RPMS/ "/var/www/html/IMPALA-RPMS/"
<Directory "/var/www/html/IMPALA-RPMS">
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order allow,deny
  Allow from all
</Directory>
复制代码

#使用

[myrepo] 
name=myrepo 
baseurl=http://hostname/RPMS 
enabled=1 
gpgcheck=0

 

 

参考  http://www.cnblogs.com/shudonghe/p/3142796.html

您可以选择一种方式赞助本站