Custom repository refuses to show up in HTTP

General support questions
kix
Posts: 23
Joined: 2018/06/10 22:56:42

Custom repository refuses to show up in HTTP

Post by kix » 2018/09/10 01:54:13

The following are precise steps I've taken to create RPM, and a symbolic link to it from /var/www/html/repo/

I created an .rpm file in, /etc/yum.repos.d/
The content of kix.repo is:

Code: Select all

[kix]
name=kix repo
baseurl=file:///home/kix/rpm
enabled=1
gpgcheck=0
I’ve copied packages from the mounted Centos 7.iso to the kix repo folder, there are 3.9GB of content:

Code: Select all

cp media/centos_update/Packages/* /home/kix/rpm/centos/
I executed, createrepo /home/kix/rpm, And createrepo –update /home/kix/rpm
An empty folder titled ‘repodata’ is created at, /home/kix/rpm/

I follow the guide’s (link) step of assigning root ownership to the kix/rpm folder

Code: Select all

 chmod -R o-w+r /home/kix/rpm/repo 
The guide suggests I test the repository to see if it’s working on the local host:

Code: Select all

yum install jaxen-1.1.3-11.el7.noarch.rpm
The following is shown, note this only works when I’m inside the /rpm/centos/ folder, otherwise it’s listed as unavailable.

Code: Select all

[root@myserver centos]# yum install jaxen-1.1.3-11.el7.noarch.rpm
Loaded plugins: fastestmirror, langpacks
Examining jaxen-1.1.3-11.el7.noarch.rpm: jaxen-1.1.3-11.el7.noarch
jaxen-1.1.3-11.el7.noarch.rpm: does not update installed package.
Error: Nothing to do
I make a symbolic link to where the packages are transferred to.

Code: Select all

 ln -s /var/www/html/repo /home/kix/rpm/
Clicking the repo directory in, /var/ww/html/repo, shows the centos folder, and clicking on the centos folder displays packages displayed in, /home/kix/rpm/repo/centos.
ls –la, also confirms it:

Code: Select all

total 276
drwxr-xr-x. 3 root root     20 Sep  9 19:59 .
drwxr-xr-x. 5 root root     50 Sep  8 12:30 ..
drwxr-xr-x. 4 kix  kix  221184 Sep  8 12:03 centos
I continue on to the step labeled: Verify the repository access from the client system
I type the following into firefox and chromium
http://myrpmweb/rpm
http://myrpmweb/repo
http://myrpmweb/centos
I get: Not Found message, saying requested url not found server.

Also while in non-root administrator account, only the first 2 lines/statements are visible:

Code: Select all

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
#192.168.1.174 myserver.server.home ipaserver
192.168.1.174 example.com
192.168.1.174 myrpmweb
~
Typing 127.0.0.1, 192.168.1.174 and myrpmweb, successfully loads the Apache 123.. page.

May someone please tell me the next best step to resolve this issue?
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Custom repository refuses to show up in HTTP

Post by hunter86_bg » 2018/09/11 05:21:02

/home/kix/rpm/repo
SELINUX doesn't allow access to user's home by default.
To verify that run:

Code: Select all

setenforce 0
and test again.

kix
Posts: 23
Joined: 2018/06/10 22:56:42

Re: Custom repository refuses to show up in HTTP

Post by kix » 2018/09/13 00:08:12

hunter86_bg wrote:
2018/09/11 05:21:02
/home/kix/rpm/repo
SELINUX doesn't allow access to user's home by default.
To verify that run:

Code: Select all

setenforce 0
and test again.
Thanks for responding.

I went ahead and executed setenforce 0, as root and rebooted.

I confirmed the content of, cat /etc/selinux/config

Code: Select all

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
unfortunately, myrpmweb/rpm, refuses to show anything
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Custom repository refuses to show up in HTTP

Post by lightman47 » 2018/09/13 00:54:13

content deleted

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Custom repository refuses to show up in HTTP

Post by hunter86_bg » 2018/09/13 10:45:23

What is the output of

Code: Select all

apachectl configtest
?

kix
Posts: 23
Joined: 2018/06/10 22:56:42

Re: Custom repository refuses to show up in HTTP

Post by kix » 2018/09/13 12:34:59

Code: Select all

apachectl configtest
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:1
Syntax OK
vhost.conf, located in /etc/httpd/conf.d/vhost.conf

Code: Select all

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName server.home
    ServerAlias www.example.com
    DocumentRoot /var/www/html/example.com/public_html/
    ErrorLog /var/www/html/example.com/logs/error.log
    CustomLog /var/www/html/example.com/logs/access.log combined
</VirtualHost>
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Custom repository refuses to show up in HTTP

Post by hunter86_bg » 2018/09/13 20:18:59

You also need to define a <Directory> section in your config.
Usually i put the section above the Virtualhost section.
Set your DocumentRoot to '/home/kix/rpm/repo' and create a Directory section like:

Code: Select all

<Directory /home/kix/rpm/repo>
Require all granted
</Direectory>

kix
Posts: 23
Joined: 2018/06/10 22:56:42

Re: Custom repository refuses to show up in HTTP

Post by kix » 2018/09/14 18:33:22

I changed /etc/httpd/conf.d/vhost.conf, to the following, and the page still won't display

Code: Select all

NameVirtualHost *:80

<Directory /home/kix/rpm/repo>
Require all granted
</Directory>

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName server.home
    ServerAlias www.example.com
    DocumentRoot /home/kix/rpm/repo
    ErrorLog /var/www/html/example.com/logs/error.log
    CustomLog /var/www/html/example.com/logs/access.log combined
</VirtualHost>
Centos 7 w/Gnome | Lenovo Thinkpad X201 ─ i7@2.6GHz, 4GB DDR3, 270 MB/s SSD

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Custom repository refuses to show up in HTTP

Post by TrevorH » 2018/09/14 18:36:24

Well for a start, don't define your logs under /var/www/httpd, that is for the web content not for logs. Logs go in /var/log/http and selinux will be very unhappy with you if you try to write them to where you have them pointed now.

Did you read your logs? Well, once you move them to a location that can be written to! Start with /var/log/httpd/error_log and its ssl_ equivalent.
I went ahead and executed setenforce 0, as root and rebooted.
setenforce takes effect immediately and is reverted when you reboot so you set it then rebooted and lost it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Custom repository refuses to show up in HTTP

Post by hunter86_bg » 2018/09/14 18:58:45

As per previous post SELINX is set to permissive.
Yet, Trevor is right. Without lofs is difficult to find the problem.

Post Reply