Tuesday, May 7, 2013

Lighting the LAMP

I use linux, specifically Archlinux, and I'm faily confident that most of my friends and family know this. That being said, outside of academia, I have found very few others using the OS on their primary desktop. Objectively speaking, Windows beats the snot out of linux there. Sure, linux has supercomputers, but supercomputers don't often browse netflix, something I would love to do--if only it were on my OS. That being said, when it comes to servers, linux stands a fighting chance, and many argue that linux clearly outperforms Windows in this case. That being said, let's get down to the basics. What is a server?

A server is a system that responds to requests across a computer network, which is a simple enough definition for our purposes. Game servers, display servers, and web servers are some examples, all of which essentially do the same thing: process data in and out of a central bin, usually referred to as "the server." If you ever wish to work with a website, it is good practice to work with your server yourself, to provide the most efficient and effective environment for your clients.

As you might imagine, a server must be composed of a few, distinct, parts:
-An Operating System,
-A Web Server
-A Database
-A method of Communication between the Server and Database.
Simple enough, right? Now, these four parts can be mixed and matched in any way you like, but one of the most common server set-ups is the LAMP server, which stands for LinuxApache, MySQL, and PHP. Throughout the upcoming week, I will be analyzing the "AMP" part of the phrase bit by bit. For today, I will briefly describe each part.


Linux

I know, I know. I've said it before and will probably say it again: I use Archlinux. At the same time, I concede that Arch is not for everyone. In fact, when it comes to servers, Arch might be the very worst choice possible. Why? Because Arch is a rolling-release, bleeding-edge distribution, meaning my system might not work after an update. This is not a big deal for single users, but it could cause server maintainence take twice as long--which is never a good thing. That being said, it is not impossible to make an Arch server, you just have to be very careful about it. Generally speaking, users prefer to use tried and true distributions like Debian or Red Hat, both of which are fantastic server distributions. If you wish to make a LAMP server, I would suggest learning a bit about your distribution and searching for individuals using your distribution and already running servers.


Apache

Apache is a wonderful open-source web server that allows clients to access your website and interact with it. For those who may not know what a web server does, look up (or down) to your current URL. Chances are that there is an "http://" before the site title, this is a function calling the web server to display the contents of the site. For example: http://www.google.com, asks the web server to call the contents of www.google.com. Though Apache is not the only available web server, the others are lack-luster in comparison. My suggestion is to use Apache first, and if you don't like it, look for other options.


MySQL

Alright, this one is a little odd. As far as free, open-source database managers are concerned, MySQL used to take the cake as the fastest and most widely used. That being said, it's competition Postgresql was always nipping at its heels. When comparing the two, Postgres was always considered the slower, more full-featured option (hence why it's mascot is an elephant). Nowadays, that's not necessarily true. Both options are fast and dependable. Unfortunately, If you use Postgres instead of MySQL, your LAMP setup will instead be a LAPP setup, which is not quite a real word. You could try mixing the letters around to make PALP, but its just not the same. 

Recently, Oracle somehow got ahold of MySQL and changed it from open-source to closed source, much like they did with Open Office a while back. In typical linux fashion, the original designers of the program created another project, in this case MariaDB. Aside from the fact that MariaDB uses a seal instead of a dolphin as a macot, the only difference between the two is that one is open-source and the other isn't. In the upcoming week, I will cover both Postgresql and MariaDB as database managers, explaining how they work and what you can do with them.


PHP

The "P" In the LAMP set-up most commonly referrs to PHP, which used to be the best option, but nowadays, the letter can also stand for Python or Perl. These languages essentially allow cross-talk between the server and the database manager, so that the web server (and ultimately the clients) can read from and write to the database. In most cases, these languages also determine what the clients visually see when viewing the site. That being said, HTML is more often used for that purpose and should not be confused with any of the above options, as HTML cannot write to the database. I will be covering Python again within the upcoming week and then describe how to use the web.py framework.

As always, thanks for reading,
-Leios

No comments:

Post a Comment