Among the several pre-made application images available for our Cloud VPS platform, the LAMP stack is one of the simplest but most powerful. If you want to set up a website without WordPress, Drupal, or a framework we don’t have an image for, the LAMP image will install:
- Latest version of CentOS 7 (7.6+)
- Latest version of Apache Web Server (2.4+)
- MariaDB 15.1 installed and configured (MySQL 5.5 equivalent)
- Latest version of PHP-FPM installed and configured (7.0)
Of note, part of the installation process for this image is a yum update and yum upgrade, so the installation will be “finished” but you may see this at the first login:
You can start importing files while waiting, but you should wait until everything’s installed before editing config files or importing databases.
The LAMP stack image, like many of our Linux options, comes with SSH installed and configured. With that is SFTP access to the filesystem. You can use a command line tools common on Linux distros and OSX, or graphical tools like FileZilla — just make sure you’re connecting on port 22 instead of 21.
To access your server through SFTP, you’ll use the server’s IP or hostname provided in your welcome email. Your username will be root and the password will be your server’s root password.
The document root directory for the web server is located in /var/www/html
Any content placed here will be publicly accessible on your website. If you’re familiar with cPanel’s setup, this is similar to the public_html directory.
To access MySQL on the server, you will want to login via the command line by typing mysql.
Your login details are saved in /root/.my.cnf
This gives you root privileged login to MySQL without specifying your username and root password.
The LAMP stack includes an install of the phpMyAdmin package, which you can acess at http://ip.address.of.vps/phpMyAdmin
Pointing Your Domain to Your LAMP Server
All you need to do to point your domain to your new server is update your domain’s A record to point to your server’s IP address. We have the following Knowledge Base Guide on this process for various domain registrars:
If you would like to, you can instead use our Cloud Control DNS Manager
Important Configuration Files and Directories in Your LAMP Server
Apache config: /etc/httpd/conf/httpd.conf
MySQL config: /etc/my.cnf
PHP config: /etc/php.ini
phpMyAdmin config: /etc/phpMyAdmin/config.inc.php
Apache DocumentRoot: /var/www/html/
Apache ServerRoot: /etc/httpd
Why Would I Want The LAMP Stack?
The LAMP Stack is a simple, yet popular setup that would allow development of a website. While this is not exactly recommended for newcomers, or those who are not too experienced with Linux, it is a simplistic setup for the functionality it provides. One reason you may want to use the LAMP Stack, over cPanel for example, could be that you are not looking to spend money on a cPanel license as you only need the base functionality of a PHP Web server. Along with being a quite popular environment for web servers, it has a great deal of documentation for each of the programs involved.