Apache is the most widely used web server in the world and one of the most reliable one.
To install the Apache first of all you should have the yum configured so that you can install all the packages have dependencies with it.
Than use the following command to install the Apache
#yum install httpd* //it will install the Apache and its related packages
Than go to the main directory of the Apache Web server and create a index.html file there so that server can read this file and can show it as our first page
#vi /var/www/html/index.html
Write any information in this file which you want to show by going to insert mode and than saving it.
Now open the main configuration file of the Apache so that we can make entry in that file about the changes which we want to take effect.
#vi /etc/httpd/conf/httpd.conf
Go to the following line and do the entry of your ip from which you want to run the web server
972 NameVirtualHost 172.168.0.26:80
972 is the line no, uncomment it by removing the # from its front and wirte your ip address in the end.
Copy lines from 985 to 991 in the end of file so that we can make changes in that
<VirtualHost 192.168.0.26:80> //your ip address:port no
ServerAdmin root@system26.example.com //root@your host name
DocumentRoot /var/www/html/ //directory address of index file
ServerName system26.example.com //your host name
# ErrorLog logs/dummy-host.example.com-error_log //keep it commented
# CustomLog logs/dummy-host.example.com-access_log common //keep it commanted
</VirtualHost>
Save it and come out of the file.
restart the service Apache and the network
#service httpd restart
#service network restart
Now go to browser and open your it by ip or host name but remember it will only work by host name if you had configured it correctly and your system was pinging your host name.
for any query write in the comment box
To install the Apache first of all you should have the yum configured so that you can install all the packages have dependencies with it.
Than use the following command to install the Apache
#yum install httpd* //it will install the Apache and its related packages
Than go to the main directory of the Apache Web server and create a index.html file there so that server can read this file and can show it as our first page
#vi /var/www/html/index.html
Write any information in this file which you want to show by going to insert mode and than saving it.
Now open the main configuration file of the Apache so that we can make entry in that file about the changes which we want to take effect.
#vi /etc/httpd/conf/httpd.conf
Go to the following line and do the entry of your ip from which you want to run the web server
972 NameVirtualHost 172.168.0.26:80
972 is the line no, uncomment it by removing the # from its front and wirte your ip address in the end.
Copy lines from 985 to 991 in the end of file so that we can make changes in that
<VirtualHost 192.168.0.26:80> //your ip address:port no
ServerAdmin root@system26.example.com //root@your host name
DocumentRoot /var/www/html/ //directory address of index file
ServerName system26.example.com //your host name
# ErrorLog logs/dummy-host.example.com-error_log //keep it commented
# CustomLog logs/dummy-host.example.com-access_log common //keep it commanted
</VirtualHost>
Save it and come out of the file.
restart the service Apache and the network
#service httpd restart
#service network restart
Now go to browser and open your it by ip or host name but remember it will only work by host name if you had configured it correctly and your system was pinging your host name.
for any query write in the comment box