What is a LAMP stack?

The LAMP stack is the foundation for Linux hosted websites is the Linux, Apache, MySQL and PHP (LAMP) software stack.

The Four Layers of a LAMP Stack

Linux based web servers consist of four software components. These components, arranged in layers supporting one another, make up the software stack. Websites and Web Applications run on top of this underlying stack. The common software components that make up a traditional LAMP stack are:

  • Linux: The operating system (OS) makes up our first layer. Linux sets the foundation for the stack model. All other layers run on top of this layer.
  • Apache: The second layer consists of web server software, typically Apache Web Server. This layer resides on top of the Linux layer. Web servers are responsible for translating from web browsers to their correct website.
  • MySQL: Our third layer is where databases live. MySQL stores details that can be queried by scripting to construct a website. MySQL usually sits on top of the Linux layer alongside Apache/layer 2. In high end configurations, MySQL can be off loaded to a separate host server.
  • PHP: Sitting on top of them all is our fourth and final layer. The scripting layer consists of PHP and/or other similar web programming languages. Websites and Web Applications run within this layer.

We can visualize the LAMP stack like so:

Applying what you’ve learned

Understanding the four software layers of a LAMP stack aids the troubleshooting process. It allows us to see how each layer relies on one another. For instance; when a disk drive gets full, which is a Linux layer issue. This will also affect all other layers in the model. This is because those other layers rest on top of the affected layer. Likewise, when the MySQL database goes offline. We can expect to see PHP related problems due to their relationship. When we know which layer is exhibiting problems. We know which configuration files to examine for solutions.

Some Alternatives

The four traditional layers of a LAMP stack consist of free and open-source products. Linux, Apache, MySQL and PHP are the cornerstone of a free, non-proprietary LAMP stack. There are several variants of the four stack model as well. These variants use alternative software replacing one or more of the traditional components. Some examples of these alternatives are:

  • WAMP: Windows, Apache, MySQL & PHP
  • WISA: Windows, IIS, SQL & ASP.net
  • MAMP: MacOS, Apache, MySQL & PHP

You can explore these alternative software stacks in greater depth using online resource. The LAMP stack Wiki is a great place to start:

How can we help?

The LAMP stack is an industry standard and is included in all of our Core-Managed and Fully Managed Linux based servers. Our support teams work hand in hand with the LAMP stack on a daily basis. You can rest assured we are at your disposal should you have questions or concerns. To learn more you can browse our latest product offerings.

Logging into phpMyAdmin from Cloud Sites

When you create a website on Cloud Sites control panel using Linux technology, setting up a database for that site will use phpMyAdmin as the MariaDB database handler for your site. If you haven’t set up a database in Cloud Sites, see our article Creating a Database in Cloud Sites.

  1. After logging into the Cloud Sites control panel, navigate to the Databases section.
    cs-login-to-phpMyAdmin-pt1
  2. Continue reading “Logging into phpMyAdmin from Cloud Sites”

Enable Remote MySQL Connections in cPanel

