Install a Lamp Stack on a VPS
Lamp is an acronym that stands for Linux (L), Apache (a), MySQL (M), and PHP (P). A lamp stack contributes to many different web applications, providing the basic foundations required for proper hosting. The build Lamp stack supports established applications like WordPress, Drupal and more.
To use a lamp stack, all that is needed is the base Linux package. You can install a lamp stack on the VPS after you have logged in as root via SSH.
Preparation of the lamp stack
Before starting the additional installation, you must ensure that your operating system is up to date by running the following command:
yum update
Install Apache
Step 1: Install Apache as the web server. Enter "Y" for YES when prompted.
yum install httpd
Step 2: Enable Apache.
systemctl enable httpd
Step 3: Set Apache to start booting.
systemctl start httpd
Step 4: Check the status of Apache (httpd).
systemctl status httpd
Step 5 – Once Apache is installed and verified, make sure it is working properly by navigating to your server IP in the URL. You should now see an HTTP Server Test page.
yum -y install @mysql
systemctl enable --now mysqld
systemctl start mysqld
systemctl status mysqld
mysql_secure_installation
- Do you want to continue with the password provided?
- Delete anonymous users?
- Disallow root login remotely?
- Check out the test database and access it?
- Reload privilege tables now?
mysql -u root -p
CREATE DATABASE lamp_db;CREATE USER lampuser@localhost IDENTIFIED BY 'password';GRANT ALL PRIVILEGES ON * . * TO 'lampuser'@'localhost';FLUSH PRIVILEGES;
yum install php
yum install php-pear php-mysqlnd php-curl php-mbstring php-gd php-xml php-pear php-fpm php-pdo php-opcache php-json php-zip php-cli
systemctl enable php-fpm
systemctl start php-fpm
systemctl status httpd
systemctl status mysqld
systemctl status php-fpm
Step 4: Now you're done! Your lamp's battery has been installed and is ready to be used for any of your future housing needs.
Post a Comment