InfoQuest Knowledgebase InfoQuest Knowledgebase

  • Home
  • Knowledgebase
    • Billing
    • Control Panel
    • Data Center
    • Databases
    • Domains
    • Email
    • FTP
    • Hosted Exchange
    • SSL Certificates
    • Virtual Private Servers
    • Webmail
    • Website Hosting
  • FAQ
  • Contact
  • Visit InfoQuest.com
Home / Virtual Private Servers / How To Install LAMP stack on a InfoQuest CentOS 6 VPS (POA)

How To Install LAMP stack on a InfoQuest CentOS 6 VPS (POA)

Introduction

After ordering Linux VPS Hosting the VPS will automatically start with the Apache web server installed and running.  While this is a great first step, most functional platforms also include MySQL and PHP.  This article provides the steps needed to install MySQL and PHP on your new VPS.

Step 1 – Update the VPS

First, lets take a moment to update the packages on the VPS.

1. Login to your VPS using an SSH client like terminal on a mac or putty on windows.

# ssh root@your_ip_address

Where your_ip_address is the IP address assigned to your VPS.  You will be prompted to supply your root password.  The root password can be found in the customer control panel at https://cp.infoquest.com, under information for the VPS subscription.

2. Issue the command for yum to to update your VPS packages

# yum update

You will be prompted to confirm the download and installation of the updates

YUM (Yellowdog Updater Modified) is an open source command-line as well as graphical based package management tool for RPM (RedHat Package Manager) based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems.

Step 2 – Install MySQL and Configure Security Settings

From your command line enter:

# yum install mysql-server

Confirm the download and installation at the prompt.

Once the installation completes start MySQL

# service mysqld start

Next, set a root password for MySQL and finish the automated setup.

# /usr/bin/mysql_secure_installation

The prompt will ask you for your current root password.

Since you just installed MySQL, you most likely won’t have one, so leave it blank by pressing enter.

Then the prompt will ask you if you want to set a root password. Go ahead and choose Y and follow the instructions.

CentOS automates the process of setting up MySQL, asking you a series of yes or no questions.

It’s easiest just to say Yes to all the options. At the end, MySQL will reload and implement the new changes.

Step 3 – Install PHP with MySQL Support

PHP is an open source web scripting language that is widely used to build dynamic webpages.

To install PHP on your virtual private server, open terminal and type in this command:

# yum install php php-mysql

Once you answer yes to the prompt PHP will be installed

PHP also has a variety of useful libraries and modules that you can add onto your server. You can see the libraries that are available by typing:

# yum search php-

A list of available libraries and modules will be displayed.  For more information on a specific module type:

# yum info name-of-module

To install a particular module:

# yum install name-of-module

Step 4 – Automatically Start Apache and MySQL

We should also set the processes to run automatically when the server boots (php will run automatically once Apache starts):

# chkconfig httpd on
# chkconfig mysqld on

Step 5 – Test Your PHP Installation

Although LAMP is installed on your virtual server, we can still take a look and see the components online by creating a quick php info page

To set this up, first create a new file:

In this article we use nano to create / edit a file. Nano is not installed by default on your VPS, but can easily be installed using the command

# yum install nano

Once nano is installed

# nano /var/www/html/info.php

Add the following lines:

<?php
phpinfo();
?>

Then Save and Exit.

Visit the page in a web browser to view PHP configuration information for your VPS

http://your_ip_address/info.php

Where your_ip_address is the IP address assigned to your VPS

Step 6 – Restart Apache

Restart Apache so that all of the changes take effect on your virtual server:

# service httpd restart

Summary

Congratulations you have successfully installed a LAMP stack (Linux, Apache, PHP, MySQL)

Virtual Private Servers

Related Articles

  • How do I find a file on a CentOS or Linux VPS (POA)
  • I can no longer RDP to my Windows VPS after making changes to the firewall (POA)
  • I can no longer access my CentOS VPS by SSH after making changes to the firewall (POA)
  • Resetting Plesk SQL Services on Windows VPS (POA)

Knowledgebase Categories

  • 7Billing
  • 50Control Panel
  • 4Data Center
  • 4Databases
  • 12Domains
  • 58Email
  • 4FTP
  • 38Hosted Exchange
  • 7SSL Certificates
  • 25Virtual Private Servers
  • 5Webmail
  • 47Website Hosting

Most Helpful Articles

  • How to change WordPress siteURL to IP address using phpmyadmin (POA)
  • Remove index.php from WordPress URL (POA)
  • How To Setup An Archive Folder in Outlook for MAC (POA)
  • How to Redirect a Registered Domain (POA)
  • Share Exchange Outlook calendar on iOS devices (POA)
  • Changing the WordPress URL Path to web root “/” or another path (POA)
  • Where do I go to leave positive feedback for support?
Copyright © 2020 - InfoQuest Technologies, Inc.