Web Server in Linux Operating System

Apache

Apache is a open source software and available in wide range of operating systems, including UNIX, LINUX & Windows.
The Majority of all web servers using Apache are Linux web servers.

Type of Web Services

Linux/Unix based web services

  • TUX- In kernel web server that supports only text
  • Apache- The most popular web server
  • AOL-  American Online free web server
  • Sun One- Web server from SUN previously called as Iplanet.
  • Netscape
  • Elinks
Elinks: It is a default application which is used to access internet websites in CLI Mode.

Virtual Hosting

Hosting more than one website on a single server is called as Virtual Hosting.
Types of  virtual Hosting
  • Name based Virtual Hosting
  • IP based Virtual Hosting
  • Port based Virtual Hosting

Requirement for Web Server:

  • Installation Packages
    • httpd*.rpm
  • Port No:
    • 80
  • Configuration File
    • /etc/httpd/conf/httpd.conf
  • Service/Daemon
    • httpd
  • Default Database location
    • /var/www/html

Configuration of Web Server

Step1: to configure Web server
Check system IP address
#ifconfig eth0
Assign the host name temporarily and permanent.
#hostname www.yahoo.com
# vi /etc/sysconfig/network
Edit the hostname
HOSTNAME=www.yahoo.com
:wq!
Add the host entries.
#vi /etc/hosts
go to insert mode
192.168.0.177    www.yahoo.com   www
192.168.0.177    www.group.com   www
192.168.0.176    www.gmail.com   www
:wq!
Then logoff & login
Install the packages for web server
#yum install http* -y
 Edit the configuration file
#vim /etc/httpd/conf/httpd.conf
Set the line numbers
:se nu
990 NameVirutalHost *:80 (remove the hash(#) and enable the line)
1003 <vitualhost*: 80>#NAME BASED HOSTING
         ServerAdmin root@yahoo.com
          DocumentRoot /var/www/html
          Servername www.yahoo.com
          DirectoryIndex yahoo.html
          </VirtualHost>
          <VirtualHost 192.168.0.176: 80>#IP BASED HOSTING
         ServerAdmin root@gmail.com
          DocumentRoot /var/www/html
          Servername www.gmail.com
          DirectoryIndex gmail.html
          </VirtualHost>
        <VirtualHost 192.168.0.177: 5000>#PORT BASED HOSTING
         ServerAdmin root@group.com
          DocumentRoot /var/www/html
          Servername www.group.com
          DirectoryIndex group.html
          </VirtualHost>
:wq!
 
Create HTML pages
#cd /var/www/html
html]#vi yahoo.html
html]#vi gmail.html
html]#vi group.html
Update the service
#service httpd restart
#chkconfig httpd on
Go the Sys2, Web Server client configuration
#vi /etc/hosts
Do not remove any entry which already exists
192.168.0.177    www.yahoo.com   www
192.168.0.177    www.group.com   www
192.168.0.176    www.gmail.com   www
:wq!
Logoff & Login
 
 

Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Multiply Negative numbers in java