Menus

Jun 6, 2016

How to configure Linux system as (Apache) web server?

How to configure Linux system as (Apache) web server?
1. Login as root user
                Type su root and then password of root user
2. Install the package httpd-manual*.rpm using following command
rpm –ivh httpd-manual.rpm
(you can download httpd-manual*.rpm file from rpm repository
                                                OR
Inside the installation ISO file of Redhat linux, there is a folder named Packages, where we can find all the needed packages.)

3. Edit the file /etc/httpd/conf/httpd.conf and define following things:
vi  /etc/httpd/conf/httpd.conf
goto insert mode by pressing i
type following anywhere in the file:
<VirtualHost *:80>
                ServerAdmin root@localhost
                DocumentRoot /var/www/html
                ServerName www.yourServerName.com
</VirtualHost>
To save it, at first press Esc and then type :wq
(We can also give our server’s IP address for ServerName)


4. Start Apache using following command:
service httpd start
    Now if we type localhost in browser then “Red Hat Enterprise Linux Test Page” appears which is as below



Linux Apache Welcome Page

No comments:

Post a Comment

Contact Form

Name

Email *

Message *