Objective

The objective is to configure network Redhat package repository accessible via HTTP protocol. This guide uses Apache webserver as a means to provide HTTP access to the local package repository.

Operating System and Software Versions

  • Operating System: - Red Hat Enterprise Linux Server 7.3 (Maipo)
  • Software: - Apache/2.4.6 (Red Hat Enterprise Linux)

Requirements

Privileged access to your RHEL server system will be required.

Difficulty

EASY

Conventions

  • # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ - requires given linux commands to be executed as a regular non-privileged user

Instructions

Install Apache

First, step is to install and start httpd daemon.
# yum install httpd
Enable httpd daemon to start after reboot:
# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to /usr/lib/systemd/system/vsftpd.service.
Disable the default Apache welcome page configuration on Redhat Linux server:
# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.backup
Start httpd daemon:
# systemctl start httpd
httpd daemon should now be running:
# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2017-04-11 06:28:57 AEST; 20s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 12283 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─12283 /usr/sbin/httpd -DFOREGROUND
           ├─12289 /usr/sbin/httpd -DFOREGROUND
           ├─12290 /usr/sbin/httpd -DFOREGROUND
           ├─12291 /usr/sbin/httpd -DFOREGROUND
           ├─12292 /usr/sbin/httpd -DFOREGROUND
           └─12293 /usr/sbin/httpd -DFOREGROUND

Configure Firewall

If you have firewall enabled, add a new rule to allow inbound firewall connections to FTP service:
# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload 

Include Packages

What remains is to copy Redhat package repository from ISO image or DVD drive to /var/www/http/ directory. Mount your CDROM:
# mount /dev/cdrom /media
or RHEL iso image:
# mount -ro loop rhel-server-7.3-x86_64-dvd.iso /media
and copy all source files using cp:
# cp -a /media/* /var/www/http/
If SELinux is enabled on your system set appropriate SELinux context recursively for entire directory:
# chcon -R -t public_content_t /var/www/http/
Your FTP server should now be accessible from any remote system via http://SERVER-IP/
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: