• 沒有找到結果。

Web Hosting

N/A
N/A
Protected

Academic year: 2022

Share "Web Hosting"

Copied!
18
0
0

加載中.... (立即查看全文)

全文

(1)

Web Hosting

Michael Tsai 2018/05/28

(2)

Web Hosting Basics

A daemon (server) listens for connection on TCP port 80

Accept request for documents

Transmits them to the requesting user’s browser

(3)

Different Layers in Web

Web page (HTML/XML) - frontend engineer

Interface for interaction with users

Program / script (PHP/ASP/etc.) - backend engineer

Generation of web pages, logics, database query

Database (Mysql, PgSQL, etc.) - database admin

Data storage

Web server (apache/nginx) - sys admin

Operating System - sys admin

Our role

(4)

URL

URI = {URL, URN}

URI: Unified Resource Identifier
 URL: Unified Resource Locator
 URN: Unified Resource Name
 (e.g., urn:isbn:0-13-020601-6)

URL: {protocol/app., hostname, [port, directory,

filename]}

(5)

URL Examples

Proto What it does Example

file accesses a local file file:///etc/syslog.conf ftp accesses a remote file

via FTP

ftp://ftp.admin.com/

adduser.tar.gz http accesses a remote file

via HTTP http://admin.com/index.html https accesses a remote file

via HTTP/SSL https://admin.com/order.shtml

ldap accesses LDAP

directory services

ldap://ldap.bigfoot.com:389/

cn=Herb mailto sends email to a

designated address mailto:linux@book.admin.com

(6)

How HTTP works

Stateless client/server protocol

A client 


asks the server for the contents of 
 a specific URL

The server responds with the data (or err. msg.)

Try it: telnet to port 80

(7)

Browser

telnet to www.csie.ntu.edu.tw port 80 
 (http default TCP port)

Type the following:


GET / HTTP/1.1


Host: www.csie.ntu.edu.tw
 (hit <enter> twice)

What do you get?

Try a nonexistent URL. What do you get?

(8)

Content Generation

Dynamic content is better

1. CGI (Common Gateway Interface):


Allow external program to interact with the web server

2. FastCGI: Allow external program to continue running to server multiple requests

3. Embedded interpreters: 


(e.g., Perl, PHP, Python, Ruby on Rails)


Executing external script within the server (.php, .pl)


e.g., LAMP: linux + apache + mysql + php/perl/python 4. Application servers:


Entire, full-fledge, platform for web 


(e.g., Tomcat, WebSphere, WebLogic, Jetty)

(9)

Market Share:


Server-Side Programming Language

2017 2018

(10)

Security!

Bottom line: 


you allow the entire world to execute a script on your server (access to files, networks, and more!)

Need to make sure that the script is secure 


(as much as other network-accessible program)

Read: 


OWASP Top 10 Application Security Risks 2017
 https://www.owasp.org/index.php/Top_10_2017- Top_10

(11)

SSL

SSL = Secure Sockets Layer

http -> https, SSL runs as a layer below HTTP

Prevent eavesdropping, tampering, and message forgery

More on security-related topics in the 6/11 guest lecture

(12)

Load Balancing

Many factors affecting the maximum load a server can handle:

Hardware architecture

Operating system

System tuning

Sites being served 


(static vs dynamic (database))

And, in addition, network bandwidth

Stress testing - CPU, I/O, or network-bound? (usually not network)

(13)

Create Scalability

1. Round robin DNS (we’ve talked about it)
 Note that the order in the DNS record is irrelevant.


(Think about its disadvantage)

2. Hardware solution (e.g., Big-IP from F5)


Takes response time of individual servers into account

3. Software solution (e.g., Linux Virtual Server, proxy load balancing in Apache)

(14)

Scaling Beyond Limits

Cloud computing (e.g., Amazon Web Services)

Co-location hosting (like us, or some NTU services)

Content Distribution Networks (e.g., akamai, limelight, edgecast)

Putting static content close to users

Try: https://www.cdnplanet.com/tools/cdnfinder/

Pick a content-rich website (such as a news website) and see if it uses CDN

(15)

source: https://news.netcraft.com/archives/2017/03/24/

march-2017-web-server-survey.html

(16)

Apache

Web server with the largest market share
 (53.8% of top M busiest sites, 2014/04)

Runner-ups: 


Microsoft & nginx take 17.8% and 12.4%

Began in 1995

First web server software to serve more than 100M sites (in 2009)

Versatile

(17)

Nginx

(pronounced “engine x”)

Created in 2004

Used by 57.0% of the top 10,000 websites.

(W3Techs)

Written with an explicit goal to outperform Apache (less memory, 4x more requests per second)

Less flexibility

(18)

Different Layers in Web

Web page (HTML/XML) - frontend engineer

Interface for interaction with users

Program / script (PHP/ASP/etc.) - backend engineer

Generation of web pages, logics, database query

Database (Mysql, PgSQL, etc.) - database admin

Data storage

Web server (apache/nginx) - sys admin

Operating System - sys admin

Our role

參考文獻

相關文件

In this homework, you are asked to implement k-d tree for the k = 1 case, and the data structure should support the operations of querying the nearest point, point insertion, and

On another level, though, the similarities to the research world are strong: you succeed by building networks, the glue that holds relationships together is the values that you

The Matlab fprintf function uses single quotes to define the format string. The fprintf function

[r]

READING COMPREHENSION and WORLD KNOWLEDGE so make sure to review the reading section in the book. Remember most of this exam is a LISTENING

You need to configure DC1 to resolve any DNS requests that are not for the contoso.com zone by querying the DNS server of your Internet Service Provider (ISP). What should

• To the right of the Draw mode buttons you find push buttons through which you can access all the functions that you need to define and solve the PDE problem: define

With the help of the pictures and the words below, write a journal entry about what happened.. Write at least