3
readers helped!

This helped me

How to Build a LAMP Server

If you're looking for an inexpensive way to run a server, try building a LAMP stack by installing Linux, Apache, MySQL, and PHP. Installing all of these open-source softwares is easy, and we'll help you get it set up!

Steps

  1. More sophisticated sites need more power.
  2. A default home internet upload speed is only around 1mb per minute. This may be too slow for graphics, videos, etc.
  3. 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.
  4. 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.
  5. You’ll have to point your browser to the server’s IP address. This will let you know if Apache is running or not.
  6. 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.
  7. The browser should display, “Test PHP Page” on the screen.
  8. 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.
  9. Type the following command: /etc/init.d/mysql start
  10. with your LAMP server.
    Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit

Advertisement

You Might Also Like

Add a New Post in WordPressAdd a New Post in WordPress
Store and Read Documents on an iPhoneStore and Read Documents on an iPhone
Advertisement
Lock the Gallery on Samsung GalaxyLock the Gallery on Samsung Galaxy
Tell Who Has Viewed Your Instagram Story on AndroidTell Who Has Viewed Your Instagram Story on Android
Install Adobe Creative Suite 5Install Adobe Creative Suite 5
Bump a Post on FacebookBump a Post on Facebook
Download Images from Google on PC or MacDownload Images from Google on PC or Mac
Get More Effects on Tik Tok3 Ways to Get More Effects on TikTok
Use Samsung PayUse Samsung Pay
Use PayPal to Transfer MoneyUse PayPal to Transfer Money
Download a Torrent With AndroidDownload a Torrent With Android
Use Utorrent on an AndroidUse Utorrent on an Android
Turn Off Notifications on PC or MacTurn Off Notifications on PC or Mac
Use Facebook Messenger BotsUse Facebook Messenger Bots
Advertisement

About this article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 15 people, some anonymous, worked to edit and improve it over time. This article has been viewed 81,796 times.
How helpful is this?
Co-authors: 15
Updated: October 6, 2021
Views: 81,796
Thanks to all authors for creating a page that has been read 81,796 times.

Is this article up to date?

Advertisement