Web Servers
A web server is a computer that has software designed to read HTTP requests and send HTTP responses. The term web server can actually be used to refer to both the server software, Such as Apache Server, as well as the computer that the software is run on. Web Servers are connected to the internet continuously and are where web page files are stored and delivered to user clients that request the page.
When a client software, such as a web browser, tries to access a web page, the domain names registered name servers will direct the request to the IP address that is associated with that domain. When the server at that IP address receives the request, it will check for the existence of the requested file/resource and send the appropriate response back to the requesting client.
If the server is unable to locate the requested resource, or if an error occurs, it will send the appropriate http error response, such as a "404 - File Not Found" error. This response will inform the user that there was an error and of what type the error was.
If there is no problem locating the requested resource, the server will check that the resource is publicly viewable and read and send the resources contents in an http response back to the user client. Http responses are usually comprised of html that will be translated and displayed by the users browser. Http responses can also be in the form of a raw file for download, images or other types of media.
There are different types of operating systems(OS) that can found on a web server. The most common setup for web servers is to use a linux based OS. Linux, which is an open source OS has many variations, such as CentOS, FreeBSD and Fedora Core. Since Linux is an open source OS, servers that use it are normally less expensive than servers that have Microsoft Windows Server installed on them.
Servers have the ability to transmit "static" and "dynamic" content. Static content is content such as html files that are saved to the hard drive, read and transmitted just as they are. Dynamic content is content that relies on scripting languages, such as PHP, to generate the data. With dynamic content, the server will read the file, and any code within the file will be processed by the server before its transmitted as a response. This way information can be loaded from databases or based on other factors, such as user sessions, that will make the responded data unique to either that user or the instance involved.
Web servers are set up to look for specific files by default. The server configuration file will dictate the default file to be distributed if none is specifically requested. For example, when you visit a domain such as www.example.com, you haven't requested any specific file. The server configuration is normally configured to look for and respond with the index file, index.html by default. So when you visit "www.example.com" it is the same as requesting "www.example.com/index.html".
Setting up a web server is a complicated affair for someone with little experience. Their are web hosting companies that already have these servers set up and will "lease" you space on their servers hard drives to store your web files. There are a few options on how to go about this depending on your needs; Shared hosting, Virtual Dedicated Servers and Dedicated servers are all possible web hosting options.