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

Thinking About Switching My ThinkPad to Linux—Need Some Advice!

Hey everyone! I have a ThinkPad E15 from 2020, and lately, it's been feeling really sluggish with frequent lag and unexpected shutdowns in Edge....

Are Childcare Centers Eligible for Education Rate M365 Licenses?

Hey everyone! I'm helping a client who runs a childcare service that mostly uses M365. When they set up their account, their IT provider...

Do I Need an SS Cable for My Gaming Setup?

Hey everyone! I just got my first gaming PC and I'm currently using an ASUS TUF VG27AQL3A monitor. I've connected a DisplayPort cable, but...

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

Online Hash Generator – String to Hash Converter

Need to quickly generate a hash from a string? Whether you're verifying file integrity, securing data, or just experimenting with cryptographic tools, this simple...

Convert CSV To HTML Table

Need to quickly turn CSV data into an HTML table? Whether you're copying data from Excel, Google Sheets, or another spreadsheet, this tool makes...

Student Group Randomizer

Creating fair and balanced groups in the classroom can be time-consuming — especially when you're trying to avoid repetition, manage different skill levels, or...

Random Group Generator

Need to split a list of people, items, or ideas into random groups? Our free Random Group Generator makes it quick and easy. Whether...

Flip Text Upside Down – Free Online Tool

Ever wanted to flip your text upside down just for fun or to grab someone’s attention in a creative way? This free online Upside...

Raffle Ticket Generator

If you're running a fundraiser, charity draw, or local event and need raffle tickets fast, this free online tool lets you generate and print...

Latest Posts

Latest Questions