Sie sind auf Seite 1von 32

WEB SERVER

DAY-24
What is a Web server?
WEB CLIENTS
All Browsers are web based software to access WebPages.
Eg:-
Internet Explorer Mozilla
Netscape Navigator Konqueror
Mosiac lynx
WEB
WEB SERVERS WEB CLIENTS

WEB SERVERS

IIS
PWS
Sambar
PLESK
NETSCAPE
I-PLANET
Apache


PORT
NO.===80
Process of Web
The Most Popular & widely used Web Server is Apache.
Apache is a freeware.
Apache can be configured in both windows and UNIX.
www.apache.org
In Solaris 8 Apache is inbuilt.

Configuring APACHE
WEB SERVER
Zoom30
192.168.10.230
zoom.com
Main configuration file for apache is httpd.conf
# vi httpd.conf
ServerAdmin root@zoom.com
ServerName zoom.com
Port 80
User nobody
Group nobody
DocumentRoot /var/apache/htdocs
DirectoryIndex index.html
:wq!
# cd /etc/apache
# cp httpd.conf.example httpd.conf
Start / Stop Web Service
Daemon for apache is httpd.
# cd /etc/init.d
#./apache start
httpd starting

#./apache stop
httpd stopping
OR
# cd /usr/apache/bin
# ./httpd start
# ./httpd stop
#pgrep httpd
INTEGRATION OF WEB WITH DNS
Ensure DNS is already running on the
webserver.
If DNS is running on different machine then
1) add A record and PTR record of webserver in DNS Server.
2) Configure web server as a DNS Client.
NOTE:- After DNS entries have been updated
then restart the DNS Service.
TESTING THE WEB SERVER
After successful configuration of DNS/WEB invoke the
browser and test for the homepage.
Web clients might be windows based or UNIX.
What we require is the web browser.
( Internet explorer OR Netscape)
VIRTUAL HOSTING
A web server can host more than one domain.
This can be accomplished with the help of virtual hosting.
Virtual hosting can be implemented in 3 ways
1) Name Based Virtual Hosting.
2) I.P Based Virtual Hosting.
3) Port Based Virtual Hosting.
The term Virtual Host refers to the practice of running more than
one web site on a single machine.
Name Based Virtual Hosting.
WEB SERVER
Zoom30
192.168.10.230
zoom.com
New Virtual Host
Domain solaris4u.com
I.P 192.168.10.230
# vi /etc/apache/httpd.conf
NameVirtualHost 192.168.10.230
<VirtualHost 192.168.10.230>
ServerName www.solaris4u.com
ServerAdmin root@solaris4u.com
DocumentRoot /var/apache/htdocs/solaris4u
DirectoryIndex index.html
</VirtualHost>
:wq!
For example,
suppose that you are serving the domain www.zoom.com and
you wish to add the virtual host www.solaris4u.com,
which points at the same IP address.
Then you simply add the following to httpd.conf:
# cd /var/apache/htdocs
#mkdir solaris4u
# ls
Index.html
#
RE- Start Web Service
Integration with DNS
#vi /etc/named.conf
zone solaris4u.com { type master;
file solaris4u.hosts
};
:wq!
Add the following entries for the domain solaris4u.com
Now Create the FLU zone ( solaris4u.hosts )
# vi solaris4u.hosts
@ IN SOA solaris4u.com. root.solaris4u.com. )
07242003 ;
2H ;
1H ;
3D ;
3600 ) ;
IN NS zoom30.solaris4u.com.
IN A 192.168.10.230
:wq!
# cd /var/named
# cp zoom.hosts solaris4u.hosts
# vi solaris4u.hosts

:0,$s/zoom.com/solaris4u.com/g
RESTART DNS
# nslookup
Default Server zoom.com
name Server 192.168.10.230
> solaris 4u.com
Now TEST the new domain by opening the Browser.
IP Based Virtual Hosting.
WEB SERVER + DNS
Zoom30
192.168.10.230
zoom.com
New Virtual Host
Domain Cisco2u.com
I.P 192.168.2.230
As the term IP-based indicates,
the server must have a different IP address for each
IP-based virtual host.
This can be achieved by the machine having
several physical network connections, or
by use of virtual interfaces
# vi /etc/apache/httpd.conf
NameVirtualHost 192.168.2.230
<VirtualHost 192.168.2.230>
ServerName www.cisco2u.com
ServerAdmin root@cisco2u.com
DocumentRoot /var/apache/htdocs/cisco2u
DirectoryIndex default.html
</VirtualHost>
:wq!
For example,
There are security partitioning issues, such as company1 does
not want anyone at company2 to be able to read their data except
via the web.
Then you simply add the following to httpd.conf:
# cd /var/apache/htdocs
#mkdir cisco2u
# ls
default.html
#
RE- Start Web Service
Integration with DNS
#vi /etc/named.conf
zone cisco2u.com { type master;
file cisco2u.hosts;
};
zone 2.168.192.in-addr.arpa { type master;
file cisco2u.rev;
};
:wq!
Add the following entries for the domain cisco2u.com
Now Create the FLU zone (cisco2u.hosts ) AND
RLU zone (cisco2u.rev )
# vi cisco2u.hosts
@ IN SOA cisco2u.com. root. cisco2u.com. )
07242003 ;
2H ;
1H ;
3D ;
3600 ) ;
IN NS zoom30. cisco2u.com.
IN A 192.168.2.230
:wq!
# cd /var/named
# cp zoom.hosts cisco2u.hosts
# vi cisco2u.hosts

:0,$s/zoom.com/cisco2u.com/g
# pwd
/var/named
# cp zoom.rev cisco2u.rev
# vi cisco2u.rev

:0,$s/zoom.com/cisco2u.com/g
# vi cisco2u.rev
@ IN SOA cisco2u.com. root. cisco2u.com. )
07242003 ;
2H ;
1H ;
3D ;
3600 ) ;
IN NS zoom30.cisco2u.com.
230 IN PTR cisco2u.com.
:wq!
RESTART DNS
# nslookup
Default Server zoom.com
name Server 192.168.10.230
> cisco2u.com
Now TEST the new domain by opening the Browser.
PORT Based Virtual Hosting.
WEB SERVER + DNS
Zoom30
192.168.10.230
zoom.com
New Virtual Host
Domain zoom.com:8585
I.P 192.168.10.230
# vi /etc/apache/httpd.conf
Listen 8585
NameVirtualHost 192.168.10.230
<VirtualHost 192.168.10.230:8585>
ServerName www.zoom.com
ServerAdmin root@zoom.com
DocumentRoot /var/apache/htdocs/test
DirectoryIndex index.html
</VirtualHost>
:wq!
For example,
There are security issues, such as company does not want only
some users to access important information then they can depend
on port based.
Then you simply add the following to httpd.conf:
# cd /var/apache/htdocs
#mkdir test
# ls
index.html
#
RE- Start Web Service

Das könnte Ihnen auch gefallen