Virtual hosting
The same machine corresponds the multiple domain names. This allows to host several websites in 1 host,
- name vhost : the machine has only one address, the site to server is selected based on the domain name on the url
- You cannot access the site by IP unless you specify the target domain on http headers.
example
curl -H 'Host:vhost_coucou'
http://123.132.123.123/` - If machine serves different subdomains (ex: kong.com and diddy.com) it cannot serve https since it needs to present the right certificate on the SSL handshake, before any data is transfered to the server.
- This can be overcome with SNI, but it makes sensorship possible by leaking the domain name to listeners.
- You cannot access the site by IP unless you specify the target domain on http headers.
- ip vhost : the machine has at least 1 IP address per domain name, the site is selected based on the IP header only
Web Server components
- Reverse proxy - opposite to a proxy client which performs requests on behalf of clients in the same network a reverse proxy answers to queries on behalf of the server, load balances …
- WSGI - web service gateway interface : python standard to connect a HTTP server to an app server, mod_wgsi is an apache module that implements it
- FastCGI - in CGI (common gateway interface) each HTTP request will trigger the creation of a new system process to execute the scripts creating the response. In fast CGI a daemon will answer to the HTTP server to avoid process overhead => starting concept for an application server
- Nginx - widely used Http server that can also be configured as a reverse proxy for static content, SSL Offloader (wikipedia) …