5.12.3 Setting up a New HTTP Server

Note

These instructions assume that you are setting up an Oracle Linux 6 system as an Apache HTTP server.

To set up an HTTP server:

  1. Install the Apache HTTP server package.

    # yum install httpd
  2. Create the directory where you will copy the full Oracle Linux Release 6 Media Pack DVD image, for example /var/www/html/OSimage/OL6.3:

    # mkdir -p /var/www/html/OSimage/OL6.3
    Note

    If SELinux is enabled in enforcing mode on your system, create the directory under the /var/www/html directory hierarchy so that the httpd_sys_content_t file type is set automatically on all the files in the repository.

  3. Edit the HTTP server configuration file, /etc/httpd/conf/httpd.conf, as follows:

    1. Specify the resolvable domain name of the server in the argument to ServerName.

      ServerName server_addr:80

      If the server does not have a resolvable domain name, enter its IP address instead. For example, the following entry would be appropriate for an HTTP server with the IP address 192.168.1.100.

      ServerName 192.168.1.100:80
    2. If the directory to which you will copy the DVD image in not under /var/www/html, change the default setting of DocumentRoot.

      In this example, the DVD image will be copied to /var/www/html/OSimage/OL6.3 so the setting of DocumentRoot can remain unchanged.

      DocumentRoot "/var/www/html"
    3. Verify that the <Directory> setting points to the same setting as DocumentRoot.

      #
      # This should be changed to whatever you set DocumentRoot to.
      #
      <Directory "/var/www/html">
    4. If you want to be able to browse the directory hierarchy, verify that the Options directive specifies the Indexes option, for example:

      Options Indexes FollowSymLinks
      Note

      The Indexes option is not required for installation.

    5. Save your changes to the file.

  4. Start the Apache HTTP server, and configure it to start after a reboot.

    # service httpd start
    # chkconfig httpd on
  5. If you have enabled a firewall on your system, configure it to allow incoming HTTP connection requests on TCP port 80.

    For example, the following command configures iptables to allow incoming HTTP connection requests and saves the change to the firewall configuration:

    # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
    # service iptables save