Install Apache on CentOS from ISO image

This blog post will outline how to install an Apache web server from an ISO image on my CentOS 6.4 virtual machine (VM). The reason for this is that i’ve been doing some work where no internet connection has been available. There will be a follow up post to where an web server is mandatory. Stay tuned.

To install Linux packages you can either use the command rpm or the command yum . I usually use yum since i can easily include dependencies the same time. I needed to create an offline repository this before running yum since i didn’t have any internet connection available for the VM.

These are the steps i took to install apache on my CentOS VM.

  • Mount the installation ISO to the VM via vSphere Web Client
  • Mount the installation ISO to the VM guest OS
    • mount /dev/cdrom /mnt/cdrom
  • Crete package repository target
    • mkdir -p /repo/Packages
  • Copy the packages required to perform the installation. In my case i copied all packages:)
    • cp /mnt/cdrom/Packages/* /repo/Packages
  • Copy the repodata directory from the ISO to the new repository
    • cp -rp /mnt/cdrom/repodata/ /repo/
  • move the old repo files to a backup directory
    • mkdir /etc/yum.repos.d.old
    • mv /etc/yum.repos.d/* /etc/yum.repos.d.old/
  • Create new repository repo file using vi with the following content
    • vi /etc/yum.repos.d/local.repo
      name=My Awesome Repo
  • Install Apache using yum and answer Y to the “Is this ok” question
    • yum install httpd
      Screen Shot 2014-11-06 at 15.47.03
      Verify the installation
      Screen Shot 2014-11-06 at 15.47.48
  • Starte Apache
    • service httpd start
  • Verify the functionality
    • http://ip-address of the VM
      Screen Shot 2014-11-06 at 15.50.46

One of the reasons for setting up this web server was to updated vCenter Server Appliance. Blog post available here.

2 pings

  1. Newsletter: January 4, 2015 | Notes from MWhite

    […] Apache on CentOS from ISO image I saw this recently and thought it quite handy.  I use CentOS in my lab for Linux and one of the guys made a […]

  2. Update vCenter Server Appliance without internet connection | VCDX56

    […] week i published a blog post where i outlined how to install an Apache web server on a CentOS virtual machine (VM). The web server was required to install, update and upgrade a few other applications and one of […]

Comments have been disabled.