Remote MySQL connections are disabled by default in cPanel servers because they are considered a potential security threat. Using the tools in the Web Host Manager (WHM) and the domain-level cPanel interface (usually http://domainname.com/cpanel) remote hosts can be added which the server allows to connect to the MySQL service.

Before using either of the following techniques, you will need to to open up port 3306 in your server’s firewall.

Enabling Remote MySQL in the WHM Interface

Log in to the server’s WHM interface and find the section in the left-side navigation bar labeled SQL Services. You can sort the list by typing ‘sql’ in the search box. Click on the link marked Additional MySQL Access Hosts:

WHM - Remote MySQL List

On the following page, enter one or more hosts or IP addresses in the text box (1) and click the Save button (2). If you wish to activate these settings on all user accounts see (3).

WHM - Remote MySQL page

Now that the remote connection has been activated in the WHM each domain account that wants to use the remote connection will need to activate it in their own cPanel interface.

Enabling Remote MySQL in the Domain cPanel Interface

Log in to the domain’s cPanel interface and find the section on the main page labeled Databases.

In the Databases section find the link/button labeled Remote MySQL and click on it.

cPanel - Remote MySQL list

The following page will appear in your browser. Add a hostname or IP address that you want to grant remote MySQL access to (1) and then click the Save button (2).

If a host or IP address needs to be removed from this list you can click the ‘Delete’ button next to the entry in the list.

cPanel-page-fxt

Once you have made your changes, additions, or removals to the list you can return the main page of the cPanel interface, or log out if you have no other tasks to take care of.

===

Liquid Web’s Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Toll Free 1.800.580.4985
International 517.322.0434
support@liquidweb.com
https://manage.liquidweb.com/

How to Disable MySQL Strict Mode

MySQL’s, and MariaDB’s, strict mode controls how invalid or missing values in data changing queries are handled; this includes INSERT, UPDATE, and CREATE TABLE statements. With MySQL strict mode enabled, which is the default state, invalid or missing data may cause warnings or errors when attempting to process the query.

When strict mode is disabled the same query would have its invalid, or missing, values adjusted and would produce a simple warning. This may seem like the preferred result, however with strict mode disabled certain actions may cause unexpected results; for instance, when the value being inserted exceeds the maximum character limit it will be truncated to fit the limit. Continue reading “How to Disable MySQL Strict Mode”

How To Manage a MySQL Database with phpMyAdmin in cPanel

  1. This tutorial assumes you’ve already logged in to cPanel, and are starting on the home screen.
  2. Now let’s learn how to manage a database with phpMyAdmin.
  3. Click the "phpMyAdmin" icon.

    cpanel-pl-mysql-11-phpmyadmin-02

  4. This is the phpMyAdmin main page. It is from here that you can manage all MySQL databases that exist in your hosting account.

    cpanel-pl-mysql-11-phpmyadmin-03

  5. In the top left corner, you’ll see an entry with your account user name. Click the "plus sign" to its left.

    cpanel-pl-mysql-11-phpmyadmin-04

  6. You’ll now see a list of databases in your account. Click the one you want to manage.

    cpanel-pl-mysql-11-phpmyadmin-05

  7. You can now start managing your database. You can manage tables, add or delete entries, and perform queries among other things.

    cpanel-pl-mysql-11-phpmyadmin-06

 

How To Delete a MySQL Database User in cPanel

  1. This tutorial assumes you’ve already logged in to cPanel, and are starting on the home screen.
  2. Now let’s learn how to delete a database user.
  3. Click the "MySQL Databases" icon.

    cpanel-pl-mysql-8-deleteuser-02

  4. Locate the "Current Users" section at the bottom of the page, and click the "Delete" icon next to the user you want to delete.

    cpanel-pl-mysql-8-deleteuser-03

  5. Then click "Delete User" to confirm.

    cpanel-pl-mysql-8-deleteuser-04

  6. That’s it! The database user has been deleted.

    cpanel-pl-mysql-8-deleteuser-05

 

How To Check a MySQL Database for Errors in cPanel

  1. This tutorial assumes you’ve already logged in to cPanel, and are starting on the home screen.
  2. Now let’s learn how to check a database for errors.
  3. Click the "MySQL Databases" icon.

    cpanel-pl-mysql-9-check-02

  4. Under "Modify Databases", and in the "Check Database" drop down box, select the database you want to check.

    cpanel-pl-mysql-9-check-03

  5. Then click "Check Database".

    cpanel-pl-mysql-9-check-04

  6. That’s it! The check has been completed, and no errors were found.

    cpanel-pl-mysql-9-check-05

 

How To Remove a User from a MySQL Database in cPanel

  1. This tutorial assumes you’ve already logged in to cPanel, and are starting on the home screen.
  2. Now let’s learn how to remove a user from a database.
  3. Click the "MySQL Databases" icon.

    cpanel-pl-mysql-7-removeuser-02

  4. In the table of databases, locate the database you wish to remove a user from, locate the specific user assigned to that database that you want to remove and click the delete icon.

    cpanel-pl-mysql-7-removeuser-04

  5. Click "Revoke User Privileges from Database" to confirm.

    cpanel-pl-mysql-7-removeuser-05

  6. That’s it! The user has been removed from the database.

    cpanel-pl-mysql-7-removeuser-06

  7. The user hasn’t been deleted … you can see it’s still listed in the list of current users. It has simply been removed from that database.

    cpanel-pl-mysql-7-removeuser-07