(2005) Web-2

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Page No.

WEB TECHNOLOGIES
UNIT – II

(1) Explain about personal Web server?


(A) Personal Web Server (PWS) is software that is designed to create and manage a Web
server, also called a Web site, on a desktop computer. It can be used to learn how to set up
and administer a Web site, and it can also serve as a site for testing dynamic Web pages.
When you first start programming dynamic Web pages, you might make a mistake that
causes your Web server to lock up and not service visitors, who are users who use browsers
to make connections and request Web pages. If you test dynamic Web pages using your own
personal Web site rather than a Web site that serves many users beside yourself, errors of
this kind won’t affect other Web programmers and users. PWS has most of the same
functionality as Microsoft Internet Information Server (IIS), which is the Web server
software that many companies use to manage their commercial Web sites.

The main difference between PWS and IIS is that PWS can support only 10 Web
server connections at one time. A Web server connection corresponds to a socket on the
Web server. A socket is an endpoint of a communications connection. Each connection
between a client and a server creates a socket on the server and a socket on the client. Each
socket has a corresponding memory location that specifies information about the connection,
such as the network domain name and communication protocol. Each Web server socket also
has another corresponding memory location that stores incoming data requests from the
user’s Web browser. Every visitor request for a Web page uses a separate connection.
Furthermore, every image file reference within a Web page uses a separate connection. To
make Web pages appear faster, many Web browsers can create up to four simultaneous
connections to a Web site. For example, if a Web page contains references to three graphic
image files, a single request for that Web page would use a total of four Web server
connections. This means that a PWS Web site cannot service Web page request from more
than two or three simultaneous visitors in a timely manner, and cannot be used for large-
scale commercial Web sites. However, PWS provides an excellent environment for setting
up a personal Web server for publishing information on an intranet, for learning about Web
server administrator, and for testing Web programs before moving the programs to a
production Web server, which is a Web server that can be accessed by anyone who is
connected to the Internet.

(2) What are the factors that affect Web sites performance?
(A) Some of the factors that affect the time it takes for a Web site to service a visitor request
includes:

 The speed of the Web server’s network connection]


 The amount of main memory that a Web server has allocated to process Web page
requests.
 The Web server’s processor speed.
 The number of other visitors currently requesting Web site pages or files.
Page No.2

 The size of Web page files and the number and size of their embedded graphic object
files.
 The resource needed by Web-base programs and scripts in Web pages.

Aside from getting faster hardware, more main memory, or running on a faster
network, an easy way to improve the performance of a Web site is to limit the size of your
Web page files and the number and size of the graphic object files they contain. Always
assume that visitors will have fairly slow network connections that make Web page files take
much longer to load than they take to load on your local workstation when you are testing
the Web page. Each graphic object in an HTML file uses a separate Web server connection
to transfer the file to the visitor’s browser, which puts an additional burden on your Web
server. Try to use graphics sparingly in your Web pages, and when you do use graphics, keep
the graphic object files as small as possible.

(3) How the files are referred on a Web server?


(A) See the different types of URL (4th question) in unit-1.

(4) Compare personal Web server with other Web servers?


(A) One of the main functions of Personal Web server is to provide an environment where
Web programmers can test their programs and Web pages. Therefore, PWS supports the
most common server-side programming approaches that can be used with production Web
servers such as Microsoft Internet Information Server (IIS). PWS can run CGI programs or
scripts and Active Server Pages (ASPs). ASPs, in turn, can call compiled ActiveX programs
written in C, C++, Visual Basic, and many other programming languages. This makes PWS
an excellent learning and testing environment for Web programming.

One difference between PWS and IIS is that IIS has many more sophisticated
administrative features. For example, IIS provide a utility that generated more detailed
monitoring reports on how your Web site is being accessed by visitors. Additionally, the
Internet service Manager (ISM) utility within IIS provides the following additional Web site
configuration features:
 Supports directory browsing that can be enabled or disabled for specific directories
