Overview
LAMP stands for 'Linux', 'Apache', 'MySQL', and 'PHP'. All of these components together make up the LAMP 'web stack' which is one of the most popular solutions to host websites.
This article explains how to install the LAMP stack on your DreamCompute instance.
Due to the combined memory requirements of MySQL 8 and Ubuntu 20, DreamHost recommends that you do not install MySQL 8 on "semisonic" instances.
Setup methods
There are two ways to set up a LAMP stack on your DreamCompute instance:
- Automated
- Manually
If you just need to quickly configure LAMP to get something up and running, the automated solution should be fine.
However, if you're creating a long-term solution to host web content, you should install each component separately, as you'll have the most control over their installation.
Automated (Ubuntu only)
You can use 'tasksel' to simply tell Ubuntu to install the “task” named lamp-server. This is accomplished with apt-get and using a caret (^) at the end of the task's name.
[user@instance]$ sudo apt-get update [user@instance]$ sudo apt-get install lamp-server^
The second command is interactive, so you will be asked 'Do you want to continue?' in some places. Always type 'y' to continue.
You will also be asked to set a password for the root user of your MySQL installation. Create a secure password and save it, as you will need this later when you configure a database.
Manual installation
You can also install Apache, MySQL, and PHP individually. The benefit of doing it this way is that you'll have a better understanding of what you're installing and how to configure your environment to suit your needs. View the following articles for instructions on manually installing Apache, MySQL, and PHP.
Make sure to always run an update before installing new software:
[user@instance]$ sudo apt-get update