Ch 22: Web Hosting  and Internet Servers LaShall Bates
Web Hosting <ul><li>Providing </li></ul><ul><ul><li>Raw web pages (HTML) </li></ul></ul><ul><ul><li>FTP </li></ul></ul><ul...
Linux vs. Windows hosting??? <ul><li>Linux provides </li></ul><ul><ul><li>Maintainability and performance </li></ul></ul><...
The Basics <ul><li>A  web server  is a system configured to answer HTTP requests. Browsers contact these remote web server...
URL <ul><li>U niform  R esource  L ocator,  the global address of docs and other resources on the WWW.  </li></ul><ul><li>...
URL ex. <ul><li>An executable file that should be fetched using the FTP protocol </li></ul><ul><ul><li>ftp://uark.edu/stuf...
URL Protocols <ul><li>http - hypertext transfer protocol (WWW)  </li></ul><ul><li>https - secure http (use HTTP/SSL </li><...
How HTTP works <ul><li>H yper T ext  T ransfer  P rotocol , the underlying protocol used by the WWW.  </li></ul><ul><li>HT...
HTTP: Stateless Protocol <ul><li>HTTP is called a stateless protocol because each command is executed independently, witho...
CGI <ul><li>The shortcoming of HTTP is being addressed in a number of technologies, including CGI, ActiveX, Java, JS and c...
CGI: generating on the fly <ul><li>CGI scripts can be C(++), Perl, Python or any other program that can perform real-time ...
CGI: security <ul><li>CGI poses a security problem for Admins.  It can potentially allow anyone to run a program on your s...
Load balancing <ul><li>Hits/page views a server can handle.  </li></ul><ul><li>Dependent on  </li></ul><ul><ul><li>Operati...
Choosing a Server <ul><li>Robustness </li></ul><ul><li>Performance </li></ul><ul><li>Timeliness of updates and bug fixes <...
Apache <ul><li>The August 2002  Netcraft Web Server Survey  found that 63% of the web sites on the Internet are using Apac...
Apache <ul><li>The name 'Apache' was chosen from respect for the Native American Indian tribe of Apache,  well-known for t...
Installing Apache <ul><li>If you want to compile source code yourself </li></ul><ul><ul><li>./configure –prefix=/etc/httpd...
Configuring Apache <ul><li>After installation, configure setup </li></ul><ul><ul><li>conf directory (/etc/httpd/conf) </li...
Apache Conf files: httpd <ul><li>httpd.conf </li></ul><ul><ul><li>How Apache daemon interacts with system. </li></ul></ul>...
Apache Conf files: srm <ul><li>srm.conf </li></ul><ul><ul><li>Controls resources server needs </li></ul></ul><ul><ul><li>D...
Apache Conf files: access <ul><li>access.conf </li></ul><ul><ul><li>Security concerns </li></ul></ul><ul><ul><li>Directive...
Running Apache <ul><li>Start by hand </li></ul><ul><ul><li>/usr/sbin/httpd –f /etc/httpd/conf/httpd.conf </li></ul></ul><u...
High performance Hosting <ul><li>TUX is an architecture for kernel-accelerated network services. </li></ul><ul><li>Runs in...
Virtual Interfaces <ul><li>Allowing the hosting of more than one web site by associating more than one IP address with a s...
Needs of Virtual Interfaces <ul><li>Create the virtual interface at TCP/IP level </li></ul><ul><ul><li>ifconfig eth0:0 128...
Caching and Proxy Servers <ul><li>Squid Internet Object Cache </li></ul><ul><ul><li>Caching and proxy server that runs und...
Anonymous FTP server <ul><li>Lets users have accounts to download files you have made available. </li></ul><ul><li>Create ...
Anonymous FTP: create user dir <ul><li>Home directory: </li></ul><ul><ul><li>Owned by root, same group as ftp, so Group pe...
Anonymous FTP: Use <ul><li>Put files you want to make available in ~ftp/pub </li></ul>
Questions References: http://Apache.org http://webopedia.com http://squid.nlanr.net/
Upcoming SlideShare
Loading in …5
×

Ch 22: Web Hosting and Internet Servers

575 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
575
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ch 22: Web Hosting and Internet Servers

  1. 1. Ch 22: Web Hosting and Internet Servers LaShall Bates
  2. 2. Web Hosting <ul><li>Providing </li></ul><ul><ul><li>Raw web pages (HTML) </li></ul></ul><ul><ul><li>FTP </li></ul></ul><ul><ul><li>SSL </li></ul></ul><ul><ul><li>Streaming audio or video </li></ul></ul>
  3. 3. Linux vs. Windows hosting??? <ul><li>Linux provides </li></ul><ul><ul><li>Maintainability and performance </li></ul></ul><ul><ul><li>Multi user, interactive OS </li></ul></ul><ul><ul><li>Multi task Administration </li></ul></ul><ul><ul><li>Can be tuned to be faster </li></ul></ul>
  4. 4. The Basics <ul><li>A web server is a system configured to answer HTTP requests. Browsers contact these remote web servers and make requests on behalf of users. </li></ul><ul><li>To convert a generic Linux system, install a daemon that listens for connections on TCP port 80, accepts requests for docs and transmits them to the requesting user. </li></ul>
  5. 5. URL <ul><li>U niform R esource L ocator, the global address of docs and other resources on the WWW. </li></ul><ul><li>5 parts of the address </li></ul><ul><ul><li>1. What protocol to use </li></ul></ul><ul><ul><li>2. IP address or the domain name where the resource is located. </li></ul></ul><ul><ul><li>3. TCP/IP port (opt) </li></ul></ul><ul><ul><li>4. Directory (opt) </li></ul></ul><ul><ul><li>5. Filename (case sensitive) </li></ul></ul>
  6. 6. URL ex. <ul><li>An executable file that should be fetched using the FTP protocol </li></ul><ul><ul><li>ftp://uark.edu/stuff.exe </li></ul></ul><ul><li>A Web page that should be fetched using the HTTP protocol </li></ul><ul><ul><li>http://uark.edu/classes/index.html </li></ul></ul>
  7. 7. URL Protocols <ul><li>http - hypertext transfer protocol (WWW) </li></ul><ul><li>https - secure http (use HTTP/SSL </li></ul><ul><li>ftp - file transfer protocol (FTP) </li></ul><ul><li>news - Usenet news protocol </li></ul><ul><li>javascript - local javascript execution </li></ul><ul><li>file - local files on local computer </li></ul><ul><li>mailto - sends mail to specified e-mail address </li></ul><ul><li>telnet - used to open telnet sessions </li></ul><ul><li>ldap – access LDAP directory services </li></ul>
  8. 8. How HTTP works <ul><li>H yper T ext T ransfer P rotocol , the underlying protocol used by the WWW. </li></ul><ul><li>HTTP defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands. </li></ul><ul><li>For example, when you enter a URL in your browser, this actually sends an HTTP command to the Web server directing it to fetch and transmit the requested Web page. </li></ul>
  9. 9. HTTP: Stateless Protocol <ul><li>HTTP is called a stateless protocol because each command is executed independently, without any knowledge of the commands that came before it. This is the main reason that it is difficult to implement Web sites that react intelligently to user input. </li></ul>
  10. 10. CGI <ul><li>The shortcoming of HTTP is being addressed in a number of technologies, including CGI, ActiveX, Java, JS and cookies. </li></ul><ul><li>CGI is a specification that allows the designer to provide active changing web content. It allows the HTTP server to exchange info with other programs. </li></ul>
  11. 11. CGI: generating on the fly <ul><li>CGI scripts can be C(++), Perl, Python or any other program that can perform real-time I/O </li></ul>
  12. 12. CGI: security <ul><li>CGI poses a security problem for Admins. It can potentially allow anyone to run a program on your server and/or gain access to files. </li></ul>
  13. 13. Load balancing <ul><li>Hits/page views a server can handle. </li></ul><ul><li>Dependent on </li></ul><ul><ul><li>Operating system </li></ul></ul><ul><ul><li>System tuning </li></ul></ul><ul><ul><li>Hardware architecture </li></ul></ul><ul><ul><li>Construction of site </li></ul></ul><ul><li>More important: Scalability </li></ul><ul><ul><li>Products spread the work specified by a variety of admin-config params such as individual server response time and availability </li></ul></ul>
  14. 14. Choosing a Server <ul><li>Robustness </li></ul><ul><li>Performance </li></ul><ul><li>Timeliness of updates and bug fixes </li></ul><ul><li>Availability of source code </li></ul><ul><li>Cost </li></ul><ul><li>Access control and security </li></ul><ul><li>Ability to act as a proxy </li></ul><ul><li>Ability to handle encryption </li></ul>
  15. 15. Apache <ul><li>The August 2002 Netcraft Web Server Survey found that 63% of the web sites on the Internet are using Apache, thus making it more widely used than all other web servers combined. </li></ul>
  16. 16. Apache <ul><li>The name 'Apache' was chosen from respect for the Native American Indian tribe of Apache, well-known for their superior skills in warfare strategy and their inexhaustible endurance . </li></ul><ul><li>Secondarily, and more popularly (though incorrectly) accepted, it's a considered cute name which stuck. Apache is &quot; A PA t CH y server&quot;. It was based on some existing code and a series of &quot;patch files&quot;. </li></ul>
  17. 17. Installing Apache <ul><li>If you want to compile source code yourself </li></ul><ul><ul><li>./configure –prefix=/etc/httpd/ </li></ul></ul><ul><li>Include or remove features </li></ul><ul><ul><li>enable-module=, disable-module= </li></ul></ul><ul><ul><ul><li>For a complete list of modules http://httpd.apache.org/docs/mod/ </li></ul></ul></ul><ul><li>Run make , then make install to compile and install appropriate files </li></ul>
  18. 18. Configuring Apache <ul><li>After installation, configure setup </li></ul><ul><ul><li>conf directory (/etc/httpd/conf) </li></ul></ul><ul><li>3 files to configure </li></ul><ul><ul><li>httpd.conf </li></ul></ul><ul><ul><li>srm.conf </li></ul></ul><ul><ul><li>access.conf </li></ul></ul>
  19. 19. Apache Conf files: httpd <ul><li>httpd.conf </li></ul><ul><ul><li>How Apache daemon interacts with system. </li></ul></ul><ul><ul><ul><li>Set TCP port </li></ul></ul></ul><ul><ul><ul><li>location of log files </li></ul></ul></ul><ul><ul><ul><li>various network and performance params </li></ul></ul></ul><ul><ul><ul><li>Configure virtual connections </li></ul></ul></ul>
  20. 20. Apache Conf files: srm <ul><li>srm.conf </li></ul><ul><ul><li>Controls resources server needs </li></ul></ul><ul><ul><li>DocumentRoot def: defines root of directory tree in which servable docs are located. </li></ul></ul><ul><ul><li>Also handling of “special” URLs (ex. http://comp.uark.edu/~crane) </li></ul></ul>
  21. 21. Apache Conf files: access <ul><li>access.conf </li></ul><ul><ul><li>Security concerns </li></ul></ul><ul><ul><li>Directives that control access on a per-file pr per-dir basis, prevents access to sensitive files vs. httpd </li></ul></ul><ul><ul><li>Use option ExecCGI in srm.conf to enable CGI restrictions </li></ul></ul><ul><ul><ul><li>Allows two access controls one for entire doc dir and one for cgi-bin. </li></ul></ul></ul>
  22. 22. Running Apache <ul><li>Start by hand </li></ul><ul><ul><li>/usr/sbin/httpd –f /etc/httpd/conf/httpd.conf </li></ul></ul><ul><li>or from rc scripts </li></ul><ul><ul><li>Run at boot time make link in rc directory that points to /etc/init.d/httpd file </li></ul></ul><ul><ul><li>Start late in booting sequence after daemons that manage functions such as routing and time synchronization have started </li></ul></ul>
  23. 23. High performance Hosting <ul><li>TUX is an architecture for kernel-accelerated network services. </li></ul><ul><li>Runs in conjunction with Apache </li></ul><ul><li>Serves up static pages without leaving kernel space. Minimizes context switches with a zero-copy architecture. </li></ul><ul><ul><li>Not recommended for beginners </li></ul></ul>
  24. 24. Virtual Interfaces <ul><li>Allowing the hosting of more than one web site by associating more than one IP address with a system. </li></ul><ul><li>Allows daemon to identify request’s destination IP address. </li></ul><ul><li>Single Linux machine responds on the network to more IP addresses than it has physical network interfaces. Each of the result “virtual” network interfaces can be associated with a corresponding domain name that users on the Internet might want to connect to. </li></ul>
  25. 25. Needs of Virtual Interfaces <ul><li>Create the virtual interface at TCP/IP level </li></ul><ul><ul><li>ifconfig eth0:0 128.138.243.150 netmask 255.255.255.255.192 up </li></ul></ul><ul><ul><li>To make permanent modify startup </li></ul></ul><ul><li>Tell Apache server about virtual interfaces created. </li></ul><ul><ul><li>Add VirtualHost clause to httpd.conf file </li></ul></ul><ul><ul><li>One for each virtual interface </li></ul></ul>
  26. 26. Caching and Proxy Servers <ul><li>Squid Internet Object Cache </li></ul><ul><ul><li>Caching and proxy server that runs under Linux and supports several protocols </li></ul></ul><ul><li>How it works </li></ul><ul><ul><li>Client browser contacts squid to request object </li></ul></ul><ul><ul><li>Squid makes request on client’s behalf (or finds cached copy) and returns result to client </li></ul></ul><ul><ul><li>Proxy servers can enhance security or filter content </li></ul></ul>
  27. 27. Anonymous FTP server <ul><li>Lets users have accounts to download files you have made available. </li></ul><ul><li>Create user-------------------------------- </li></ul><ul><li>Create the user ftp in /etc/passwd . </li></ul><ul><ul><li>Misc group, let ~ftp be root you wish anon. users to see. </li></ul></ul><ul><ul><li>Use invalid psw and use shell for better security </li></ul></ul>ftp:*:400:400:Anonymous FTP:/home/ftp:/bin/true
  28. 28. Anonymous FTP: create user dir <ul><li>Home directory: </li></ul><ul><ul><li>Owned by root, same group as ftp, so Group permissions will be for anonymous users </li></ul></ul><ul><ul><li>Set the permissions for ~ftp to 555 (read, nowrite, execute). </li></ul></ul><ul><ul><li>Create subdirs: bin, etc, lib, and pub </li></ul></ul><ul><ul><li>Copy ls program to ~ftp/bin and its shared libraries to ~ftp/lib </li></ul></ul><ul><ul><li>Copy /etc/passwd and group files to ~ftp/etc </li></ul></ul><ul><ul><ul><li>Should only contain users root, daemon, and ftp </li></ul></ul></ul><ul><ul><ul><li>Replace psw with *’s </li></ul></ul></ul>
  29. 29. Anonymous FTP: Use <ul><li>Put files you want to make available in ~ftp/pub </li></ul>
  30. 30. Questions References: http://Apache.org http://webopedia.com http://squid.nlanr.net/

×