310 likes | 746 Views
The Brown Web Environment. FTP, OS, PHP, IP, CHMOD What does it all mean?. Topics. Hardware, OS, Server – what’s the difference? File Structure Accounts Files and permissions URLs and IPs Getting files there and back Special Stuff. What is this?. What is this? Hardware Server OS
E N D
The Brown Web Environment FTP, OS, PHP, IP, CHMOD What does it all mean?
Topics • Hardware, OS, Server – what’s the difference? • File Structure • Accounts • Files and permissions • URLs and IPs • Getting files there and back • Special Stuff
What is this? • What is this? • Hardware • Server • OS • All of the above?
What’s an OS? • What is an OS? • Operating system • Turns hardware into a computer. • Basic set of instructions on how to run software
What’s a Server? • So what is a server then? • A server is actually software • Hardware can contain lots of servers • Examples: Apache, MySQL, print, Novell
About Webpub • Which OS and Server does webpub use? • OS: Red Hat Linux and Solaris (more later) • Server: Apache
Brown’s Web Environment • Actually 3 servers • webpub • charlie • delta
Webpub • Where our accounts are • The only server we have access to • OS is Solaris
Charlie/Delta • The actual web servers • They are connected to webpub via a “mount” • “Load Balanced” • Request comes in, they find the files • OS is Red Hat Linux • Only system admins have direct access
Directory Structure • Charlie/Delta • Hundreds of different directories on the server • “Root Level” – top of the chain, a.k.a. “slash” or / • “Web Root Level” - /www/data/httpd/htdocs
Directory Structure • Webpub • /home/<username>/www • The www is really a link to your site space • Web servers can’t find /home/username
Accounts • Requested at webpublishing.brown.edu • What gets created: • Username (same as your Brown username) • Password (not the same) • Home directory • Link to your web space in your home directory • Server group (if needed) • Web space/URL (if needed)
Connecting • How to connect: • SFTP • ie. Dreamweaver, Contribute, MacSFTP, WinSFTP • SSH – ‘secure shell’ • ie. Winssh, BbEdit, Terminal • SCP – ‘secure copy’ • ie. WinSCP, Terminal • Enter server, username, password – starts in your home directory
On the Server • Dreamweaver and Contribute are “drag and drop” • Other clients can show a terminal or command-line view • Not graphical, all text • Not a browser
The index file • The “default” page in a site: index.html • If no page is indicated, you get index.html • ie. http://www.brown.edu, www.brown.edu/Facilities/CIS • Error 403 – Forbidden • Index listing is turned off
File Permissions • Every file/directory has 9 permissions (3x3) • Owner, group, world – read, write, execute • Owner: the creator of the file • Group: at least one user who has access to the web space • World: anyone with an account on server
File Permissions • Owner, group, world has 3 permissions each: read, write, execute • Read: Able to open the file or download it • Write: Able to change and save the file • Execute: Able to open a directory or run a file if it is a script
File Permissions • Every file has the 9 permissions: • Examples: rwxrwxr-x, rwxr----- • Directories begin permissions with a d, files with a hyphen • Examples: drwxrwxr-w, -rwxr-----
File Permissions • How to check: • Terminal or command line type: ls –la • The ls is list, -la is all information for all files • Look in a different directory: • Use the cd command, ie. cd images • Which directory am I in? • pwd: shows the full path
File Permissions • How to change – your account needs edit permission • chmod • u, g, o, a • chmod ug+rw index.html (adds read/write to owner and group) • chmod o-w index.html (removes write to world) • -R: recursive • chmod –R ug+rw directory
File Permissions - Binary • chmod 775 index.html • Each of the three numbers are binary for rwx
Other funny characters • Dot, slash, dot dot, and star • . – refers to the directory you’re in, usually coupled with slash • / - the separator between directories and file names • .. – refers to the directory before the current directory • * - refers to all files in that directory
Other funny characters • Examples: • chmod 775 ./* • cd .. • chmod 775 images/* • ls *.jpg
Groups • Every URL has at least one group • Groups need to have at least one user • Users can be added/removed from groups • ls –la to see group name: • Permissions, owner, group, file name • ie. rwxrwxr-x plaverty cis index.html
Groups • Currently, each user may only be in max 16 groups • The web server itself is a user • Over 1,000 groups on server • How does the web server read files?
Editing on the Server • Open Terminal or command line • Use nano, pico or vi • nano index.html • Simply save the file. No upload needed. • Be careful of overwrites
FTP vs. SFTP • Webpub does not accept FTP connections • SFTP is required • S = Secure • Passwords are encrypted • Bad guys “sniff” the network for passwords
cname vs. Short URL • cis.brown.edu • Requires extra work (virtual host) • brown.edu/cis • Requires much less extra work (1 line) • cnames are for absorbed servers
Password Protection • We use .htaccess and WebAuth • Only restrict as little as possible • Use .htaccess file generation tool • Copy results to a file and name it .htaccess (no .txt or .html extension)
Getting Your Own Domain • Find and purchase domain name • Decide on hosting • Point the DNS • Upload an index.html file
Questions? What’d I forget to cover?