Linux - Apache - MySQL - PHP. The "LAMP" combination that serves many web sites - including ours - these days.
provides the underlying computer operating system on which the other elements are built
(that's the Apache http web server / httpd) provides the service which listens for requests to the computer for web pages (and associated requests) from user's browsers, and answers those requests with the appropriate data content.
provides databases on the server in which much of the content is typically stored these days
provides the programming layer which links the requests made to Apache httpd to the MySQL database and funnels the data from the database back to the user. Actually PHP does much, much more that this ...
Yesterday evening (and I do mean evening - a very keen group of delegates had me splitting sites between servers using mod_rewrite and mod_proxy), I completed a deploying LAMP training course
. A typical company web site will run on just one or two servers, but will have thousands of users - so it's natural for all the complexity to be at the server side, and the client to be thin. And PHP, MySQL, Apache httpd and Linux are all Open Source ... like most open source products highly configurable. Roll those two characteristics together and LAMP deployment training is really
worthwhile - it means that you know how to make the very best of your server, how it's set up, and where you can pull in extra options and configure it to do exactly what you want. It's not because Apache's free that it accounts for the majority of domains served on the internet - it's because it is good, flexible, secure, and resource light.
The diagram shown on the right here (click on it for a larger copy in a new window) shows the layout of the file system of a typical Linux box, with the various elements - Apache, MySQL and PHP shown, on the Linux tree - and with the parts of the Linux tree that you'll want to tailor when you set up accounts and do various other configuration jobs. The diagram was built up during the course - I've copied it here for the delegates who attended (and for anyone else who might find it useful), but this is one of those diagrams that can't but help be more useful if you see it being drawn rather than just looking at the final product.
Even on a diagram such as this, you see the scope for flexibility - there are a number of purple asterisks (*
) which show various options we discussed for placing the web content - each a good choice in certain circumstanced. And there are a number of log
locations noted which could be the best place for server logs.
One of the things that you'll want to be aware of if you're responsible for a LAMP server are where the main configuration files for each of the elements is located, and that's something we had on the board as well. Again - click on the image to see it much larger!
With many (most?) of the elements here, you'll find this is a simplified view - for within one configuration file you're able to refer on to another, or configuration files are nested. The nsswitch.conf
file tells the Linux operating system's programs where to look for its tables of hosts, users, etc ... and it may refer onwards to the network information service (NIS) and the Domain Name Service (DNS). The httpd.conf
file for the Apache httpd web server may include calls to subsiduary files for setting up features like virtual hosting, and access to the http server manual; there may also be a whole tree of files called .htaccess within the web site(s) being hosted. The php.ini
file for PHP may be overridden by settings within the httpd.conf file and its tree, and in individual pieces of code. And /etc/my.cnf
for MySQL will point to most of the setup data stored in tables within the engine itself.
It isn't always L-A-M-P either. It could be U-A-O-P, where U is Unix
is Oracle, for example. And sometimes the P may change from PHP to Perl or Python. Yet most of the deployment issues remain the same.
For users of Java based web applications written to the JSP or Servlet standard, and extra server (Apache Tomcat) may be included in the deployment configuration, and there may be an extra language to install in the shape of Java too. That's covered on our deploying Apache httpd and Tomcat course
- next scheduled at the end of next week.
I've added pictures of the delegates on this course to the blog - with their permission, of course. I'm always tired after a deployment course (for various reasons they require a more intensive presentation than a programming course) but I'm also exhilarated - and especially so with this bunch. The extra questions ... the addition of more content on mod_rewrite and on mod_proxy and the balancer, a deeper practical than usual on virtual hosting all made the four days that much more rewarding for me, and (I'm certain) the course much more relevant for them. I'm delighted that I'll be welcoming one back on a PHP course in the near future, and who knows I might end up learning how to write iPhone and iPad apps with another one over some quiet weekend in the autumn. (written 2010-07-30, updated 2010-07-31)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articlesA100 - Web Application Deployment - The Components of a Web-Based Solution 
The components of an Apache httpd / Tomcat / MySQL stack and what each does - (2012-10-13) 
Should I maintain the programming code on my own website? - (2009-03-23) 
PHP / Web 2 logging - (2008-01-06) 
Apache, Tomcat, Jakarta, httpd, web server - what are they? - (2007-07-13) 
From Web to Web 2 - (2007-05-21) 
A pu that got me into trouble - (2007-05-04) 
The LAMP Cookbook - Linux, Apache, MySQL, PHP / Perl - (2006-11-13) 
Helicopter views and tartans - (2006-04-06) 
Dynamic Web presence - next generation web site - (2005-11-29) 
How far away is that server? - (2005-09-10) 
FTP - how to make the right transfers - (2005-09-01) 
Ajax - (2005-07-03) 
Acronyms - (2005-01-02) 
Business is the predominant user of Tomcat, Perl and Tcl - (2004-09-15) 
Linux / LAMP course - (2004-08-31)
Some other Articles
Redirecting a page - silent, temporary or permanent?Groupsave tickets - 3 or 4 train tickets for the price of 2Programming Standards from the start!The Land of the Black LabradorLAMP - Linux, Apache, MySQL, PHP - install, configure, administerGlobal Computer Maintenance DepartmentSorting people by their namesExclamation marks and question marks on ruby method namesAlternative loops and conditionals in Ruby and PerlWiltshire Council ask how they can help businesses