Web Servers can be hard to get your head around, but not if you have three heads. Being as most of us don’t have three heads maybe this tutorial may be of interest to you. Here we go back to, arguably, the simplest Web Server that you wouldn’t write yourself (or install yourself, despite the fact that you do install it (though daresay it would just work by plonking it … ah, the days of “plonking” (are gone))). It is called Cassini, though nowadays it is known as Cassini++ and the ++ is a red-rag-to-a-bull to say let’s look at more after we have that look at Cassini and look at some of the myriad of Web Server options to give a feel of what is out there, though will admit that the mobile app world has made this a much bigger “world” than this tutorial will present, so you should go off and do more research, if it interests you.
The hardest concept with Web Servers, and using Cassini illustrates this well is “What the heck is http://localhost/ ?” “And what is HTTP://127.0.0.1/ ?” Well, the answer is, they are the same, as you can see by comparing picture above with the last one of slideshow (of tutorial). So have a read here about localhost.
Another concept with Web Servers, and using Cassini illustrates this well is “What the heck is the :80 in http://localhost:80/ ?” “And what is the :80 in HTTP://127.0.0.1:80/ ?” Well, the answer is, the 80 means to use port 80. If there is no : in a public URL that you use it is probably using (default) port 80 for http usage.
Another hard concept with Web Servers, and using Cassini illustrates this well is “What the heck does http://localhost/ equate to as a place on the Web Server Host computer?” “And what does HTTP://127.0.0.1/ equate to as a place on the Web Server Host computer?” Well, the answer is, this is a configuration aspect of the Web Server you use. For instance MAMP uses /Applications/MAMP/htdocs/ as a default on a Mac laptop and EasyPHP (like WAMP) uses “c:\Program Files\EasyPHP-12.1\www\” (in the case for my Windows laptop) as a default on a Windows PC/laptop. So if you are forced to use a Web Server unfamiliar to you, and you get the chance to understand everything very quickly via the advice of an expert, ask them where the default Document Root directory is located for your particular Web Server. If you are not lucky enough to get this advice, for Apache PHP hosting there will be a file called httpd.conf which will contain a reference for its Document Root directory, which will answer this question for you … but where is httpd.conf ? Ask the chicken, because the egg gives you a dumb look. For instance, for Apache for Mac OSX of list below it is /private/etc/apache2/httpd.conf and it is information you often get in product READMEs.) The rest is made reasonably straightforward (except perhaps file and directory permissions and .htaccess and robot.txt, and with IIS things like image extension rules and permissions) once you have this basic information.
So let’s put together a list of (some of the) Web Server types that might be of interest below:
- Cassini on Windows http://localhost:80/ … tutorial
- Apache for MAMP Framework on Mac OSX http://localhost:8888/ … tutorial
- Apache for EasyPHP (WAMP) Framework on Windows http://localhost:80/ … tutorial
- Apache for CentOS on Linux http://localhost:80/ … tutorial
- Apache for Zend Framework on Linux http://localhost:80/ … example website using Zend hosting
- Apache for Delphi/Pascal http://localhost:80/ … tutorial
- Apache Tomcat for Eclipse/Java http://localhost:80/ … tutorial
- (Write your own) Go Web Server http://localhost:8080/ … tutorial
- Apache Tomcat web server for Liferay Java Web Portal Primer Tutorial http://localhost:8080/ … tutorial
- (Write your own) Python Web Server http://localhost:2112/ … tutorial
- NetBeans GlassFish Web Server http://localhost:8080/ or http://localhost:8383/ … tutorial or tutorial or (for Java EE RESTful Web Service) tutorial
- Jenkins Web Server http://localhost:9190/ (living with Glassfish web server on
http://localhost:8080/http://localhost:9190/) tutorial - Message Board Web Server http://localhost:9190/ (living with Glassfish web server on
http://localhost:8080/http://localhost:9190/) tutorial - Jenkins Deployed (via Ansible) Web Server http://localhost:9280 … tutorial
- NetBeans Apache Tomcat Web Server http://localhost:8080/ … tutorial
- NetBeans Backbone.js Web Server (via Google Chrome NetBeans Connector) http://localhost:8383/ … tutorial
- Visual Studio ASP.Net Wcf Web Service Website as you debug it on Windows http://localhost:1799/[Service.svc] … tutorial
- Visual Studio ASP.Net Website as you debug it on Windows http://localhost:[isAssignedAtTime]/ … tutorial
- IIS for ASP.Net as you deploy it on Windows http://localhost:80/
- Apache for Mac OSX http://localhost:80/ … tutorial
- Django Python http://localhost:8080/ … tutorial
- Ruby on Rails http://localhost:3000/ … tutorial
- Node.js and Node http://localhost:3000/ … tutorial
- Socket.IO and Node.js http://localhost:3000/ … tutorial
- React Javascript Library and Node http://localhost:5000/ … tutorial (and then onto “local network” sharing to HTTP://192.168.0.13:5000)
- Mojito via node.js http://localhost:8666/ … tutorial
- Ansible/Vagrant/VirtualBox http://localhost:8080/ … tutorial
- .NET Core and C# http://localhost:50000/ … tutorial
- Cocos2D Framework Cocos Creator IDE http://localhost:7456/ … tutorial
- MeteorJS Framework http://localhost:3000/ … tutorial
In conclusion you might say that, sure, we can remove the :80 as the default port but how come we are still left with http://localhost/ when we know the website is accessed via http://blah.com.zz/ (for example). The way localhost is replaced by blah.com.zz is what public web hosting is about and a study of the World Wide Web and would recommend you have a revisit of the links of Web Server Primer Tutorial, just as a starting point, regarding this.
Happy serving! |
Did you know?
The file naming for ASP.Net filenames has that little bit of lack of precision compared to lots of other web hosting because, going back to the original DOS days (Windows) filenames could be uppercase/lowercase and still refer to the same file. This is not the case with Unix or Linux (and so, also, Mac OSX).
If this was interesting you may be interested in this too.