Using LAMP to Build a Dynamic Web Application
Wanted: Dynamic Web Content
The Internet is a dynamic form of giving information to its audience. That is the reason why people stick their noses on the monitor more often than watching a show on a boob-tube. The secrets behind those cool and great web pages are four components that help keep this content up and running.These are the operating system GNU Linux or Linux, Apache Web Server, MySQL Database Management Server and the PHP Hypertext Preprocessor Interpreter, or LAMP for short.
Web developers can follow the simple steps that are presented here in this article. Do not worry about hosting the server software, for it can be hosted on a system with a single CPU with a minimum specification of a Pentium 4 1 Ghz clockspeed and a gigabyte of memory. And, 100 gigabytes of hard disk space will be enough for installing Linux and the rest of the application servers mentioned above.
Installing the Components
Logically, the first component to install would be the platform on which the application servers will operate with their respective functions. The Linux operating system is the perfect platform for developing and delivering these dynamic web pages that are now being considered as a window for limitless information. People that are familiar with Linux can follow the on-screen instructions for installation. During the course of the installation, select the packages that are needed for Apache web server. Also include the package for installing the MySQL server programs, and last but not the least is the most important component for web applications, the PHP interpreter. For the ease of this procedure, I would like to recommend installing the Fedora Core Linux variant. The GUI (graphical user interface) shows the user seamless and easy to follow instructions. It should take between 5 and 30 minutes for the entire installation time. After the installation process has been completed , you may restart the computer for the initialization of both the operating system and the different applications involved.
Running and Coding
After the first boot when installation has just finished. Linux will properly initialize all the necessary components to their rightful places for proper operations. The first testing is to run the Apache web server by issuing the command service apache start at the command prompt with a root or a superuser privileges. Then, open a browser and type the address as localhost . When the screen displays a web page that says It works and a bunch of information about Apache, the web server is up and running.
That is two components that are already working. To make the MySQL Database Server work, just issue the command service mysqld start. To be able to check whether the database service is working, there are two ways to do it. First, at the command prompt enter the following command with its corresponding parameters: mysql -h localhost -u root -p , press enter when prompted for a password. If the prompt changes to a MySQL prompt, then the database server works. Another method that can be uses to check if MySQL is running will be issuing a telnet command like this: telnet localhost 3306. If it is connected to the MySQL port (3306), then the database server is running. At this point, please be sure that Apache has loaded the PHP module for the web server to use PHP coding for generating a dynamic webpage. To do it, simply write the PHP code as follows:
Save it as index.php from a text editor, and then place the sample php file in the document directory of the web site, which in our case can be found at /var/www/html. Once the file has been placed to that directory, open a browser and enter the address https://localhost/index.php. The result should be the same as in screen shot below. At this point, the PHP module has now been loaded as part of Apache web server. After that, a developer can start coding in PHP to create dynamic and attractive web pages. And all it takes is the following acronym to remember: LAMP.