1 / 23

Publishing Web Pages: How to Make Your HTML Pages Show Up on the Web

Learn how to publish your HTML pages on the web, transfer files to a web server, set permissions, and test the URL in your browser. Understand web servers, URLs, and file paths.

alehman
Download Presentation

Publishing Web Pages: How to Make Your HTML Pages Show Up on the Web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. John Magee9 November 2012 CS120 Lecture 17a: Publishing Web pages

  2. Overview/Questions • So I got some HTML pages and stuff. How do I make them show up on the web? • What are web servers, anyway? • How do we transfer files to a web server? • Who can see my pages? • URLs, absolute path, and relative path revisited.

  3. How to Publish a Web Page • Create HTML document, locate ancillary files (e.g images). • Transfer files to web server • Set permissions for read access • Test the URL in your browser

  4. Recall: Displaying a WWW Page

  5. What’s a Web Server? Is it hardware?  yes! Is it software?  yes! How is it both? What hardware is needed? What software is needed?

  6. What’s a Web Server? Web server: a software application which waits for /responds to HTTP requests. Tim Berners-Lee wrote 2 applications to make the web: • A web browser called WorldWideWeb • A server called HTTPd The first WWW Server at CERN.

  7. What’s a Web Server? Today’s web servers use high-performance hardware like this: (fast network and disk access) Pictured: IBM Blade Servers hosting files.myopera.com, photo from Wikipedia

  8. What’s a web server? The Apache HTTP Server is the most popular web server (since 1996). Roles: • Processing HyperText Transfer Protocol • Logging • Delivering static content from the file system • Running scripts to deliver dynamic content

  9. LAMP Model The most common structure for web applications uses this configuration: Linux operating system for a server Apache web server software MySQL database software PHP/Perl/Python scripting language to create dynamic HTML

  10. How a Web Server Works • Receives HTTP Request • Search for resource (file) on disk • Send HTTP Response (status code + data) • If not found: status 404 (NOT FOUND) • If not permitted: status 403 (FORBIDDEN) • … • Else: status 200 (OK) + send data

  11. cs-people.bu.edu Our WWW server is www.cs.clarku.edu. The web server has a file system which it searches for a URI (resource pathnames). • Subdirectories for individual users: • http://www.cs.clarku.edu/<username> • Example: • http://www.cs.clarku.edu/~jmagee

  12. Your UNIX Home Directory With the CS UNIX account, each user has a “home” directory: General form: /home/<username>/ Example: /home/jmagee/ This has a UNIX pseudonym of ~.

  13. Your WWW Directory The web server will map this URL: http://www.cs.clarku.edu/~<username>/ to your CS UNIX’s account’s ~/public_html/ directory

  14. Locate files in Finder/Windows Explorer Find your files on your local computer

  15. How to Transfer Files to csgateway.clarku.edu Use a file transfer client-program: • Fetch (Mac) http://fetchsoftworks.com/ (a free academic license is available) • WinSCP (Windows) http://winscp.net/eng/index.php (also free) - SSH Secure Shell (Windows)

  16. Connecting by WinSCP: • Hostname: csgateway.clarku.edu • Be sure to use the “SFTP” protocol

  17. WinSCP to csa2.bu.edu After you connect, transfer files by drag’n’drop. Then right-click to set permissions.

  18. File Permissions File Permissions Each file has its own set of permissions for: • Reading, writing or executing • Owner, group, or others • This leads to a 3x3 matrix of permissions:

  19. Setting Permissions by WinSCP • Right-click to open this dialog • Set the permissions to 644

  20. Transferring File by Fetch • Use drag’n’drop interface to transfer files… • Then use the Get Info button to set permissions.

  21. Setting Permissions by Fetch • Set permissions to 644

  22. Testing the Webpage: After uploading the files, test in your browser: There are two special filenames that the web server looks for automatically: • home.html • index.html

  23. Take-Away Points • Web server • UNIX home directory • File Transfer Protocol • UNIX File Permissions

More Related