ITE 453 midterm
Syntax to search for string value "test" in the text file file.txt
$ grep test file.txt
Advantages of .htaaccess file
- .htaccess allows you to make changes on a per-directory basis when the user doesn't have the means to modify main Apache config files - .htaccess is placed in a certain directory and directives apply to that directory and all its subdirectories
Four legal context for Apache directives
- Server config files (ex- apache2.conf) - virtual host <VirtualHost> - Directory <Directory> - .htaccess
what is returned in HTTP processes?
- server response status line - headers - blank line (to separate headers and entity body) - entity body (data)
disadvantages of .htaccess file
- using .htaccess slows down your server - failure to control .htaccess may lead to security or other Apache misconfiguration
HTTP request PDU components
-client request line (request method, URI, HTTP version) -header fields -blank line -entity body
HTTP response PDU components
-server response status line (protocol version, status code, reason phrase) -header fields -blank line - entity body
What are the three methods HTTP/2 includes to decrease latency
1) Data compression of HTTP headers (to reduce data transferred) 2) Server Push (server sends the client more data for queries then requested to allow for the client to render a webpage without asking) 3) Pipelining of requests (multiple HTTP requests are sent over TCP connection w/o waiting for response
What are the four primary web server functions and one optional function
1) accept and intercept http requests from clients 2) retrieve content from disk- provide access control and security 3) run local CGI and Server Side programs 4) transmit reply to client via http response opt) perform other functions like logging transactions
What are the six advantages of Apache
1) it is free 2) open source and highly configurable 3) runs on multiple platforms (linux, unix, windows) 4) very scalable (runs both very large and very small sites) 5) fast response to HTTP queries 6) not bloated (only install features you need)
HTTP 1.0 vs 1.1
1.0- established separate TCP connections for each item 1.1- established persistent TCP connections meaning multiple documents can be transmitted over one connection. provides support for multiple virtual hosts on one server.
___ level response codes represent client errors
400
401 response code
401 Unauthorized, information is restricted, retry with proper authentication so client displays login box
rwx privledges
4= read, 2= write, 1= execute
apt-get install
APT-GET: install a package from the apt repository on your Linux system
400 Error
Bad Request, means server doesn't understand request
POST:
Client sends data, usually in HTML form, to accompany the HTTP request to server in Entity body. Used for requesting action. The data is not visible in the URL and it cannot be bookmarked or clicked back.
How HTTP/2 differs from 1.1
HTTP/2 changes how data is framed and transported between client and server, it allows the server to "push" content
.htaccess
a configuration file used by the Apache web server to apply directory-level configuration settings to a specific directory and its contents
directory index
a server-generated list displaying contents of a directory
Web server daemon
a system running in the background on the server such as print, email, webserver, FTP
System Process
any program that is executing on the system
What are MIME types
application, audio, image, message, multipart, text, and video
double reverse DNS lookup
caused when a website must convert a domain name to an IP address
htpasswd
command-line utility that is used to manage user authentication files for Apache web servers
Apache directives
configuration settings that control the behavior of the Apache web server
Discretionary access
depends on information supplied by an accessor (ex- username/password). uses a combination of authentication and authorization
site access control
determines which resources of a website need to be restricted, determine who can access (users and groups), and apply mandatory or discretionary access
ifconfig
displays network configuration data for your system
command to find contents of the apache2.pid file
grep "string to search" /var/run/apache2/apache2.pid
HTTP/1.1 HOST: header
identifies the virtual host name
What are the consequences of improper placement of a directive
improper placement of a directive in a non-supported context can cause Apache not to start in server config/virtual host/directory contexts
Mandatory access
limiting access based on an IP address or domain of the HTTP- request sender. users have to prove a need for information before gaining access.
AllowOverride
primary directive involved in controlling the use of the .htaccess file
What are the parts of the server response status line?
protocol version, status code, reason phrase
Request methods
request methods determine what to do with request types: GET, POST, (< main ones), HEAD, PUT, DELETE, TRACE, OPTIONS, CONNECT
Active site
sites with unique, distinct content on their front page
command for enabling site "test.com"
sudo a2ensite test.com.conf
command to change permissions on file or directory
sudo chmod ### file.txt
Document Hierarchy
the structure of how the various objects on a web document are organized and accessed
sudo init0 or sudo shutdown now -P
use to safely shutdown your system to run level 0 and then power it off
alias
used to allow web server to access documents in directories outside document hierarchy
Netmask
used to determine which part of an IP address is the netid and which is the hostid
ugo
user, group, others
Ports 0-1023
well-known ports because they have been assigned to specific services, cannot set anything on these ports unless you are root administrator user
apache2.pid
where Apache stores parent PID information of the master apache process
ps ax
Linux command that will list all currently running processes.
GET:
Retrieves information from the server and entity body is empty. This is the standard method for all server requests. The data is appended in the URL and the page can be bookmarked and clicked back.
HEAD:
Same as GET except there is only a header included. Good for verifying a particular HTTP response.
crontab
Schedule a command to run at a later time
What are the goals of HTTP/2?
The goals of HTTP/2 are to: - decrease latency and allow for faster load times on webpages - be highly compatible with HTTP1.1 - allow clients/servers to use HTTP1.1, HTTP2, or potentially other non-HTTP protocols