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

How Can I Successfully Scrape Amazon Reviews Without Getting Blocked?

Hey folks! I'm having some serious trouble scraping reviews from Amazon using ScraperAPI, but it keeps getting blocked. Does anyone have suggestions on how...

Any insights on working as an SDE at AWS with a clearance?

Hey everyone! I recently accepted an offer to join AWS as a Software Development Engineer for a cleared program. I have the option to...

Can You Change a Windows Account Password Using Just the Hash?

I've been trying to find a way to change a Windows account password directly using the password hash, but I haven't had much luck...

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

Scavenger Hunt Team Randomizer

Planning a scavenger hunt and need to split participants into random teams? Whether you're organizing a school activity, a corporate team-building event, or a...

File Hash Generator Online – Get Instant MD5 and SHA-256 Hashes

Whether you are validating downloads, checking for corruption, or comparing files for duplicates, having a fast and secure way to generate file hashes is...

Visual CSS Editor for Modern Glass UI Effects

Modern UI design is all about clean, layered aesthetics, and few styles deliver this better than glassmorphism. If you're designing sleek user interfaces and...

Fast and Accurate Tap BPM Counter – Free Web Tool

Whether you're producing music, DJing live, or just figuring out the tempo of a song, knowing the BPM (beats per minute) can be critical....

Glassmorphism CSS Generator with Live Preview

Glassmorphism is one of the most visually striking design trends in modern UI. Its soft, frosted-glass effect adds depth and elegance to web interfaces,...

Add Custom Speech and Caption Boxes to Any Image Online

Creating comic-style images used to require complex design tools or specialist software. Whether you're making memes, teaching graphics, social media posts or lighthearted content,...

Latest Posts

Latest Questions