Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I keep hearing about the popular LAMP and WAMP configurations for the server side and also know that LAMP stands for Linux, Apache, MySQL, PHP/Python/Perl/Ruby etc..
But I don't know how all of these integrate with each other.
For instance If I have Xampp installed on my windows machine at home and it has an htdocs folder where I store my webpages...and when I query that page the browser shows it to me...
I need to know what:

  • Apache actually does is it just a hard drive for my web pages?
  • Where does PHP/Python/Perl/Ruby and MySQL fit in?
  • Like Xampp has htdocs on my pc is there a similar folder on the Apache Web server?

Its all confusing at the moment, can anyone explain?

share|improve this question

migrated from Sep 29 '09 at 18:39

This question came from our site for professional and enthusiast programmers.

closed as too broad by Grant, mdpc, MichelZ, Rex, Ward Apr 9 '14 at 22:26

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 11 down vote accepted

These are extremely general questions. You should probably do some reading on Wikipedia or other sites about databases, web frameworks, and web servers.

However, just to give you a quick rundown:

A web server is a program that serves data to people who access your machine over the World Wide Web. The two most popular web servers in the world are Apache and Microsoft Internet Information Services (IIS).

A database stores data, most commonly in a relational manner. You can use this data for web content, i.e. it can store blog posts, usernames and passwords, basically anything. The most common databases used for web development are SQL variations, most popularly MySQL and MS SQL Server.

PHP, Python, Ruby, and Perl are high level languages, what might once have been called scripting languages (but have become so much more). There are various technological and philosophical differences between them, but they are all used to the same ends. In web terms, these languages are used to program dynamic web content. Your web server runs the PHP/Ruby/Perl/Python code, and that code, in combination with data from a database and/or HTML pages, outputs the web content that is served by your web server software and ultimately seen by the user. All of these languages have various frameworks to make web development with them easier (i.e. Rails for Ruby).

XAMPP is just a prepackaged kit containing the apache web server, the mysql database software, and PHP and Perl installations.

A basic flow of the process of serving a page is as follows:

  1. A remote user requests
  2. Your Apache web server software receives that request and prepares to serve the appropriate information over the connection to that specific user
  3. Apache's integration with PHP starts the PHP interpreter on your server and executes the PHP code in index.php
  4. That PHP code may in turn contain requests to get and/or set data from your MySQL database to use in the web page or for user or session management.
  5. Your web server sends the remote user an HTML document that is put together through the above combination of PHP code, database information, and pre-written static HTML and CSS from your web site.

Also, to answer your question about whether Apache is just a "hard drive for your web site", that's not the case. Some things Apache does for you include managing many users connections to your site, executing the proper interpreters for dynamic web pages, controlling access to various pages, redirecting users to various content, and many more things. The web server software is the central point at which all sorts of languages, development frameworks, encryption systems, authentication and access controls, and other technologies intersect to create a fully functioning website.

share|improve this answer
Very informative answer!! – Kevin Boyd Sep 26 '09 at 5:16
+1 for tackling ambiguities and naivete. – whatnick Sep 26 '09 at 5:18
Thanks bdonlan for fixing my list:) – phoebus Sep 26 '09 at 5:50

Apache is a web server that opens a port on your computer to the connected network. This lets people in your network go to (your IP address). If you have your router configured correctly, then you can throw up a website of your own.

Out of the box, apache delivers HTML to the browser. If you view the source of this page, then you can see HTML.

PHP/Python/Ruby are languages that be used to interface with Apache to create HTML on the fly (dynamic behavior).

MySQL is persistance for your data. It stores your data in a way that PHP/Python/Ruby can easily transform and display.

Xampp uses Apache.

share|improve this answer

Apache the a web server which actually listens to your requests to localhost or then reply based on the request. Normally Apache listens to port 80, 8080 and so on

PHP, Python, Perl Ruby are server side includes (or scripts) which you as a programmer write in. When Apache receives a request, it will look up these files, and ask the respective parsers to parse and return the output.

E.g. you call http://localhost/test.php. Apache receives the call and looks up the file test.php in htdocs. Since it is a PHP file, Apache will call PHP to parse the file, then return the HTML or any output.

MySQL is the database to store your data. Think about all these StackOverflow posts, they are all stored in a Database.

htdocs is just a folder defined to be the root of the web server. You can re-configure and change it to some other folder.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.