L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.

Slides:



Advertisements
Similar presentations
Dan Fleck.  WAMP – Windows Apache MySQL PHP -  LAMP – Linux Apache MySQL PHP ◦ There are.
Advertisements

Server-Side vs. Client-Side Scripting Languages
What is it? –Large Web sites that support commercial use cannot be written by hand What you’re going to learn –How a Web server and a database can be used.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
Multiple Tiers in Action
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
CP476 Internet Computing Browser and Web Server 1 Web Browsers A client software program that allows you to access and view Web pages on the Internet –Examples.
Introduction 2: Internet, Intranet, and Extranet J394 – Perancangan Situs Web Program Sudi Manajemen Universitas Bina Nusantara.
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
E-Commerce The technical side. LAMP Linux Linux Apache Apache MySQL MySQL PHP PHP All Open Source and free packages. Can be installed and run on most.
Web Client/Server Communication A290/A590, Fall /09/2014.
Chapter 6: Hostile Code Guide to Computer Network Security.
Securing LAMP: Linux, Apache, MySQL and PHP Track 2 Workshop PacNOG 7 July 1, 2010 Pago Pago, American Samoa.
Introducing LAMP: Linux, Apache, MySQL and PHP Track 2 Workshop PacNOG 7 July 1, 2010 Pago Pago, American Samoa.
SYST Web Technologies SYST Web Technologies Installing a Web Server (XAMPP)
Linux Operations and Administration
TOPIC 1 – SERVER SIDE APPLICATIONS IFS 234 – SERVER SIDE APPLICATION DEVELOPMENT.
Website Development & Management Introduction & Overview CIT Fall Instructor: John Seydel, Ph.D.
Web Servers Web server software is a product that works with the operating system The server computer can run more than one software product such as .
INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Thursday, October 18, 2012 Session 7: PHP.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
1 Welcome to CSC 301 Web Programming Charles Frank.
PHP Open source language for server-side scripting Works well with many databases (e.g., MySQL) Files end in.php,.php3 or.phtml Runs on all major platforms.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Web Server Administration Chapter 6 Configuring a Web Server.
Web Server Apache PHP HTTP Request User types URL into browser Address resolved if nec. We use directly Most browsers request.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Sessions and cookies (part 2) MIS 3501, Fall 2015 Brad N Greenwood, PhD Department of MIS Fox School of Business Temple University 11/19/2015.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
XAMPP.
Aaron Corso COSC Spring What is LAMP?  A ‘solution stack’, or package of an OS and software consisting of:  Linux  Apache  MySQL  PHP.
Web Server Administration Chapter 6 Configuring a Web Server.
ITX2000 Remote hosts and web servers Prof. Xiaohong (Sharon) Gao Room: T125 Ext: Week 8 – Review Reference:
PHP stands for …….. “PHP Hypertext Pre-processor” and is a server-side scripting language like ASP. PHP scripts are executed on the server PHP supports.
Web Programming Building Dynamic Web Pages Adrian Shaw (ais) – 80% Jonathan Roscoe (jjr6) - 20%
Linux, Apache, MySQL, PHP/Python/PERL ● a.k.a. LAMP ● Standard set of tools for configuring a Linux-based web server with database & interfacing capabilities.
APACHE INSTALL AWS Linux (Amazon Web Services EC2)
Web Technology Seminar
2nd year Computer Science & Engineer
4.01 How Web Pages Work.
Class03 Introduction to Web Development (Hierarchy and the IDE)
WordPress Introduction
Introduction to Dynamic Web Programming
Apache web server Quick overview.
Introduction to Web Development (Part 2)
Chapter 5 Linux Services
Warm Handshake with Websites, Servers and Web Servers:
Unix System Administration
Sessions and cookies (part 2)
Lab 1 introduction, debrief
Module 3 Building a web app.
LAMP, WAMP and.. L. Grewe.
Computer Communication & Networks
PHP and Forms.
Intro to PHP.

Architecture of the web
4.01 How Web Pages Work.
Web Servers (IIS and Apache)
Q/ Compare between HTTP & HTTPS? HTTP HTTPS
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
Web Application Development Using PHP
Presentation transcript:

L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350

Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web solution on Linux servers. – Base to a web application background. ● Cloud Computing – Applications are moving to web; so are the files. – These servers may use LAMP, too. ● Personal Reasons – You should have a web site. – You may be interested in scripting languages and web applications.

