free and open source software (foss) · expert meeting on free and open source software: policy and...

54
1/67 ehesham.cu.edu.eg [email protected] Free and Open Source Software (FOSS)

Upload: others

Post on 13-Oct-2020

4 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

1/67

[email protected]

Free and Open Source Software (FOSS)

Page 2: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

2/67

Page 3: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

3/67

Page 4: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

4/67

Agenda• Introduction.• FOSS World Wide.• Indicators.• Apache• PHP (What/Why/How)• MYSQL (What/Why/How)• FOSS for Africa

Page 5: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

5/67

Page 6: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

6/67

Page 7: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

7/67

Page 8: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

8/67

Page 9: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

9/67

Page 10: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

10/67

Page 11: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

11/67

UNCTAD Expert Meeting on Free and Open Source Software:

Policy and Development Implications

Session 3: Government Usage and Policy23 September 2004

“Technological Neutrality in Software Procurement: The Soundest IT and Procurement Policy”

Robert Kramer, VP of Public PolicyComputing Technology Industry Association

Executive Director, Initiative for Software Choice

Page 12: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

12/67

• Global ReachØ 16,000 Corporate Members in 102 countries, Ø Over 4,000 institutional members and 8,000 IT professional

(individual) membersØ 85%+ of our corporate members are SMEs

• InclusiveØ Members from major industry markets, representing all in the IT

industry; Hardware; Software; Telecommunications; IT Services; IT training;

Ø Corporations and not-for-profit organizations/ Schools, Community Colleges and Universities/government partnerships

• EffectiveØ Largest vendor-neutral provider of IT training certifications,

including Linux+Ø Successful track record of collaboration and facilitation of global

standardsØ Industry driven through members ‘cornerstone’ process

CompTIA: A Global ITC Trade Association

Page 13: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

13/67

London

Amsterdam Düsseldorf

Tokyo

Singapore

JohannesburgSydney

Toronto

International Offices

Chicago, HQWashington DC

Sao Paulo

Hong Kong

BrusselsOttawa

Page 14: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

14/67

FOSS on the Internet• In use on over 5.5 million domains

• Market share of Internet webservers– Apache : 60%– IIS servers (ASP) : 30%

