YUM server installation and configuration

Latest response

Hi,

I have install and configure(using http) YUM server in my Environment. initialy is working fine.

suddenly I have notice the error during installing package using YUM.

[root@localhost ~]# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
http://192.168.5.1:80/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
Trying other mirror.
http://192.168.5.1:80/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
Trying other mirror.
repo id repo name status
RHEL6-DVD1 RedHat Linux 6 . x86_64 Base 0
repolist: 0

Guys, pls help on this issue.......

Responses

I would start by verifying that your repository files are in fact readable by the correct local users/groups and that SELinux isn't restricting access.

Next, from your client, check that your repository is accessible at its intended location, ensuring that your web service is properly configured and running (note: including the port in the URL seems redundant in this instance):

wget http://192.168.5.1:80/repodata/repomd.xml

If you can successfully retrieve the repomd.xml file, check your yum client configuration (/etc/yum.conf) and ensure that any listed proxy server settings are valid.

Make sure that when you ran createrepo the resultant files are readable by your web-server (either user:group owned by the same ids your web server runs under or are set o+r).

If the permissions look good, check your web server logs for any indicative errors, then check your system logs to see if something like SELinux is blocking you.

Hello

The Deployment Guide has a short section Creating a Yum Repository. If there are any issues with file permissions and SELinux context that should be added to that section please let us know.

Hello,

Thanks for your useful informations.

I have change the selinux from Enforcing to Permissive state. Now I am able to list yum repository and able to install the packages.

Is any other way to fix the problem. bcaz I am worry about selinux state.

First, run the following command on your web server document root (assumed to be '/var/www/html' in this example):

restorecon -Rvv /var/www/html/

Next, set SELinux to Enforcing and verify that you can still access the repository from your client.

Hi Russell,

No luck , still facing the same issue, if we put Selinux state Enforcing.

Are your yum repo files within your web server's DocumentRoot or external to it? If the latter, you can use the SEL labels on your DocumentRoot as a template for applying SEL labels to your repo directory/contents by doing something like

chcon -R --reference=<DocumentRoot> <RepoRoot>

Hello Tom,

I have configure my web server like,

DocumentRoot: The directory out of which you will serve your

documents. By default, all requests are taken from this directory, but

symbolic links and aliases may be used to point to other locations.

#
DocumentRoot "/repo/rhel6/disk"

and I have use "/repo/rhel6/disk" as yum repo.

for this scenario kindly provide any other solution...

Thanks

As Tom mentioned earlier, you will need to change the SELinux context of your document root so that your web server can access it appropriately. In your case, the command should look like this:

chcon -R --reference=/var/www/html /repo/rhel6/disk

Hello,

Thanks guys, FInally issue was fixed by running(chcon -R --reference=/var/www/html /repo/rhel6/disk).

:)

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.