By thomas, Tue, 04/07/2009 - 00:42
We'll use the webserver to serve out our installation media, we could also use httpd to serve out our kickstart files as well. Now that httpd is installed, verify that it is configured to start on boot.
[root@server0  Server]# chkconfig --list httpd
httpd          	0:off	1:off	2:off	3:off	4:off	5:off	6:off
If httpd were configured to start automatically at boot time, it would show on instead of off for run levels 3,4 and 5 above. Enable httpd at boot:
[root@server0  Server]# chkconfig httpd on
[root@server0  Server]# chkconfig --list httpd
httpd          	0:off	1:off	2:on	3:on	4:on	5:on	6:off
Our web server will serve out the rpms on the install media (as well as a few of our own). As a first step, copy all the install RPMs off the install media to a directory on the webserver.
[root@server0  ~]# mkdir /mnt/install
[root@server0  ~]# mount /dev/cdrom /mnt/install
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@server0  ~]# cd /mnt/install
[root@server0  install]# mkdir /var/www/html/install
[root@server0  install]# cp -pr Client images isolinux VT Workstation /var/www/html/install
Now, with our files installed we'll need to configure the webserver to serve up our install media. We'll call the server install.example.org, we'll set up a new apache configuration file for the server and allow Indexing of the subdirectories of /var/www/html/install. /etc/httpd/conf.d/install.conf
<Directory /var/www/html/install>
 Options +Indexes
</Directory>
This file will ensure that indexes are shown in the subdirectories of install. You can now start up httpd and verify that the files are available via http.
[root@server0 conf.d]# service httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for server0.example.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]
[root@server0  conf.d]# wget http://127.0.0.1/install
--09:49:22--  http://127.0.0.1/install
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://127.0.0.1/install/ [following]
--09:49:22--  http://127.0.0.1/install/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1598 (1.6K) [text/html]
Saving to: `index.html'

100%[=======================================>] 1,598       --.-K/s   in 0s     

09:49:22 (254 MB/s) - `index.html' saved [1598/1598]
Now that our files are served up with apache, just as we did for dns, we need to make sure other machines can reach our httpd service. Earlier we discovered that the INPUT chain of our firewall is called RH-Firewall-1-INPUT. We need to add a rule to allow tcp port 80 through the firewall.
[root@server0 ~]# cd /etc/sysconfig
[root@server0 sysconfig]# iptables -I RH-Firewall-1-INPUT -p tcp -m state --state NEW,ESTABLISHED,RELATED --dport 80 -j ACCEPT
[root@server0 sysconfig]# iptables-save >iptables

Now we can test network access to our server from another machine on the network. You can use a web browser such as firefox or elinks.

Our new client will use http to download installation packages after it has finished loading the kernel. To load the kernel it uses a simpler transport called TFTP, we'll configure tftp in the next section.