(from http://www.netcraft.com/survey/)

F:\courses2004-2005\InternetTech\webpage\h.htm

Page 15: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

15/67

Page 16: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

16/67

Page 17: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

17/67

Page 18: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

18/67

Apache

Apache: “Industrial strength” HTTP/1.1 compliant web server

• Highly configurable• Implements many features in addition to its core

functionality (e.g., security/access control, virtual hosting, CGI script execution, …)

• Extensible with third-party modules (e.g., servlet engine, security, WebDAV, …)

Page 19: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

19/67

Modules for Apache• mod-ssl (secure HTTP communication

between a browser and a web server): – Provides strong cryptography for privacy– Provides use of digital signatures for data integrity– Allows server and/or client authentication– Integrates SSL/TLS protocols w/ Apache (via

OpenSSL)• mod-dav (publishing into the web

environment):– Provides server support for WebDAV (web-based

distributed authoring and versioning)– Implements WebDAV extensions to HTTP 1.1

Page 20: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

20/67

APACHE

bin conf libexeclogs

htdocs securedocs

(more)

Apache is:•Full-featured and extensible•Efficient•Robust•Secure (at least, more secure than other servers)•Up to date with current standards•Open source•Free

Page 21: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

21/67

Why PHP ?• FOSS technology (Low cost)• High performance• Interfaces to many different database

systems• Built-in libraries for many common Web

tasks• Ease of learning and use• Portability• Availability of source code

Page 22: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

22/67

• Netcraft Statistics– 11,869,645 Domains, 1,316,288 IP Addresses

(Hosting + domain name) cost about 110$/year

About 1.3 G$ …

Page 23: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

23/67

CLIENT

WEB SERVER

HTTP Request(url)

<HTML><?php PHP code ?></HTML>

Gets Page

<HTML><B>Hello</B></HTML>

Interprets the PHP codeServer response

Browser createsthe web page

Hello

Page 24: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

24/67

What is a PHP script ?• Code embedded within tags : jumping

between HTML and PHP (like ASP and Cold Fusion)

• No heavy code to output HTML (as needed in Perl or C)

• PHP code is enclosed in special start and end tags

<html><head><title>Example</title></head><body><?php

echo "Starting to write a PHP script"; ?></body></html>

HTML tags

PHP code

HTML tags

Page 25: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

25/67

PHP is server-sideWhat the web server sees (and executes on-the-fly)<H1>Greetings</H1><P ALIGN="center"><?phpprint ”Hello GEN!";?></P><HR>

What the web browser receives (it never sees PHP code)<H1>Greetings</H1><P ALIGN="center">Hello GEN!</P><HR>

=> it is not possible to copy the source code from the web browser

Page 26: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

26/67

Three-tier architecture

Web brow

ser

Presentation tier

Database server

Data storage tier

Web server

API

CG

IPH

PJSP

Business Logic tier

ASP

CFThin client

Thick server

Page 27: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

27/67

System requirements• Operating systems :Linux, many Unix

variants (HP-UX, Solaris and OpenBSD, ...), Microsoft Windows, Mac OS X, RISC OS, …

• Web servers : Apache, Microsoft Internet Information Server, Personal Web Server, Netscape, iPlanet, Oreilly Website Pro server, Caudium, Xitami, OmniHTTPd, Zeus, ...

• Databases : Oracle, Informix, Sybase, InterBase, PostgreSQL, MySQL, ODBC, ...

Page 28: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

28/67

Get the software FOSS⇒http://www.h-elmahdy.net/graphics/htools.htm 14.3MB⇒http://www.h-elmahdy.net/graphics/books.htmOr from the CD distributed

• After uploading and unzipping you get:

• Double click on this file• It takes about five minutes.• You will get this:

How to install PHPTraid ? (1/4)

Page 29: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

29/67

How to install PHPTraid ? (2/4)• Get the clean run of the Apache, like this

Not like this:

• Your folders in the C:\ drive will have:• Getting your IP address, from DOS

Command Prompt, type ipconfig /allif you are using the free Internet

Page 30: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

30/67

How to install PHPTraid ? (3/4)Or use the TCP/IP properties

Now, you are ready to use your computer as a web server:

In the Internet Explorer, in the address bar, you can use

Server is a process, Client is another process. Both of them can be run on the same computer

Page 31: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

31/67

How to install PHPTraid ? (4/4)Now, everybody can see you in the internet at your IP address

All accounts to be put under this folder

You have to name the first file index.html of the main account and for each account

Page 32: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

32/67

First PHP (to pass parameters)

Page 33: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

33/67

First PHP (to get parameters)

Page 34: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

34/67

Second PHP (Write to a file)

Page 35: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

35/67

Third PHP (Content of a file)

Page 36: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

36/67

Advantages of PHP• Easy to learn… availability of source• Free and open development

(independence, security, community)• Native database connectivity (mysql,

ODBC, …)• Availability for a variety of platforms

(Windows, UNIX, Linux, Mac OS, RISC)• Simple but powerful, thin client• Many functions (databases, mail server,

PDF, …)

Page 37: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

37/67

Disadvantages of PHP• Immature language

• Mixing of HTML and program code : disorganization (application and layout not always well separated), bug prone

• Going to the server every time

• PHP programs are compiled at execution time, and they are distributed in clear text, so it needs more time and effort to be protected

• Can not be integrated with non-based applications

Page 38: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

38/67

MySQL• MySQL is a very popular, open source

database.• Officially pronounced “my Ess Que Ell” (not my

sequel).• Handles very large databases; very fast

performance.• Why are we using MySQL?

– Free (much cheaper than Oracle!)– Each one can install MySQL locally.– Easy to use Shell for creating tables,

querying tables, etc.– Easy to use with Java JDBC

Page 39: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

39/67

§ SQL provides a structured language for querying/updating multiple databases.

§ The more you know SQL, the better.§ The most important part of SQL is learning to

retrieve data.§ selecting rows, columns, boolean operators, pattern

matching, etc.

§ Keep playing around in the MySQL Shell.

Page 40: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

40/67

Adjusting MySQL shell path

Page 41: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

41/67

Running MySQL shellRunning the MySQL

Run Command Prompt,

then type mysql

Page 42: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

42/67

MySQL line commandsList all databases on the sql server:

To delete a db:

Create a db:

Page 43: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

43/67

MySQL line commandsUse a db:

Create a table:

Loading data from a file:

Page 44: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

44/67

PHP program uses MySQL

Page 45: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

45/67

PHP program uses MySQL

Page 46: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

46/67

PHP program uses MySQL

Page 47: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

47/67

PHP program uses MySQL

Page 48: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

48/67

Page 49: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

49/67

Page 50: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

50/67

Page 51: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

51/67

Page 52: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

52/67

Page 53: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

53/67

Page 54: Free and Open Source Software (FOSS) · Expert Meeting on Free and Open Source Software: Policy and Development Implications Session 3: Government Usage and Policy 23 September 2004

54/67

54/35