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
[myrepo]
name=My Awesome Repo
baseurl=file:///repo
enabled=1
gpgcheck=0
- vi /etc/yum.repos.d/local.repo
- Install Apache using yum and answer Y to the “Is this ok” question
- Starte Apache
- service httpd start
- Verify the functionality
One of the reasons for setting up this web server was to updated vCenter Server Appliance. Blog post available here.
2 pings
Newsletter: January 4, 2015 | Notes from MWhite
January 4, 2015 at 11:18 pm (UTC 0) Link to this comment
[…] 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 […]
Update vCenter Server Appliance without internet connection | VCDX56
January 6, 2015 at 9:54 am (UTC 0) Link to this comment
[…] 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 […]