As far as I know, the yum utility only works with http. This is different than a network install using Anaconda. However, why bother to setup a web server to provide a yum repository. It will be much easier to simply use a local yum repository. You can use a DVD, copy the content of the DVD or share it using NFS.
Here is perhaps an interesting post: Using YUM for Oracle Linux 6
You could mount Oracle Linux DVD and configure it as a local repository for yum. Steps:
1) # mkdir /OL6DVD
2) Assuming /dev/sr0 is the device name used by Oracle Linux DVD:
# mount /dev/sr0 /OL6DVD
3) Verify it is mounted properly:
# cd /OL6DVD/
4) Setup yum repository by creating local.repo as shown below. Make sure you don't have any other .repo files in /etc/yum.repos.d/ directory.
# cat /etc/yum.repos.d/local.repo
name=OL6u3 DVD Repository
5) Import Keys:
# rpm --import /OL6DVD/RPM-GPG-KEY
# rpm --import /OL6DVD/RPM-GPG-KEY-oracle
6) Verify that local repository is now setup correctly:
# yum repolist
Install packages from local repository if it has been setup correctly using 'yum install' command
You can actually use /dev/cdrom to access the DVD. The repository configuration should point to the "server" directory. The yum repository configuration to read from the DVD drive is also explained in the Oracle Linux release notes, chapter 3.2.3 https://oss.oracle.com/el6/docs/RELEASE-NOTES-U5-en.html
OK, I need to go through this with some more in detail, but I understand that YUM can be configured to read from filesystem (not only being DVD, but anything), instead of the internet connection to a cloud-YUM-repository.
In this case, I needed to install only ONE package/RPM, but the issue I have with the DVD repository : that is a fixed repository. Who's going to update that ? Who says it even stores what I need ? I was looking for this one package on "the internet", then just FTP to local system, and install it, using RPM or whatever. But I understand this can be done with YUM as well, albeit not the default method.
Yum can also install local rpm files. You can download a rpm package and use yum localinstall /path/to/package.rpm. Yum realizes that you are using a local RPM package and won't connect to the Internet, unless the package you are installing has any software dependencies for which it will query the repository. You can also download required software dependencies the same way prior to installing your final software package.
Btw, you do not want to use the rpm utility to install software since, unlike yum, it does not resolve software dependencies and does not prevent you from destroying your system.