Apache configuration/Web server configuration in RHEL 6

We are going to see Apache configuration/Web server configuration in RHEL 6 Linux.
Remember before configuring  web server, we must configure DNS/DHCP server to receive the correct traffic.

Required RPM’s:
1. Httpd
2. Httpd-devel

Install the required RPM’s using below commands.

#yum install http*  -> command will install the required rpm package including dependency.

Now configure the IP Address with 192.168.1.10 and check whether its configured properly or not. Without proper network configuration httpd service will wont start.

#ifconfig eth0 192.168.1.10 255.255.255.0
#ifconfig eth0

Now start httpd daemons and check the status

#chkconfig httpd on
#service httpd start
#service httpd status

Now configure Hosting:

We will host www.exampleweb.com to apache server and create index page under the root directory.

#mkdir –p /var/www/virtual/www.exampleweb.com/html
#vi /var/www/virtual/www.exampleweb.com/html/index.html

Just enter some text for testing purpose in index.html
<b> this is test page</b>

Bind system ip with www.exampleweb.com on /etc/hosts file. Usinf vi editor open the file and append like below.

#vi /etc/hosts
192.168.1.10 
www.exampleweb.com

Save and exit from the file using :wq

Now locate virtual host tag and remove # on apache configuration file (/etc/httpd/conf/httpd.conf)

#vi /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.1.10

Copy and paste the last seven line from the file and change as shown below.

<VirtualHost 192.168.1.10>
ServerAdmin
[email protected]
DocumentRoot /var/www/cirtual/www.exampleweb.com/html
ServerName
www.exampleweb.com
ErrorLog logs/dummy-www.exampleweb.com-error_log
CustomerLog logs/ dummy-www.exampleweb.com-access_log common
</Virtualhost>

Now restart the httpd service to effect the new configuration

#service httpd restart

Using links command will check the page

#links www.exampleweb.com
This is a test page
If you got out as whatever you have entered in index.html page than you have configured very well.

8 thoughts on “Apache configuration/Web server configuration in RHEL 6”

  1. Nice post. I used too bbe checking constantly this weblog aand I’m impressed!
    Extremely helpful info specially the ultimate part :
    ) I take care of such info a lot. I usrd to be seeking this certain information for a
    long time. Thank you and best of luck.

  2. Hello there I am so delighhted I found yourr website, I really found you
    by accident, while I was researching on Yahoo for something else,Regardless I aam here now and would just like to saay thank you
    for a marvelous post and a all round enjogable blog (I also love
    the theme/design), I don’t have ime to read through it
    all att the minute but I have saved it and also added your RSS feeds, so when I have timke I will be back to read a great
    deal more, Please do keep up the great work.

  3. you’re really a excellent webmaster. Thhe site loading velocity is amazing.
    It sort of feels that you’re doing any unique trick.
    Also, Thhe contents are masterwork. you have done a magnificent activity on this topic!

  4. Its lijke you read my mind! You seem to know so much aabout this, like
    you wrote the book in it or something. I think that you can do with a few
    pics to drive the message home a little bit, but instead of that, this is excellent
    blog. A great read. I will definitely be back.

Leave a Reply

Your email address will not be published. Required fields are marked *