LING 408/508: Computational Techniques for Linguists

Slides:



Advertisements
Similar presentations
20-753: Fundamentals of Web Programming 1 Lecture 11: Web Server Case Study Fundamentals of Web Programming Lecture 11: Web Server Case Study.
Advertisements

Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing.
Initial web server configuration Dr Jim Briggs 1WUCM1.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
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.
LING 408/508: Programming for Linguists Lecture 16 October 16 th.
CGI programming Using Apache. Concepts Browser prepares parameter list List is attached to name of program to run on server "submit" button sends string.
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.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
APACHE SERVER By Innovationframes.com »
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
A crash course in njit’s Afs
Linux Operations and Administration
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Intro to PHP at Winthrop CSCI 297 Scripting Languages Day One.
Web Server Configuration Alokes Chattopadhyay Computer & Informatics Centre IIT Kharagpur.
The Linux Operating System Lecture 5: Apache Tonga Institute of Higher Education.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 10: Basic Apache Configuration and Management Chapter 26: Apache (httpd): Setting Up a Web.
LING 408/508: Programming for Linguists Lecture 17 October 21 st.
Web Servers Installation and Configuration May 24, 2001 CIS System Administration Problem Statement The class topic is setting up a Linux server to support.
An introduction to Apache. Different Types of Web Servers Apache is the default web server for may Unix servers. IIS is Microsoft’s default web server.
1 John Magee 9 November 2012 CS120 Lecture 17a: Publishing Web pages.
CGI programming Using Apache. Concepts Browser prepares parameter list List is attached to name of program to run on server "submit" button sends string.
CPSC 203 Introduction to Computers Lab 23 By Jie Gao.
HTML Hyper Text Markup Language A simple introduction.
1 Week 6 The lynx browser Apache Web Server John Wang With materials courtesy of Inge Mclaurin.
Web Access Chain of Events CPTE 212 John Beckett.
LinuxChix Apache. Serving Webpages The layer 7 protocol (HTTP) is what our browsers talk to get us the websites we can't seem to live without. HTTP is.
Multi-Domain Hosting Hosting multiple domains on one server using Apache John Beckett 1/16/2013.
LING 408/508: Programming for Linguists Lecture 17 October 28 th.
WAMP Windows Apache MySQL and PHP i.e. “WAMP”. Why WAMP? WampServer is a Windows web development environment. It allows you to create and test web pages.
LING 408/508: Programming for Linguists Lecture 18 November 2 nd.
LING 408/508: Programming for Linguists Lecture 16 October 26 th.
Planning, configuring, running and maintaining a web server -1.
LINUXCHIX WEBMAIL. Software run by an ISP or online service that provides access to send, receive, and review using only your Web browser. Users.
Multi-Domain Hosting CPTE 212 “Missing Slides” for 1/22/2015 John Beckett.
Building Your Own Website Using:. Install & configure LAMP. Download WordPress and run it as a local website on your Raspberry Pi. Configure WordPress.
9/21/04 James Gallagher Server Installation and Testing: Hands-on ● Install the CGI server with the HDF and FreeForm handlers ● Link data so the server.
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.
4.01 How Web Pages Work.
4.01 How Web Pages Work.
CGI programming Using Apache.
Introduction to Dynamic Web Programming
ITM352 PHP and Dynamic Web Pages: Server Side Processing 1.
COP 4343 Unix System Administration
CISC103 Web Development Basics: Web site:
Unix System Administration
Unix System Administration
Introduction to Programming the WWW I
Lab 1 introduction, debrief
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
CISC103 Web Development Basics: Web site:
Server Side Programming Overview And file system basics
Intro to PHP at Winthrop
Module 1 Introduction to PHP 11/30/2018 CS346 PHP.
CGI programming Using Apache.
Introduction to Django
Chengyu Sun California State University, Los Angeles
Configuration Of A Pull Network.
LING 408/508: Computational Techniques for Linguists
LING 408/508: Computational Techniques for Linguists
APACHE WEB SERVER.
Chengyu Sun California State University, Los Angeles
4.01 How Web Pages Work.
Client-Server Model: Requesting a Web Page
Web Application Development Using PHP
Presentation transcript:

LING 408/508: Computational Techniques for Linguists Lecture 19

Today's Topics This week's milestone: a webserver Quick Homework 7: set up your own webserver

The server side So far, all the web programming has been client-side only i.e. the Javascript code is running on the browser Let's build a webserver the client-side will send form information to the server-side to be processed

Building a Webserver We'll use cgi-bin and bash scripts initially … Apache2 is the most common webserver software unfortunately, configuration are similar but different on OSX and Ubuntu (we will cover both today)

