7.-NT208-Lecture7 - WebServer
7.-NT208-Lecture7 - WebServer
Web Server
Ths. Trần Tuấn Dũng – [email protected]
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin
Introduction
A web server is specialised software that responds to client (I.e.
web browser) requests
Every web site requires a web server to process client requests and
‘serve up’ the pages
Note that web server in this context is software. Server machine is also referred to as the web server.
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin
System architecture
A web server is part of a multi-tier application
HTTP/1.1 200 OK
Date: Thu, 22 July 1998 18:40:55 GMT
Server: Apache 1.3.5 (Unix) PHP/3.0.6
Last-Modified: Mon, 19 July 1997 16:03:22 GMT
Content-Type: text/html
Content-Length: 12987
...
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin
Freeware.
Virtual host
● An Apache web server can host multiple websites on the SAME server. You
do not need separate server machine and apache software for each website.
This can achieved using the concept of Virtual Host or VHost.
● Any domain that you want to host on your web server will have a separate
entry in apache configuration file.
Configuring .htaccess
Control what user can do, where user can go on your website
Path Traversal!!
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin
RewriteEngine on
RewriteRule "^/foo\.html$" "/bar.html"
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin
API Server
Sometimes we need a server is able to provide data and handle requests for
multiple website with various technology
Web server like Apache will not be suitable since it require complex
configuration
Flexible Server => Only need to transfer enough data for end user site
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin
Json API
Json Format
Restful API
API Request/Response Standard
Restful API
API Request/Response Standard
Restful API
API Request/Response Standard
Restful API
API Request/Response Standard
MVC Architecture
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin
use Illuminate\Database\Eloquent\Model;
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class CarController extends Controller {
/** * Display a listing of the resource. * *
@return Response */
public function index() { // }
/** * Show the form for creating a new resource. * *
@return Response */
public function create() { // }
…
Trường Đại học Công nghệ Thông tin – Đại học Quốc gia Hồ Chí Minh
Bộ môn An toàn thông tin