How to configure Apache Web Server in Red Hat Enterprise Linux 6

Get the step by step tutorial to configure Apache Web Server in your Red Hat Enterprise Linux 6. Discover the packages require to set up Apache Web Server to create and publish your own website in internet. Read the article below to get the full details.

Configuring web server is simple in Red Hat Enterprise Linux 6. The Apache Web Server package is available in official Red Hat repository and easy to install. The configuration is made mostly on command line interface rather than graphical user interface. Most options are available in command mode and it is good to stick using it. The command line interface has got more functionality than GUI's. You will enter command in the Terminal emulator. To open Terminal, right click on the desktop and click on "open in terminal".

Apache Web Server packages

To configure Apache Web Server in your Red Hat Enterprise Linux 6, install following packages.

#yum install httpd* -y
#yum install apr* -y

The above packages will install necessary configuration files in your operating system.

Apache Web Server configuration

1. Start the http daemon to communicate between server and client. It can be done by starting httpd service which we have installed just before.

#/etc/init.d/httpd start

The above command makes the service to run for a single session (i.e) if you reboot your system, httpd service will be stopped. To run the service permanently even after reboot use the following command.

#chkconfig httpd –level 35 on

After using the above command httpd service will start everytime you boot up the system. The level 35 option is used to mention the Apache Web Server service to start either mode (graphical or non graphical).

Now launch Firefox and enter "localhost" in the web address bar without quotes. It will now display the new web server. Now this will be visible to all the computers connected to the LAN. You can also configure the web server and allow access to the internet. So if you like to configure web server to allow access to your website through internet follow the steps in below section.

Apache test page

Publish your web site to internet

You can allow internet to view your web site by opening firewall. The configuration depends on how you are connected to the internet, either through LAN or direct connection. For this you need to modify the firewall and DSL configuration to allow internet to view your web site.

DSL configuration:
In DSL configuration all you need to do is modify the NAT configuration by entering the following command.

#set nat entry add 80 80

Firewall configuration:
This configuration is made to allow the internet to access your website. Technically, you are giving access to port 80 of you Apache Web Server. This can be done by assigning the following firewall rule.

#iptables -A INPUT -p tcp -m state –state NEW,ESTABLISHED -j -dport 80

Hurrah, now the web server configuration is complete and you can access your website from the internet.

Read How to install and configure WAMP Server for PHP Development

Related Articles

User ID and User types in UNIX Operating Systems

This article explains about, what exactly is an USER ID in UNIX operating system and how is that been represented and stored in "passwd" file with the user details. Also, read this article to know about the range of user ids and their special permissions.

How to disable Bluetooth in Fedora 19 at start up?

Does your Fedora 19 automatically starts Bluetooth in GNOME 3 shell? Are you messed up and want to disable Bluetooth at start up in Fedora 19? Read the below article and disable Bluetooth service at start up in Fedora 19.

How to watch Netflix in Fedora

Need to watch Netflix movies and TV shows in Fedora? Below I have given tutorial to install and watch Netflix movies in your computer running Fedora operating system. Read the below article to install Netflix in Fedora.

How to backup files in Fedora OS using Deja-Dup in simple steps?

Are you wondering how to back up your files in Fedora OS? Are you looking for easy way to back up files? Here is the tutorial which helps you to back up file with several handy options for you. Here I have given screen by screen procedure to install back up software and using it.

How to mount external hard disk in Red Hat Linux?

Are you facing trouble mounting external hard disk drive? Need solution to mount external hard disk in your Red Hat PC? Below I have given the software driver to recognize your external HDD. Read the article below to know about the software driver.

More articles: Linux Tutorials


Guest Author: Lily Chris29 May 2015

This tutorial indeed is very detailed for me to get some understanding about how to install and configure Apache web server...but some issues still confuse me.I find the answer on

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: