Tài liệu hướng dẫn quản lý user, phân quyền trong Ubuntu (linux) - 10B4 FithouTú Cao
Tài liệu hướng dẫn bạn quản trị, tạo user, quản lý group và phân quyền chmod, chown... trên hệ điều hành Ubuntu (linux).
Hy vọng có thể giúp ích cho bạn nào đó khi tìm hiểu và học về Ubuntu (linux), vì là bài tập nên có chỗ nào sai xót mong người đọc thông cảm vì kiến thức nhóm còn hạn chế.
Bùi Trương Đức Công
Hoàng Gia Linh
Nguyễn Cao Tú
10B4 - Viện ĐH Mở Hà Nội 2013.
The document describes an Android application that was created to help users contact emergency services during times of crisis. The application allows users to register their personal details and emergency contacts. It provides one-click access to call emergency contacts, contact emergency hotlines via SMS, and locate the nearest hospitals, ambulance services, fire stations and police stations on a map. Future improvements planned include dynamically retrieving emergency hotline numbers based on the user's location. The goal is to create an easy-to-use app that can save lives during emergencies.
These thesis will focus on understanding and briefing introduction about Spring framework, superior properties, outstanding features in creative application that requires modularizing and capacity of reusing high. Beside that, further description of some technologies such as JMS, MongoDB, AngularJS and Bootstrap which are currently software companies use to create a web application enterprise with Spring framework
This document provides instructions for installing and configuring the Apache web server on UNIX systems. It discusses downloading and unpacking the Apache source code, running the configure script, compiling the code, and installing the Apache files. It also explains how to configure Apache by editing the httpd.conf file to set parameters like the listening port, document root, and virtual directories. The document outlines how to start, stop and restart Apache using the apachectl script for easy management.
Tài liệu hướng dẫn quản lý user, phân quyền trong Ubuntu (linux) - 10B4 FithouTú Cao
Tài liệu hướng dẫn bạn quản trị, tạo user, quản lý group và phân quyền chmod, chown... trên hệ điều hành Ubuntu (linux).
Hy vọng có thể giúp ích cho bạn nào đó khi tìm hiểu và học về Ubuntu (linux), vì là bài tập nên có chỗ nào sai xót mong người đọc thông cảm vì kiến thức nhóm còn hạn chế.
Bùi Trương Đức Công
Hoàng Gia Linh
Nguyễn Cao Tú
10B4 - Viện ĐH Mở Hà Nội 2013.
The document describes an Android application that was created to help users contact emergency services during times of crisis. The application allows users to register their personal details and emergency contacts. It provides one-click access to call emergency contacts, contact emergency hotlines via SMS, and locate the nearest hospitals, ambulance services, fire stations and police stations on a map. Future improvements planned include dynamically retrieving emergency hotline numbers based on the user's location. The goal is to create an easy-to-use app that can save lives during emergencies.
These thesis will focus on understanding and briefing introduction about Spring framework, superior properties, outstanding features in creative application that requires modularizing and capacity of reusing high. Beside that, further description of some technologies such as JMS, MongoDB, AngularJS and Bootstrap which are currently software companies use to create a web application enterprise with Spring framework
This document provides instructions for installing and configuring the Apache web server on UNIX systems. It discusses downloading and unpacking the Apache source code, running the configure script, compiling the code, and installing the Apache files. It also explains how to configure Apache by editing the httpd.conf file to set parameters like the listening port, document root, and virtual directories. The document outlines how to start, stop and restart Apache using the apachectl script for easy management.
Course : Introduction to Big Data with Apache Spark : http://ouo.io/Mqc8L5
Course : Spark Fundamentals I : http://ouo.io/eiuoV
Course : Functional Programming Principles in Scala : http://ouo.io/rh4vv
The document discusses installing Cloudera Hadoop (CDH 4) on Ubuntu 12.04 LTS. It provides an overview of Hadoop and its components. It then outlines the installation steps for Cloudera Hadoop which include preparing the system by installing prerequisites like OpenSSH, configuring password-less SSH and sudo, editing the host file, installing MySQL and the JDBC connector, and downloading and running the Cloudera Manager installer.
Bài 1 Lập trình website theo mô hình MVC - Xây dựng ứng dụng webMasterCode.vn
Cách tổ chức mô hình MVC
Ưu điểm của mô hình MVC trong việc phát triển
ứng dụng web
Cách tạo và gọi hàm theo phong cách mô hình
MVC
Phân biệt khi nào nên forward hoặc chuyển
hướng yêu cầu HTTP
Giới thiệu về framework CakePHP
Equal Cost Multipath Routing in FOKUS OpenSDNCoreHai Dinh Tuan
This document discusses implementing equal cost multipath routing (ECMP) in the OpenSDNCore software-defined networking (SDN) controller. It begins with introductions to ECMP and SDN, then outlines problems with routing, communication between controllers and switches, and packet forwarding. It proposes using the arc cutting method to calculate multiple equal cost paths and the OpenFlow FlowMod and GroupMod messages to implement paths on switches. Random and hash-based approaches to packet forwarding across paths are presented and compared. A demo topology is shown, with expected outcomes being successful ECMP implementation, documentation, communication, and experiences gained.
Traffic Engineering in Software-Defined NetworksHai Dinh Tuan
1. The document discusses new opportunities and challenges for traffic engineering (TE) in software-defined networks (SDN). It outlines several research directions for TE techniques in SDN, including efficient flow management, fast recovery mechanisms, consistency during network updates, and low-overhead traffic analysis.
2. Specific TE techniques discussed include switch and controller load balancing for flow management, reactive and proactive data plane restoration for fault tolerance, and adaptive monitoring for traffic analysis. Consistency during network changes can be achieved using configuration versioning.
3. While SDN enables simpler, more flexible and reliable TE, open challenges remain around hybrid SDN implementations, incremental adoption, and the need for continued collaboration between academia and industry.
In this project, we develop a non-profit company, bringing practical experiences to young students through various activities such as workshops, company tours, meet and greet, etc. With this opportunity, students can discover their hidden talents and true passions, in order to make precise decisions for future careers. One of the special aspects of this project is the use of "Makerspace" model in order to maximize the creativity of students. We have organized several sessions for young scholar, with the cooperation with various organizations and companies, especially with the help from Kista Science City.
Recently, UWB (Ultra Wide Band) has attracted a lot of attention and become one of the most promising successor for short-range wireless communication technologies. The project aims to provide a extensive knowledge about this potential technology. Not only giving a introduction, we also compared advantages and disadvantages of UWB technology with currently used standards like 802.11a/b/g, 2G Cellular, Ethernet, Bluetooth, FastEthernet in terms of power consumption, spectral density, robustness against multipath and penetration capability, data rate in short distance, carrier-less transmission, etc. Additionally, we examine current applications and potential commercial uses of UWB in the future as an evidence for the versatile of this technology.
Effective presentations require thorough preparation including choosing a simple color scheme and appropriate fonts, designing creative yet uncomplicated slides, and practicing to maintain eye contact and avoid just reading slides. Preparation such as making a clear plan, focusing on simplicity, selecting colors and fonts, and rehearsing delivery is key to an effective presentation according to experts.
The document provides an overview of Apache Mod Security including regular expressions, rules usage, default actions, chained actions, persistent collections, transformation functions, and content validation. It discusses using regular expressions to match strings and define rules. It explains how to set default actions, chain rules together, and use persistent collections to store variables across transactions. Transformation functions and various validation techniques like validating byte ranges, DTDs, schemas, URL encoding, and UTF-8 encoding are also covered.
ResourceSpace is an open source digital asset management application that provides a centralized database for organizing, managing, and distributing digital assets. It offers advantages like being open source to lower costs, being completely web based for easy access from anywhere, and compatibility to avoid vendor lock-in. The demonstration showed features like file storage and sharing, searching, custom collections, permissions management, and reporting capabilities.
2. What is a Web Server???
Web server là một máy
chú đảm nhận chức năng
thu nhận và xử lý các bản
tin HTTP Request, sau đó
phản hồi lại cho client các
thông tin tương ứng.
4. Apache Web Server at a
Glance
Bắt đầu từ năm 1996
Là một phần mềm mã nguồn mở
Website chính thức: Apache.org
Được sử dụng rộng rãi nhất trong các WWW Server
5. APACHE HTTP SERVER ARCHITECTURE
Modular
Design
Apache
Core
Other
Modules
6. Apache Core
Cung cấp các tài nguyên phù hợp cho từng request mà Web Server
nhận được.
http_protocol.c
http_main.c
http_request.c
http_core.c
alloc.c
http_config.c
7. Apache Core
http_protocol.c
Chứa các thủ tục làm nhiệm vụ giao tiếp trực tiếp với các client
thong qua socket bằng giao thức HTTP. Tất cả các công việc trao đổi
dữ liệu với client đều do thành phần này đảm trách.
http_main.c:
Thành phần làm nhiệm vụ khởi động server và tạo vòng lặp
chính để đợi và chấp nhận các kết nối. Đồng thời cũng làm nhiệm vụ
quản lý các bộ thời gian timeout.
8. Apache Core
http_request.c:
Thành phần này làm nhiệm vụ quản lý các tiến trình xử lý bản
tin request, đảm bảo chuyển các bản tin điều khiển tới các module
phù hợp theo đúng thứ tự. Ngoài ra, nó còn đảm nhận vai trò quản
lý các lỗi xảy ra trên server.
http_core.c:
Thành phần này sẽ triển khai các chức năng cơ bản nhất của
Apache.
9. Apache Core
alloc.c:
Thành phần kiểm soát việc phân chia tài nguyên và lưu trữ các
thông tin về sự phân chia đó.
http_config.c:
Đảm nhận vai trò xử lý file cấu hình và hỗ trợ cho các virtual
host. Một trong những chức năng quan trọng của thành phần này là
liệt kê những module được sử dụng trong Apache.
11. Request Processing
1. Phân giải địa chỉ
2. Kiểm tra truy nhập và cấp quyền truy cập đến những tài nguyên
cần thiết
3. Xác định MIME (Multipurpose Internet Mail Extensions) của đối
tượng bị truy vấn. Tức là thông tin về kiểu định dạng của tài
nguyên trên server được gọi tên trong gói HTTP Request
4. Chỉnh sửa lại một số thông tin, ví dụ thay đổi alias thành một
đường dẫn thực (định nghĩa alias sẽ được trình bày trong phần
về mod_alias dưới đây)
5. Gửi trả dữ liệu lại cho client.
6. Ghi lại log.
12. Communicating between
Modules
Các modules không liên lạc trực tiếp với nhau, mọi giao tiếp đều
phải thông qua core. Mô hình sau đây trình bày mô hình trao đổi
thông tin của các modules:
13. Handler
Handler là một hành động được Apache định nghĩa riêng cho
từng loại file nhất định. Mặc định sau khi cài đăt Apache thì tùy
theo loại file mà sẽ được xử lý theo các cách khác nhau.
Handler có thể được cấu hình dựa trên phần mở rộng của file
(extension) hoặc theo từng thư mục khác nhau.
14. Handler
Mặc định, có sẵn 7 handler trong hệ thống như sau:
Send-as-is: sử dụng trong module mod_asis, dùng để gửi
trả gói tin cho client mà không sử dụng đầy đủ các thông số
trong HTTP header.
Cgi-script: coi file là một cgi-script.
Imap-file: sử dụng chung với mod_imagemap
Server-info: lấy thông tin về cấu hình của server
Server-status: lấy thông tin về trạng thái của server.
Type_map: sử dụng cùng với module mod_negotiation.
15. Modules
Các module có thể đã được cài đặt sẵn trong quá trình build
Apache, hoặc cũng có thể cài đặt thêm. Mặc định có sẵn các module
sau:
Chuyển đổi giữa URI thành filename trên server:
Mod_userdir: chuyển thư mục home cho từng user.
Mod_rewrite: điều chỉnh lại đường dẫn URL.
Giai đoạn Xác thực / phân quyền:
mod_auth, mod_auth_anon,mod_auth_db, mod_auth_dbm:
các kiểu xác thực người dùng.
Mod_access: kiểm soát truy nhập theo từng host.
16. Modules
Xác định MIME của đối tượng được truy vấn:
mod_mime: xác định loại file bằng cách dựa vào phần mở
rộng.
mod_mime_magic: xác định loại file bằng cách sử dụng
“magic number”
Chỉnh sửa đường dẫn:
Mod_alias: thay thế alias bằng đường dẫn thực trên server.
Mod_env: thay đổi các tham số hệ thống dựa trên thông
tin trong file cấu hình.
Mod_spelling: tự động sửa lỗi trong URL.
17. Modules
Gửi trả lại dữ liệu cho client:
Mod_actions: các script cho từng loại file sẽ được thực thi.
Mod_asis: gửi file nguyên dạng
Mod_autoindex:
Mod_cgi: gọi script CGI và trả lại kết quả.
Mod_include:
Mod_dir: xử lý về thư mục
Mod_imap: xử lý image-map files.
Ghi log:
Mod_log_*: các module log khác nhau.
19. Apache Configuration File
File cấu hình chính của Apache mặc định nằm ở đường dẫn
/etc/httpd/conf/httpd.conf
20. Apache Configuration File
Gồm các thành phần chính:
1. Global Environment:
Tham số môi trường toàn cục: Các thông số này được cấu hình để điều khiển hoạt
động của toàn bộ Apache Server.
2. Các directive định nghĩa các thông số của ‘main’ hay
‘default’ server.
Khi một request đến Apache Server mà không được Virtual
Host nào xử lý thì các thông số này sẽ quyết định hành động
của Apache Server. Các tham số này cũng đồng thời xác lập
các giá trị mặc định cho tất cả các Virtual Host.
3. Các tham số riêng cho từng virtual host.
21. Config/ Global
Environment
1. ServerToken & ServerSignature
ServerSignature Off
ServerTokens Prod
giảm nguy hơ bị lộ thông tin về phiên bản Apache
đang chạyTrên server
2. ServerRoot
Cấu hình thư mục lưu trữ chính của Apache
22. Config/ Global
Environment
3. PidFile
Thông số này lưu trữ đường dẫn đến file httpd.pid, là file
lưu giữ process ID của Apache mỗi khi khởi chạy.
4. Timeout
Thời gian time out cho hệ thống, giá trị mặc định
5. KeepAlive
Cho phép hay không kiểu kết nối KeepAlive được hoạt
động. KeepAlive là một hình thức có thể giúp tăng tốc độ tải
trang khi không mở kết nối cho từng gói request một. Tuy
nhiên, khi bị tấn công DDoS thì nên tắt chức năng này để
giảm thiểu ảnh hưởng tới hệ thống.
KeepAliveTimeout
23. Config/ Global
Environment
6. Listen
Thông số này dùng để cấu hình địa chỉ IP và port mà
Apache sẽ nhận các gói HTTP Request
7. LoadModule
Dùng để chọn những module nào sẽ được khởi động
cùng với hệ thống Apache.
8. Include
Cấu hình thư mục chứa file config
24. Config/ Main Server
Configuration
1. ServerAdmin
Cấu hình địa chỉ email của người quản trị, thông tin
này sẽ được hiển thị trên một số trang web nhất định,
ví dụ như trang báo lỗi.
2. UseCanonicalName
Thông thường khi sử dụng Name-based Virtual Host
thì nên set thông số này là Off
3. DocumentRoot
Thư mục lưu trữ các đường dẫn chứa mã nguồn của
website. Các request từ client thông thường sẽ chỉ
truy xuất được thông tin từ thư mục này.
25. Config/ Main Server
Configuration
4. DirectoryIndex
Chỉ định file mặc định được trả về cho client khi có
request tới một thư mục nào đó. Thông thường các
file như index.html, index.php sẽ được sử dụng.
DirectoryIndex index.html index.html.var
5. AccessFileName
Chỉ định file bổ sung các cấu hình riêng cho từng
thư mục nhất định. Thông thường sẽ là file
“.htaccess” như sau:
26. Config/ Main Server
Configuration
6. TypesConfig
Chỉ đường dẫn đến file mime.types. File này sẽ giúp
cho Apache tra cứu phần mở rộng của file để xác
định MIME type trong HTTP Header.
DefaultType text/plain
Mặc định MIME type cho các file apache không xác
định được sẽ là kiểu file text.
7. HostnameLookups
Cấu hình ghi log tên hostname của client hay chỉ
địa chỉ IP của client.
27. Config/ Main Server
Configuration
8. ErrorLog
Cấu hình đường dẫn lưu trữ Error của hệ thống
9. LogLevel
Mức độ ghi log. Giống như syslog, log trong Apache cũng
được ghi chia thành 7 mức độ khác nhau, từ cao xuống thấp
là emergency, alert, critical, error, warning, notification,
informational, debug.
10. Log
28. Apache Virtual Host
Bằng cách sử dụng Virtual Host trong Apache HTTP
Server, người quản trị có thể chạy đồng thời nhiều website
trên cùng một server. Với kỹ thuật này, tài nguyên của server
được tận dụng hiệu quả tối đa.
Có hai loại cấu hình Apache sẽ được trình bày, bao gồm:
1. IP-based Virtual Host
2. Name-based Virtual Host
29. IP Based Virtual Host
Apache Server
1.1.1.1 1.1.1.2
A.com B.com Trỏ từng website vào
các địa chỉ khác nhau
=> trên server cần có
nhiều hơn 1 địa chỉ IP
30. Name-based Virtual Host
Thông tin hostname được lưu
trong phần Header của bản tin
Apache Server
HTTP Request. Khi nhận các bản
1.1.1.1 tin Request này thì Apache sẽ
A.com
chuyển đển các virtual host
B.com
tương ứng để xử lý
=> Chi cần sử dụng 1 IP, trỏ
nhiều domain name vào cùng IP
đó
31. Virtual Host Configuration
Cấu hình virtual host được thực hiện trong file httpd.conf
hoặc file httpd-vhosts.conf
Với cấu hình Virtual Host, cần cầu hình các thành phần sau
đây:
Đường dẫn đến thư mục lưu trữ web.
Server Name.
Đường dẫn đến file log.
33. Multiprocessing
Có 2 khái niệm về khả năng xử lý của Web Server :
Single-threaded Web Server: Không có khả năng xử lý
đồng thời nhiều request cùng một lúc
Multi-thread Web Server: Có khả năng xử lý nhiều
request cùng lúc, gồm 2 kỹ thuật chính:
Miltiprocess: Tạo Process mới cho từng Request.
Multithread: Tạo Thread mới cho từng Request.
34. Process vs Thread
sử dụng kỹ thuật đa nhiệm dựa vào thread sẽ tiết
kiệm được tài nguyên phần cứng và tăng tốc độ xử lý
giữa các tác vụ khác nhau. Kiểu xử lý đa nhiệm bằng
cách tạo process sẽ ấn định bộ nhớ cho từng request
được nhận, do vậy khả năng xử lý của kỹ thuật này có
phần hạn chế hơn.
35. Multiprocessing in Apache
Trong Apache cũng có các module có chức năng hỗ trợ
khả năng xử lý đa nhiệm cho server. Các module này được gọi
là Multiprocessing Modules (MPMs).
Trong Apache quan tâm chủ yếu đến 2 MPMs:
prefork
worker
36. Prefork vs. Worker
Prefork Worker
Multiprocessing Multithreading
Tạo ra các process riêng biệt Tạo ra các thread riêng biệt => phù hợp hơn
đối với các hệ thống xử lý đa lõi
Lỗi trên 1 process không thể gây ảnh hưởng Khi có lỗi xảy ra trên 1 thread thì các thread
lên các process khác cùng process có thể bị ảnh hưởng
Việc lựa chọn kỹ thuật xử lý còn tùy thuộc vào nhiều yếu tố khác của server, ví dụ PHP không
hoạt động ổn định với hình thức chia sẻ bộ nhớ chung của Worker nên thường phải sử dụng
Prefork
37. APACHE
MODULES
Nằm bên trong các Modules cũng
như file cấu hình Apache nhằm chỉ thị
các hoạt động của Apache.
38. APACHE
MODULES
► Description: tổng quát chức năng
► Status: (MPM, Base, Extension,
Experimental, External).
► Module Indentifier
► Source file
39. MODULES – MOD_CACHE
Cache nội dung trang web, làm tăng tốc độ truy cập website – cần sử dụng kết hợp module này
với mod_disk_cache hoặc mod_mem_cache.
Config:
<IfModule mod_cache.c>
LoadModule mem_cache_module modules/mod_mem_cache.so
<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 4096
MCacheMaxObjectCount 100
MCacheMinObjectSize 1
MCacheMaxObjectSize 2048
</IfModule>
</IfModule>
40. MODULES –
MOD_GZIP/DEFLATE
Nén dữ liệu trước khi gửi tới client
Config:
<Location />
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Don’t compress image
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-v
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
41. MODULES – MOD_SSL
Mã hóa dữ liệu sử dụng giao thức Secure Sockets
Layer ( SSL ) và bảo mật giao thức ở tầng giao vận (
TLS )
Config:
<VirtualHost *:443>
ServerAdmin usera.com
DocumentRoot "/var/www/html/tien.td/"
SSLEngine on
ServerName usera.com
SSLCertificateFile
/var/www/html/tien.td/ssl/server.crt
SSLCertificateKeyFile
/var/www/html/tien.td/ssl/server.key
</VirtualHost>
42. Nội dung
Giới thiệu
Tóm tắt và cấu hình các module
Cách hoạt động và so sánh
Lab
43. Giới thiệu
php_module : được đánh giá nhanh nhất, bảo mật
kém. (DSO)
cgi_module : giúp php process tách biệt với process
của apache, hỗ trợ chạy user riêng
biệt (suexec on). Chậm hơn mod_php 36 lần.
cgid_module : tương tự như mod_cgi nhưng được
enable nếu chọn multi threaded
MPM (worker) khi compile.
suphp_module: nâng cao độ bảo mật, chậm hơn so với
php_module và cgi (suexec off),
nhanh hơn cgi (suexec on). Chậm hơn mod_php
25 lần.
fcgid_module : nhanh hơn mod_suphp, và độ bảo mật
cao.
44. Mod_php
PHP interpreter được load vào apache process
PHP khởi động cùng với apache, load nhanh
Cấu hình:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
45. Mod_cgi
Với mỗi request, web server spawns 1 process mới để run CGI program.
CGI tách biệt với apache, giao tiếp qua pipe I/O
Khởi tạo Process để xử lý 1 request, terminate sau đó
Cấu hình:
ScriptAlias /local-bin /usr/local/bin
AddHandler application/x-httpd-php5 php
Action application/x-httpd-php5 /local-bin/php-cgi
<Directory "/usr/local/bin">
Order allow,deny
Allow from all
</Directory>
46. Mod_suphp
Hoạt động như cgi nhưng có cơ chế riêng để thực thi quyền user
Cấu hình:
httpd.conf
webserver_user=apache
x-httpd-php=php:/usr/bin/php hoặc x-httpd-php="php:/usr/bin/php-cgi"
x-suphp-cgi=execute:!self hoặc x-suphp-cgi="execute:!self"
AddHandler x-httpd-php .php .php3 .php4 .php5
suPHP_Engine on
suPHP_AddHandler x-httpd-php
VirtualHost:
suPHP_UserGroup username groupname
47. Mod_fcgid
Hoạt động như cgi tuy nhiên có 2 điểm khác biệt
Fastcgi process vẫn tồn tại sau khi xử lý request (mặc
định 500)
Apache và fastcgi giao tiếp qua TCP connection
Tiêu thụ nhiều ram do các process chiếm giữ, ít
tốn cpu do không phải thực hiện khởi tạo, chấm
dứt process.
49. SuEXEC
(Switch User for EXEC)
Cho phép CGI scripts chạy theo từng user
Suexec được cấu hình cho mỗi virtual host
Cấu hình:
SuexecUserGroup nobody nogroup