X

Rate Us :



Share with Friends :

Menu

Apache Web Server :

Apache is a free and open source software. The application is available for a wide variety of OS including Unix, Linux and Windows.

The majority of all web servers using Apache are Linux web servers.


X

In-Kernel :

An In-Kernel web server is an unlimited HTTP server that runs in kernel space or equivalent. It is also called "accelerator".

Unix/Linux based Web Servers :


  • TUX - It is a In-Kernel web service that supports only text.

  • Apache - It is the most popular web server.

  • AOL - American Online is a free web server.

  • Sun One - It is a web server from SUN previously called as iPlanet.

Virtual Hosting :

Hosting more than one website on a single server is called virtual hosting.

Types of virtual hosting :-

  • Name based virtual hosting




  • IP Address based virtual hosting




  • Port based virtual hosting




Requirements :


Installation package : httpd*.rpm Port number : 80 (HTTP) Configuration files : /etc/httpd/conf/httpd.conf , /etc/httpd/conf.d/ssl.conf Service/Daemon : httpd


Configure Apache Web Server :


Check the system IP address - [root@localhost~]#ifconfig [Let say, IP address - 192.168.0.180] Assign virtual IP address - [root@localhost~]#ifconfig enp1s6 192.168.0.130 Assign the hostname temporary and permanent - [root@localhost~]#hostname www.algovalley.com Edit hostname - [root@localhost~]#vi /etc/hostname The hostname file will be opened, go to insert mode by pressing i/I/o/O/a/A (any one of them) then write : www.algovalley.com Then go to Ex: mode by pressing Esc then Shift + : and type wq to save and exit. Add the host entries with IP Address - [root@localhost~]#vi /etc/hosts The hosts file will be opened, go to insert mode by pressing i/I/o/O/a/A (any one of them) then write : 192.168.0.180 www.algovalley.com www 192.168.0.180 www.redhat.com www 192.168.0.130 www.gmail.com www Then go to Ex: mode by pressing Esc then Shift + : and type wq to save and exit. [reboot the system to apply changes] Install the packages for web server - [root@localhost~]#yum install httpd* -y Edit the configuration file - [root@localhost~]#vi /etc/httpd/conf/httpd.conf Set the line number - Go to Esc mode by pressing Shift + : and then type se nu Go to Line no. - 355 to 375 and edit by going to insert mode by pressing Esc then i/I/o/O/a/A (any one of them) 355 <VirtualHost *:80> 356 ServerAdmin root@algovalley.com 357 DocumentRoot /var/www/html 358 ServerName www.algovalley.com 359 DirectoryIndex algovalley.html 360 </VirtualHost> 361 362 <VirtualHost 192.168.0.130:80> 363 ServerAdmin root@gmail.com 364 DocumentRoot /var/www/html 365 ServerName www.gmail.com 366 DirectoryIndex gmail.html 367 </VirtualHost> 368 369 Listen 5000 370 <VirtualHost 192.168.0.180:5000> 371 ServerAdmin root@redhat.com 372 DocumentRoot /var/www/html 373 ServerName www.redhat.com 374 DirectoryIndex redhat.html 375 </VirtualHost> Then go to Ex: mode by pressing Esc then Shift + : and type wq! to save and exit. Enter into webpage database location - [root@localhost~]#cd /var/www/html Create webpages - [root@localhost~/var/www/html]#vi algovalley.html [root@localhost~/var/www/html]#vi gmail.html [root@localhost~/var/www/html]#vi redhat.html Update the service - [root@localhost~]#service httpd restart To verify open the browser - Type URL : www.algovalley.com Type URL : www.gmail.com or 192.168.0.130 Type URL : www.redhat.com:5000