Apache is by far the most popular web server out there. Its market share is more than the combined market shares of all competing web servers. It would not be long fetched to say that Apache web server 'drives' the Internet. The best part about Apache and its web dominance is that it is licensed as an Open source software under Apache Software License by Apache software Foundation. The current version of Apache is 2.0.
Here is a brief summary of how Apache (or more broadly an http web server) works:
-http working:
. web client requests web server's tcp port 80 for connection.
. web server allows web client to connect.
. web client issues http cmds on web server.
-the default http web server port is 80.
-to run multiple web servers on the same node, each web server needs its own distinct port.
-apache http web server starts as root to complete initial network config ie binding to port 80 for 'listening'.
-once initial network work is done, apache 'gives up' the root permissions and becomes a non privileged user--eg www, nobody, apache, daemon etc..
-the idea is that by limiting the permissions security is increased. many security problems are ascribed to poorly written cgi (perl?) scripts.
-a lot of the flexibility & power of apache comes from the numerous modules it has eg mod_perl, mod_cgi, mod_ssl etc.
-by default the apache config file, httpd.conf expects the web server to run as the user daemon.
-to install apache on Red Hat Linux :
# yum -y install httpd
-useful apache cmds:
# service httpd start | stop | restart | status
. http://localhost or http://[::1]/ - to verify apache working ok
. /etc/httpd - server root dir
. /var/www/html - doc root, /usr/local/httpd/htdocs if apache installed from src rpm.
. /etc/httpd/conf/httpd.conf - apache config file
-virtual host
. a single box hosts multiple web servers listening at different ports.
. represented by <virtualhost> </virtualhost> tags.
. inside the above tags, the servername option denotes the virtual web server name (& it should be valid and resolvable by /etc/hosts or dns).
-apache log dir
. /var/log/httpd dir
. inside this the two files to look for are access_log and error_log
No comments:
Post a Comment