Common Gateway Interface (CGI) client The glue between a webserver and programs that run on the computer (= server) hosting the webserver Normally, a webserver sends out static webpages in response to (URL) requests from a client (your web browser). Sometimes, we want the request to run a program (a script or binary) on the server that does some computation and generates some result to be displayed on the client (as a webpage). http://server/cgi-bin/program?parameter Today's class generated.html server: webserver

Apache Webserver on OSX Commands to be entered at a Terminal Apache version (OSX 10.13 High Sierra): ~$ httpd -v Server version: Apache/2.4.33 (Unix) Server built:   Apr  3 2018 17:54:07 ~$ which httpd /usr/sbin/httpd Apache webserver control: ~$ which apachectl /usr/sbin/apachectl sudo apachectl start sudo apachectl stop sudo apachectl –k restart (after configuration change) apachectl configtest (check configuration) Syntax OK ps -ax | grep httpd Apache 2.4

Apache Webserver on OSX sudo apachectl start On a browser, enter: http://localhost/ not running… running…

Apache Webserver on OSX Default static webpage storage location: http://localhost/ /Library/WebServer/Documents/index.html.en~orig Let's create index.html ourselves! sudo nano /Library/Webserver/Documents/index.html.en~orig nano is a simple text editor ^ means use the Control key save file as /Library/Webserver/Documents/index.html

Apache Webserver on Ubuntu sudo apt-get update

Apache Webserver on Ubuntu sudo apt install apache2 or sudo apt-get install apache2

Apache2 on Ubuntu Apache webserver: sudo apache2ctl start sudo apache2ctl stop sudo apache2ctl restart

Apache2 on Ubuntu http://localhost/ not running… Apache webserver: sudo systemctl start apache2 sudo systemctl stop apache2 sudo systemctl restart apache2 http://localhost/ not running…

Apache2 on Ubuntu Apache webserver: by default it should be running… sudo systemctl start apache2 by default it should be running… DocumentRoot /var/www/html /var/www/html/index.html

Apache2 on Ubuntu Master configuration file: /etc/apache2/httpd.conf

Apache2 on Ubuntu cd /etc/apache2/ grep –r DocumentRoot /etc/apache2/sites-enabled/000-default.conf

Apache2 on Ubuntu /etc/apache2/sites-enabled/000-default.conf

Apache2 on Ubuntu Logs are in directory: /var/log/apache2/ access.log error.log User web files in ~/public_html mkdir public_html nano public_html/index.html

Apache2 on Ubuntu To enable user web files in ~/public_html sudo a2enmod userdir sudo systemctl restart apache2 http://localhost/~sandiway/

Apache2 on Ubuntu To enable user web files in ~/public_html sudo a2enmod userdir (a2dismod) sudo systemctl restart apache2 http://localhost/~sandiway/

Apache Webserver on OSX Configuration file: /etc/apache2/httpd.conf

Apache Webserver on OSX Static webpages storage locations: http://localhost/~sandiway/ (no need to be superuser) mkdir ~sandiway/Sites (/Users/username/Sites) index.html sudo nano /etc/apache2/users/sandiway.conf create this file …

Apache Webserver on OSX Static webpages storage locations: http://localhost/~sandiway/ sudo nano /etc/apache2/httpd.conf uncomment mod_userdir.so line (remove the comment char #)

Apache Webserver on OSX Static webpages storage locations: http://localhost/~sandiway/ sudo nano /etc/apache2/httpd.conf uncomment httpd_userdir.conf line (remove the #)

Apache Webserver on OSX Static webpages storage locations: http://localhost/~sandiway/ sudo nano /etc/apache2/extra/httpd-userdir.conf uncomment this include (remove the #)

Apache Webserver on OSX Static webpages storage locations: http://localhost/~sandiway/ sudo apachectl –k restart create a file ~sandiway/Sites/index.html

Apache Webserver on OSX /var/log/apache2/access_log

Quick Homework 7 For Mac owners For Ubuntu owners In each case: set up Apache2 on your mac For Ubuntu owners set up Apache2 in VirtualBox In each case: http://localhost/ http://localhost/~yourusername/ Create two different index.html webpages at these locations, e.g. add your photo on your user homepage Show your system works! (snapshots) Submit one PDF file (by next Monday midnight)

Sample Site webpage JSON = Javascript Object Notation Normally, javascript is sandboxed for security. It has no access to your machine details, e.g. IP address or filesystem So how did we do this?

Sample Site webpage <html> <head> <style> span {font-family: menlo; font-size: 16} </style> </head> <body> <h1>It works!</h1> <script> var request = new XMLHttpRequest(); function displayJSON(e) { var o = JSON.parse(e.target.response); document.getElementById("output").innerHTML = o.city + ", " + o.region + " via " + o.org; } request.onload = displayJSON; request.open("get", "https://ipapi.co/json/", true); request.send(); </script> <p>This file is <span>/Library/Webserver/Documents/index.html </span></p> <p>You are in <span id="output"></span></p> </body> </html>