The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.

20.13.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:

    # mkdir -p /var/www/html/OSimage/OL6

    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 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