LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-11-2018, 01:33 PM   #1
jeffrosquad
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
Using symlink to implement local yum repo


Building a local yum repo, would normally download packages to /var/www/html/ and createrepo. The system I am working on, for whatever reason, was built with 20G /var and 195G /home. I did a reposync to /home/repodata. Trying to get httpd to be able to see fqdn/rhel-6-server-rpms.

So I have my repo at
drwxr-xr-x. 2 root apache 4096 Sep 10 16:35 repodata
[root@servername rhel-6-server-rpms]# pwd
/home/repodata/rhel-6-server-rpms

I went to /var/www/html/ and created symlink
lrwxrwxrwx. 1 root apache 34 Sep 11 13:48 rhel-6-server-rpms -> home/repodata/rhel-6-server-rpms/
[root@servername html]# pwd
/var/www/html

I did a recursive chown to root:apache on /var/www and /home/repodata
I did a chmod 755 on all same

Not sure what I am missing here.

When I view httpd ssl_error_log I see
[Tue Sep 11 18:00:10 2018] [error] [client xx.xx.xxx.xxx] Symbolic link not allowed or link target not accessible: /var/www/html/rhel-6-server-rpms

I have messed with my httpd.conf file and did
<Directory />
Options None
AllowOverride All (changed from None)
</Directory>
 
Old 09-11-2018, 01:56 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Options None turns off everything, including FollowSymLinks See the documentation
 
Old 09-11-2018, 01:59 PM   #3
jeffrosquad
Member
 
Registered: Jan 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
Changed options to FollowSymLinks from None, restarted httpd, same result
 
Old 09-11-2018, 03:02 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Code:
home/repodata/rhel-6-server-rpms/
No leading slash on the link target? Typo here? or....

(Just grasping at straws here...we presume that the <Directory /> actually does point to /var/www/html?)
 
Old 09-12-2018, 07:56 AM   #5
jeffrosquad
Member
 
Registered: Jan 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
Verified, I did include the /

ln -s /home/repodata/rhel-6-server-rpms/ /var/www/html/rhel-6-server-rpms
 
Old 09-12-2018, 08:38 AM   #6
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi

It could be SELinux. I remember I had some problems with userdir on CentOS in the past. And I fixed it by adding some SELinux rules. Here's some info:

https://www.if-not-true-then-false.c...-red-hat-rhel/

Look in section 6. It could be you need something like this:

chcon -R -t httpd_sys_content_t /home/repodata
 
Old 09-12-2018, 08:46 AM   #7
jeffrosquad
Member
 
Registered: Jan 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
Thank you, I will try that as well. I had turned off SELINUX just to see if that was the issue, but the error persists. Really feels like a perms issue or security and of course the longer you look at it the more confusing. Shouldn't be that hard.
 
Old 09-12-2018, 09:24 AM   #8
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Hi

Then I don't know. But if all you need is a very simple web server, httpd is maybe overkill. Here's something very simple:

Code:
cd /home/repodata/rhel-6-server-rpms
python -m SimpleHTTPServer
If you run this in a terminal, it starts a very simple webserver, and it's listening on port 8000 by default. And you will see the "log" in the terminal.

Code:
python -m SimpleHTTPServer 80
Will listen on port 80, but it requires root.
 
Old 09-12-2018, 09:26 AM   #9
jeffrosquad
Member
 
Registered: Jan 2012
Posts: 33

Original Poster
Rep: Reputation: Disabled
Thank you, I will try that........I was simply using httpd because it was already running on that box.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] yum local repo Chetansingh Linux - Server 1 11-20-2014 03:14 AM
yum local repo dlee12 Linux - Newbie 1 03-01-2009 12:26 PM
yum local repo dlee12 Linux - Newbie 1 03-01-2009 12:26 PM
Local YUM Repo lord loh. Linux - Software 2 05-28-2007 12:41 AM
local yum repo error shams Fedora 1 12-24-2005 11:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration