Linux Apache MySql PHP – LAMP Install Guide

Installing LAMP is very simple. If you are using putty to SSH into a server or VPS you can copy and paste the commands then right click in putty and the command will be put into terminal. The following code was used to install LAMP on CentOS but the commands should be the same for most Linux servers by simply replacing yum with.

Install Apache

In terminal type the following to install Apache.

yum install httpd

You will be asked to confirm the install, so enter y to confirm it. Once it’s finished installing you will need to start the server so enter the following to start up apache

service httpd start

Now check to see if apache has started up. Type in the ip or address of the vps and it should display a message. (Either “It WORKS” or some apache branded page.)

Install MYSQL

Same process as before. Install the service and confirm anything it asks.

yum install mysql-server service mysqld start

next you will need to set a root password for the SQL server. You will be asked 4 questions about removing default users, remote access etc. I suggst you answer y to all of them.

/usr/bin/mysql_secure_installation

Install PHP

The final step is to install php. Enter the following command in the terminal to install php.

yum install php php-mysql

Once installed you can check to see if it has installed correctly.

nano /var/www/html/test.php

Add the following lines of code into this file.

<?php
     phpinfo();
?>

Once you have the file saved restart apache so it can pick up everything you have just installed.

service httpd restart

Now open your browser and type in the IP / domain of your server and then the name of the file. eg. “123.123.123.123/test.php”.

Related Articles

Related Questions

Looking to Build My First Gaming PC – Suggestions Needed!

I've been a console gamer all my life, but a friend recently convinced me to switch to PC gaming. The problem is, I have...

Best PSU Recommendations for R7600X with 7800XT or 7600XT

My friend and I are debating over PC builds using PC Part Picker, and both our setups require about 374 watts. We're a bit...

What’s Up with HPE’s Sales Tactics and Server Options?

I'm currently getting server quotes from HPE through our hardware vendor, and I'm finding it more frustrating than ever. In the past, we could...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Tools

OpenAI Token Calculator

This tool is a simple OpenAI token calculator, web-based utility designed to help you quickly estimate the number of tokens in your text when...

List Sorting Tool

Welcome to our innovative list ordering and management tool. This next-level platform enables you to sort a list of items in ascending or descending...

Sudoku Solver

Welcome to our free online Sudoku solving tool, an interactive platform for puzzle enthusiasts seeking a break from a Sudoku conundrum. This advanced platform...

Apply Image Filters To Image

Digital imagery in the modern world is all about reinforcing emotions and stories behind each photo we take. To amplify this storytelling, we are...

Add Watermark To Image

As the world is increasingly consumed by digital media, protecting your original images is paramount. We are thrilled to introduce you to our innovative...

CSV To Xml Converter

Welcome to our CSV to XML converter tool, a convenient and user-friendly solution for all your data conversion needs. This versatile tool on our...

Latest Posts

Latest Questions