How to Build a LAMP Server

Get the hardware requirements for your server., Get the necessary upload speed from your service provider., Install a version of Linux., Install Apache on the server., Verify that Apache is operating., Install PHP on the server., Make sure PHP is...

14 Steps 3 min read Advanced

Step-by-Step Guide

  1. Step 1: Get the hardware requirements for your server.

    More sophisticated sites need more power.
  2. Step 2: Get the necessary upload speed from your service provider.

    A default home internet upload speed is only around 1mb per minute.

    This may be too slow for graphics, videos, etc. , Before you can build a LAMP server, you must have the Linux operating system.

    Visit distrowatch.com and select one you like.

    They are mostly the same, but be sure to pick one with an interface (KDE, Cinnamon, etc.) pre-installed if you are not a usual terminal user.

    Further, if the Linux version does not include a Windows installer, you will need to create a Live CD or USB flash drive (instructions in other wiki how articles).

    The following instructions work with Ubuntu Linux. , Apache is a free and open-source web server that is well-known for running on Unix operating systems.

    There are two ways of installing Apache.

    You can use your console or a terminal window session.

    At the command prompt, type: sudo apt-get install apache2 In order to keep installing Apache, you will have to have your sudo password. , You’ll have to point your browser to the server’s IP address.

    This will let you know if Apache is running or not. , PHP is a scripting language that was originally used for creating dynamic web pages.

    However, developers use it to create individual graphical applications while network and system administrators use PHP for command line interface abilities.

    At the command prompt, type: sudo apt-get install php5 libapache2-mod-php5 , Restart Apache by typing at the command prompt:sudo /etc/init.d/apache2 restart , Use the Apache document root to create a test file.

    The root will be /var/www.

    Your test file name’s extension must end with a .php.

    For the content, type: < ?php phpinfo(); ?>

    Then point your browser to the following address: http://IP_ADDRESS/test.php Make sure you type your server’s IP address before /test.php. , The browser should display, “Test PHP Page” on the screen. , MySQL stands for “My Structured Query Language.” MySQL is a relational database program.

    This application operates as a server, in which multiple users can access many databases.

    There are many software applications that use MySQL, such as WordPress.

    Even Google and Facebook use MySQL.

    At the command prompt, type: sudo apt-get install mysql-server , In the command line, type: mysql
    -u root You should then see a command prompt that will look like mysql> At the command prompt, type:
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORD'); Enter your password where it shows YOURPASSWORD.

    This will be the one that you will use as a MySQL user. , Type the following command: /etc/init.d/mysql start ,
  3. Step 3: Install a version of Linux.

  4. Step 4: Install Apache on the server.

  5. Step 5: Verify that Apache is operating.

  6. Step 6: Install PHP on the server.

  7. Step 7: Make sure PHP is completely installed.

  8. Step 8: Confirm PHP is working correctly.

  9. Step 9: Save the test file.

  10. Step 10: Verify your test file.

  11. Step 11: Install MySQL on the server.

  12. Step 12: Create a password for MySQL.

  13. Step 13: Start your MySQL server.

  14. Step 14: Start working with your LAMP server.

Detailed Guide

More sophisticated sites need more power.

A default home internet upload speed is only around 1mb per minute.

This may be too slow for graphics, videos, etc. , Before you can build a LAMP server, you must have the Linux operating system.

Visit distrowatch.com and select one you like.

They are mostly the same, but be sure to pick one with an interface (KDE, Cinnamon, etc.) pre-installed if you are not a usual terminal user.

Further, if the Linux version does not include a Windows installer, you will need to create a Live CD or USB flash drive (instructions in other wiki how articles).

The following instructions work with Ubuntu Linux. , Apache is a free and open-source web server that is well-known for running on Unix operating systems.

There are two ways of installing Apache.

You can use your console or a terminal window session.

At the command prompt, type: sudo apt-get install apache2 In order to keep installing Apache, you will have to have your sudo password. , You’ll have to point your browser to the server’s IP address.

This will let you know if Apache is running or not. , PHP is a scripting language that was originally used for creating dynamic web pages.

However, developers use it to create individual graphical applications while network and system administrators use PHP for command line interface abilities.

At the command prompt, type: sudo apt-get install php5 libapache2-mod-php5 , Restart Apache by typing at the command prompt:sudo /etc/init.d/apache2 restart , Use the Apache document root to create a test file.

The root will be /var/www.

Your test file name’s extension must end with a .php.

For the content, type: < ?php phpinfo(); ?>

Then point your browser to the following address: http://IP_ADDRESS/test.php Make sure you type your server’s IP address before /test.php. , The browser should display, “Test PHP Page” on the screen. , MySQL stands for “My Structured Query Language.” MySQL is a relational database program.

This application operates as a server, in which multiple users can access many databases.

There are many software applications that use MySQL, such as WordPress.

Even Google and Facebook use MySQL.

At the command prompt, type: sudo apt-get install mysql-server , In the command line, type: mysql
-u root You should then see a command prompt that will look like mysql> At the command prompt, type:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORD'); Enter your password where it shows YOURPASSWORD.

This will be the one that you will use as a MySQL user. , Type the following command: /etc/init.d/mysql start ,

About the Author

A

Aaron Freeman

Creates helpful guides on hobbies to inspire and educate readers.

73 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: