Foreman public directory

Problem:
I am trying to use /usr/share/foreman/public as a repository for my distributions packages.
but get permission deny from downloading them be it with dracut, curl, and so on.

what did I do wrong ? I would like to avoid installing a 2nd http server for that !

The problem is that we proxy everything on /, except some specific paths (puppet-foreman/apache.pp at 787033f3187c42638096c28b14a6b7fa61b91a53 · theforeman/puppet-foreman · GitHub). You should be able to create a directory named pub and use that, since we already exclude it.

Having said that: consider using Katello for your content management.

1 Like

Or maybe not, if this is in /etc/httpd/conf.d/05-foreman-ssl.conf

Alias /pub /var/www/html/pub

In that case, using /var/www/html/pub instead of /usr/share/foreman/public should work.

And in addition, if there are permission errors: check SeLinux. Biggest mistake you can do, is to copy some files into the filesystem (e.g. your personal home) and then move them into /var/www/html/pub because /bin/mv won’t change the selinux labels on files and thus httpd cannot access them…

1 Like

@gvde that alias is only there for Katello, not vanilla Foreman. I assumed it was vanilla Foreman, because otherwise you wouldn’t have a need to store distro packages.

Good point on the SELinux hint though.

Why not just create a files repo and distribute your files that way?

because I was not willing to deploy another server !

Not sure what you mean, The repo will be in the Foreman Proxy accessible from any host joined with Foreman.