LAMP ● LAMP = A bundle of Linux OS, Apache Web Server, MySQL database server and PHP programming language (or Python or Perl). ● Linux is a UNIX variant, we have been using Linux in our course every week. ● Most of the hosting companies in Turkey offer cheap services thanks to LAMP. ● Although they work in harmony, there a few things to know

How does web run? ● What happens when you type ● First, your operating system looks for the IP number of the address: the DNS server ● The web browser indicates it as “Resolving address” ● The DNS server is specified in the /etc/resolv.conf file. nameserver ● When the IP is resolved, the web browser makes an HTTP request to port 80 of the IP.

How does web run? (2) ● Let's assume there is an Apache server running on the server computer at cs.ieu.edu.tr. ● The Apache server may be configured to run many virtual hosts (same IP, different addresses). ● If so, it finds the directory on its file system that is the base for cs.ieu.edu.tr. ● Since you have not supplied a file name, but a directory, Apache sends an index file (index.html, index.php, etc) in that directory.

How does web run? (3) ● If the file requested is an HTML file (text/html) then Apache sends the file and the client's browser renders it. ● The file types are defined in Apache's configuration files (magic). ● If the file type is configured to be handled by an executable (like PHP) then Apache runs the script and sends the resulting page to the user. ● The type of the script should be text/html if it is to be rendered in a web browser.

How does web run? (4) ● The language can be PHP, Python, Perl and even C/C++!! ● You can use any programming library available to these languages; like database connections, XML parsers, string operations, etc. ● You can output text/html or any other type (like jpg images) you want.

Web Server How does web run? (5) Metin: <?php echo “hello world”; ?> PHP Metin: hello world

LAMP ● A typical Linux distribution has Apache, PHP and MySQL installed, or has them in its repositories. ● We'll take a look at each of their settings. ● Even with their default settings, you can run and develop web applications.

Apache ● Apache has its configuration files in /etc/apache2 or /etc/httpd directory (check your distribution documents) ● The main configuration file is apache2.conf: – General options like the number of connections the server will accept, log file format, etc. – Where other configuration files reside. ● Apache can have virtual hosts. ● Apache has modules, each of them have their own options and configuration files.

Virtual Host ● Name-based virtual host: hosting multiple domain names on a computer using a single IP address. ● cs.ieu.edu.tr → → ● Both have the same IP, same server, but served as different hosts. ● Site configuration files are in /etc/apache2/sites-available. ● The default file has port 80 (as usual) with the document root as /var/www

Apache Mods ● To enable mods, on Ubuntu, give the command as superuser: a2enmod module_name ● You can see the module names in /etc/apache2/mods- available ● The enabled mods have links in the mods-enabled folder. ● To run PHP, you should have mod_php installed and enabled.

mod_php ● mod_php configuration is on file php5.conf. ● If you check the file, it registers file ending in \.ph(p3?|tml)$ with mod_php. ● These files will first be run by PHP and then will be sent to the client.

PHP Settings ● The configuration file is /etc/php5/apache2/php.ini ● Most of the settings are typical preferences. ● During development: – error_reporting = E_ALL & E_STRICT ● When deployed – display_errors = Off ● Past time famous: – register_globals = Off

MySQL ● Popular SQL Server ● Configuration file is /etc/mysql/my.cnf ● Basic settings include port number, data and temp directory, buffer size, etc. ● You can connect and configure MySQL using the command line client (mysql) or other tools like phpMyAdmin or MySQLAdmin.

PHP <?php $degisken = 12; // variables have $ $degisken = “12”; // now a string! $metin = “i don't like mondays”; $liste = explode(“ “, $metin); // $liste is now an array $pcount = size($liste); for($i=0;$i<$pcount;$i++) echo $liste[$i]. “--” ; ?>

About PHP and MySQL ● PHP is very easy to learn if you know C/C++ ● Here is the sample code to connect to a database: mysql_connect(“localhost”, “uname”, “pwd”); mysql_select_db(“mydb”); mysql_query(“SELECT * FROM users”); ● Since it is very common and very easy, it is a common target. So security is important.

MySQL Injection ● A very common type of attack ● Suppose you enter koguz “; DELETE table users; – ● The value you typed to user name will be placed in a SQL query like this: “SELECT * FROM user WHERE uname=”$uname$”;

True Story