rather than for the entire Web site.
 Provides Write access for virtual directories. (Recall that PWS only supports Read,
Script, and Execute access.) Write access allows visitors browsers to upload as well as
download files to a Web server, effectively turning the Web server into an FTP server
that enables users to upload and download files.
 Allows the Web server administrator to tune the Web site for the number of excepted
hits per day. Web server memory is allocated to service visitor requests, and a Web
site that receives a high volume of requests needs more main memory for servicing
these requests than one that receives fewer requests. When main memory is allocated
to service visitor requests, it cannot be used for other processing tasks, which slows
down the overall Web service response time.
 Provides a higher level of security through NT file system permissions.
Page No.3

Writing scripts and programs for Web servers is conceptually the same regardless of
the Web server listener process. The primary difference involves the Web server operating
system. Some Web programs cannot run on some operating systems; for example, Visual
Basic programs will not run on a UNIX-based Web server.

(5) Explain about Cookies?


(A) A cookie is a data file that is written on the user’s workstation by a program within a
Web page. A cookie contains information that is stored by a Web server on a Web site
visitor’s computer. Cookies are often used to store information about which pages a user has
viewed on a Web site, how many times a user has visited a site, and what information a user
has entered during pat visits, such as name or shopping preferences. Cookies provide a
convenient way to pass variable values among different Web pages in the same application.
A cookie stores information in pairs of variable names and associated values, where
each variable name has an associated value. Each cookie name/value pair is separated from
the next by a semicolon (;). For example, a cookie that stores the user ID and password
entered in the Login – Order Tracking form might have one cookie variable named userid
that stores the value harrispe. And a second cookie variable named password that stores the
value asdfjka. This information would be stored in the cookie in two/name pairs, as follows:

Userid = harrispe; password = asdfjka;

A single cookie can store a maximum of 20 name/value pairs, or a maximum of 4096


characters. If the 20-name/value-pair limit is reached before the cookie accumulates 4096
characters, then the most recent name/value pairs are stored, and the oldest pairs are dropped.
If the 4096-character limit is reached before the 20-variable/value-pair limit, the cookie
values cannot be read within a VBScript procedure.

There are two types of cookies: temporary and persistent. Temporary cookies stores
information in the main memory of the user’s computer and are only valid during the
browser session in which they are created. When the user exits his or her browser, this
memory is reclaimed by the system, and the cookie information is no longer available.
Persistent cookies store information in text files on the user’s workstation, and this
information is available in subsequent browser sessions, after the user exits his or her
browser. Persistent cookies have an expiration date, and are deleted by the system after a
specific time interval.

(6) Explain the methods to display different Web pages and share cookie values?
(A) An important application of cookies is sharing data values among different Web pages in
an application. There are two ways to display a different Web page using a client-side script.
You can start a new browser session and open a new browser window with the new Web
page displayed, or you can display the new Web page in the current browser window.

Displaying a Web page in a new browser window: Sometimes, it is desirable to open a


new browser window to display a different Web page. This is usually done when the new
Page No.4

Web page is unrelated to the current page or does not have to share data with the current
Web page. For example, many commercial Web sites automatically open new browser
windows to display advertisements. This allows the user to have multiple browser windows
open at the same time, and to view multiple Web pages simultaneously.

Now you will modify the Login – Order Tracking form file so that it displays the
Order Tracking form in a separate browser window. The keyword window is used to
reference the browser window. To open a new browser window using VBScript, you use the
open method. This method has the following format:

Window.Open [URL], [Target], [Option List]

The URL parameter is the address of the document that you want to display in the
window. This could be a file URL, or a relative or absolute URL that references folders on
the Web server.

The Target parameter is the name that you give to the new window. This name will be
used to reference the window in other scripts or procedures, and it cannot contain any blank
spaces. The Option List parameter allows you to specify the properties of the new browser
window.

Navigating to a new Web page in the current browser window: Another way to display a
new Web page programmatically within a VBScript program is to display the new page in
the current browser window using the navigate method. This method prevents you from
having to close multiple browser windows and uses less space on the windows taskbar. The
navigate method has the following format:

Navigate (“[Web page URL]”)

The Web page URL can use either a relative or absolute folder path.

You might also like