{"id":38398,"date":"2024-11-13T12:26:31","date_gmt":"2024-11-13T12:26:31","guid":{"rendered":"https:\/\/accuweb.cloud\/blog\/?p=38398"},"modified":"2026-01-22T06:29:56","modified_gmt":"2026-01-22T06:29:56","slug":"learn-how-to-install-lamp-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/","title":{"rendered":"Learn how to install LAMP on Ubuntu 22.04"},"content":{"rendered":"<h1 class=\"ac-h1\">Learn how to install LAMP on Ubuntu 22.04<\/h1>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-42059 size-large\" title=\"Learn how to install LAMP on Ubuntu 22.04\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04-1024x576.png\" alt=\"Learn how to install LAMP on Ubuntu 22.04\" width=\"640\" height=\"360\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04-1024x576.png 1024w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04-300x169.png 300w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04-768x432.png 768w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png 1280w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<div class=\"tips_box-cloud gradient-cloud\">\n<h3 class=\"cb-h3\">TL;DR<\/h3>\n<ul class=\"cb-ul\">\n<li><strong>LAMP<\/strong> stands for <strong>Linux, Apache, MySQL\/MariaDB, and PHP<\/strong>, a common web server environment for hosting dynamic sites and apps.<\/li>\n<li>On <strong>Ubuntu 22.04<\/strong>, install <strong>Apache<\/strong> with <strong>sudo apt update &amp;&amp; sudo apt install apache2<\/strong> to serve web pages.<\/li>\n<li>Install <strong>MySQL or MariaDB<\/strong> (<strong>sudo apt install mysql-server<\/strong> or <strong>mariadb-server<\/strong>) for database support and run the secure setup.<\/li>\n<li>Add <strong>PHP<\/strong> using <strong>sudo apt install php libapache2-mod-php php-mysql<\/strong> so scripts are processed by the server.<\/li>\n<li>Restart services (e.g., <strong>sudo systemctl restart apache2<\/strong>) to apply changes and verify setup with test PHP files.<\/li>\n<li>Secure your LAMP stack by configuring <strong>firewalls (UFW)<\/strong>, strong database credentials, and PHP security settings.<\/li>\n<\/ul>\n<\/div>\n<p>The <b>LAMP stack<\/b> &#8211; short for <b>Linux, Apache, MariaDB, and PHP<\/b> &#8211; is one of the most popular open-source web hosting environments. On <b>Ubuntu 22.04<\/b>, it provides a reliable foundation for running everything from personal blogs to enterprise web applications. In this stack:<\/p>\n<ul class=\"ac-ul\">\n<li><b>Linux (Ubuntu 22.04)<\/b> serves as the operating system,<\/li>\n<li><b>Apache<\/b> handles web server functionality,<\/li>\n<li><b>MariaDB<\/b> (a MySQL-compatible database) manages data, and<\/li>\n<li><b>PHP<\/b> processes dynamic content.<\/li>\n<\/ul>\n<p>Together, these components power <b>millions of websites worldwide<\/b>. In this guide, you\u2019ll learn <b>step-by-step how to install LAMP on Ubuntu 22.04<\/b> in under 15 minutes, with clear commands and explanations designed for beginners and system administrators alike.<\/p>\n<h2 id=\"Prerequisites\" class=\"ac-h2\">Prerequisites<\/h2>\n<p>Before you begin:<\/p>\n<ol class=\"ac-ol\">\n<li>Create an Ubuntu 22.04 server on <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/\" target=\"_blank\" rel=\"noopener\">AccuWeb.Cloud<\/a>.<\/li>\n<li>You must log in to your server with the root user through SSH.<\/li>\n<li>Add a new A record for your domain that points to your server\u2019s IP address.<\/li>\n<li>Add the port 80, 443, 3306 on your AccuWeb.Cloud environment firewall.<\/li>\n<\/ol>\n<h3 id=\"Update-the-System\" class=\"ac-h3\">Update the System<\/h3>\n<p>Before installing the LAMP stack, let&#8217;s update the system packages to the latest versions. Run this command:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt update &amp;&amp; apt upgrade<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed.png\"><img decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38470 size-full\" title=\"Update the system\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed.png\" alt=\"Update the system\" width=\"978\" height=\"785\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed.png 978w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-300x241.png 300w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-768x616.png 768w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/a><\/p>\n<p>If asked to confirm during the server update and upgrade process, press Y to continue.<\/p>\n<h3 id=\"Install-Apache-Web-Server\" class=\"ac-h3\">Install Apache Web Server<\/h3>\n<p>Apache is a popular, open-source web server that can run on different operating systems like Windows, Linux, and more. It\u2019s currently the most widely used web server, even more popular than Nginx and Cloudflare.<\/p>\n<p>To install Apache, run this command:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install apache2 -y<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1.png\"><img decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38472 size-full\" title=\"Install Apache\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1.png\" alt=\"Install Apache\" width=\"976\" height=\"510\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1.png 976w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-300x157.png 300w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-768x401.png 768w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><\/a><\/p>\n<p>After installation, start and enable Apache so it runs automatically:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl start apache2<\/strong><\/code><\/pre>\n<pre><code class=\"language-javascript\"><strong># systemctl enable apache2<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38473 size-full\" title=\"Enable Apache\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2.png\" alt=\"Enable Apache\" width=\"512\" height=\"165\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-300x97.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>To check if Apache is running, use this command:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl status apache2<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38474 size-full\" title=\"Check if Apache is running\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3.png\" alt=\"Check if Apache is running\" width=\"512\" height=\"278\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-300x163.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>If everything is set up correctly, you should see an output indicating the service is active and running.<\/p>\n<p>You can enable the ufw firewall on the Accuweb Cloud Ubuntu server, as it is not enabled by default. If you allow the ufw firewall rule without installing it on the AccuWeb.Cloud Elastic VPS then you will receive the following error.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38475 size-full\" title=\"Enable the ufw firewall\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4.png\" alt=\"Enable the ufw firewall\" width=\"512\" height=\"93\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-300x54.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>To install ufw firewall on your https:\/\/accuweb.cloud\/compute\/cloud-vps Elastic Ubuntu VPS, run the following command in the terminal.<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install ufw<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38476 size-full\" title=\"Install ufw firewall\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5.png\" alt=\"Install ufw firewall\" width=\"512\" height=\"427\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-300x250.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Once it is installed, you can enable it by running the following command in the terminal.<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw enable<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38477 size-full\" title=\"ufw enable\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6.png\" alt=\"ufw enable\" width=\"512\" height=\"121\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-300x71.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>After that, you can allow the HTTP connection on your server through ufw firewall.<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw allow 80\/tcp<\/strong><\/code><\/pre>\n<pre><code class=\"language-javascript\"><strong># ufw allow 443\/tcp<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38478 size-full\" title=\"Allow HTTP connection through ufw firewall\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7.png\" alt=\"Allow HTTP connection through ufw firewall\" width=\"512\" height=\"166\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-300x97.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38479 size-full\" title=\"Allow HTTP connection through ufw firewall\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8.png\" alt=\"Allow HTTP connection through ufw firewall\" width=\"512\" height=\"93\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-300x54.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Once you allow the HTTP connection on your server through ufw firewall, you can check its status by running the following command.<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw status<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38480 size-full\" title=\"Check ufw status\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9.png\" alt=\"Check ufw status\" width=\"512\" height=\"244\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-300x143.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Now, open a web browser like Chrome and go to your domain or server IP to check if the default Apache web page appears.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/image32.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38430 size-full\" title=\"Check the default Apache web page\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/image32.png\" alt=\"Check the default Apache web page\" width=\"978\" height=\"837\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/image32.png 978w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/image32-300x257.png 300w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/image32-768x657.png 768w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/a><\/p>\n<div class=\"main-tooltip-only-btn\"><a class=\"tooltip-link\" href=\"https:\/\/accuweb.cloud\/database\/mariadb-hosting\" target=\"_blank\" rel=\"noopener\"><button class=\"tooltip-btn\">Check Our MariaDB Hosting <i class=\"fa-solid fa-arrow-right-long\"><\/i><br \/>\n<\/button><\/a><\/div>\n<h3 id=\"Install-MariaDB-Database-Server\" class=\"ac-h3\">Install MariaDB Database Server<\/h3>\n<p>MariaDB is a free, open-source database system similar to <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\">MySQL<\/a>, with improvements in reliability, speed, and flexibility. It uses the same SQL language as MySQL to help create and manage databases.<\/p>\n<p>MariaDB is often used in the LAMP stack for database-driven applications like WordPress, Drupal, and Joomla. To install it, run this command:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install MariaDB-server<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38481 size-full\" title=\"Install MariaDB server\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11.png\" alt=\"Install MariaDB server\" width=\"512\" height=\"438\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-300x257.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>This will download and install MariaDB and its required components. During installation, if asked to confirm, press Y to continue.<\/p>\n<p>After installation, you need to start the <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/mariadb-hosting\" target=\"_blank\" rel=\"noopener\">Mariadb<\/a> service. By default, it is in the inactive status. To start the MariaDB service, run the following command.<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl start MariaDB<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38482 size-full\" title=\"Start MariaDB\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12.png\" alt=\"Start MariaDB\" width=\"512\" height=\"98\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12-300x57.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Once you start the MariaDB service, it\u2019s good to check if the MariaDB service is running. Use this command:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl status MariaDB<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38483 size-full\" title=\"Check status MariaDB\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13.png\" alt=\"Check status MariaDB\" width=\"512\" height=\"443\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13-300x260.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>If everything is working, you\u2019ll see that the service is active. To make sure MariaDB starts automatically when the system boots, run:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl enable MariaDB<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38484 size-full\" title=\"Enable MariaDB\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14.png\" alt=\"Enable MariaDB\" width=\"512\" height=\"136\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14-300x80.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><br \/>\n<strong>Secure MariaDB<\/strong><br \/>\nTo secure your MariaDB installation, run the following command:<\/p>\n<pre><code class=\"language-javascript\"><strong># mysql_secure_installation<\/strong><\/code><\/pre>\n<p>This script will guide you through some basic security settings. It will prompt you to:<\/p>\n<ol class=\"ac-ol\">\n<li>Set a root password.<\/li>\n<li>Choose whether to remove anonymous users and disable remote root login (recommended for security).<a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38485 size-full\" title=\"Secure installation\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15.png\" alt=\"Secure installation\" width=\"510\" height=\"512\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15.png 510w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15-300x300.png 300w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15-150x150.png 150w\" sizes=\"(max-width: 510px) 100vw, 510px\" \/><\/a><\/li>\n<li>Remove the test <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\" target=\"_blank\" rel=\"noopener\">database<\/a>, which is accessible by default, and may pose a security risk.<\/li>\n<li>Finally, be sure to reload the privilege tables after making these changes to apply them right away.<\/li>\n<\/ol>\n<div class=\"accu-top-cta-space\"><\/div>\n<div style=\"display: flex; justify-content: center;\">\n<div class=\"save-card1\"><a class=\"save-btn1\" href=\"https:\/\/accuweb.cloud\/register\">Register Here \u2192<\/a><\/div>\n<\/div>\n<div class=\"accu-bottom-cta-space\"><\/div>\n<div class=\"accu-extra-top-space\"><\/div>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38486 size-full\" title=\"Secure installation\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-16.png\" alt=\"Secure installation\" width=\"477\" height=\"512\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-16.png 477w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-16-279x300.png 279w\" sizes=\"(max-width: 477px) 100vw, 477px\" \/><\/a><br \/>\n<strong>Important Notes<\/strong><\/p>\n<ul class=\"ac-ul\">\n<li>Disabling remote root login helps prevent brute-force attacks, so do this unless you need remote access.<\/li>\n<li>Removing the test database is also advised to keep your system secure.<\/li>\n<\/ul>\n<p>These steps will strengthen your MariaDB setup and help protect it from common security threats.<\/p>\n<p><strong>Setup MariaDB<\/strong><\/p>\n<p><strong>Log in to <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\">MySQL<\/a><\/strong><\/p>\n<p>First, log in to your MySQL server as the root user:<\/p>\n<pre><code class=\"language-javascript\"><strong># mysql -u root -p<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38487 size-full\" title=\"Log in to MySQL\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-17.png\" alt=\"Log in to MySQL\" width=\"512\" height=\"230\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-17.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-17-300x135.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><br \/>\n<strong>Create a New Database<\/strong><br \/>\nCreate a sample <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\" target=\"_blank\" rel=\"noopener\">database<\/a> called accutest_db:<\/p>\n<pre><code class=\"language-javascript\"><strong>CREATE DATABASE accutest_db;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38489 size-full\" title=\"Create Database\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-18.png\" alt=\"Create Database\" width=\"512\" height=\"267\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-18.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-18-300x156.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>To make sure the database was created, list all databases:<\/p>\n<pre><code class=\"language-javascript\"><strong>SHOW DATABASES;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38490 size-full\" title=\"Show Database\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10.png\" alt=\"Show Database\" width=\"512\" height=\"390\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-300x229.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><br \/>\n<strong>Create a New User and Grant Permissions<\/strong><br \/>\nCreate a new user, such as accuadmin, with a secure password. Replace AccU@123456789 with your desired password:<\/p>\n<pre><code class=\"language-javascript\"><strong>CREATE USER 'accuadmin'@'localhost' IDENTIFIED BY 'AccU@123456789';<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-19.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38491 size-full\" title=\"Create user\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-19.png\" alt=\"Create user\" width=\"512\" height=\"457\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-19.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-19-300x268.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Then, grant full access to accuadmin on the new accutest_db database:<\/p>\n<pre><code class=\"language-javascript\"><strong>GRANT ALL PRIVILEGES ON accutest_db.* TO 'accuadmin'@'localhost';<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38492 size-full\" title=\"Grant full access to Accuadmin\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-1.png\" alt=\"Grant full access to Accuadmin\" width=\"512\" height=\"456\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-1-300x267.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Apply the changes by flushing privileges:<\/p>\n<p><strong>FLUSH PRIVILEGES;<\/strong><\/p>\n<p>Finally, exit MySQL:<\/p>\n<pre><code class=\"language-javascript\"><strong>EXIT<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38493 size-full\" title=\"Exit MySQL\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-1.png\" alt=\"Exit MySQL\" width=\"506\" height=\"512\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-1.png 506w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-1-296x300.png 296w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/a><\/p>\n<div class=\"main-tooltip-only-btn\"><a class=\"tooltip-link\" href=\"https:\/\/accuweb.cloud\/application\/php-hosting\" target=\"_blank\" rel=\"noopener\"><button class=\"tooltip-btn\">Check Our PHP Hosting <i class=\"fa-solid fa-arrow-right-long\"><\/i><br \/>\n<\/button><\/a><\/div>\n<h3 id=\"Install-PHP-and-Configure-PHP-FPM\" class=\"ac-h3\">Install PHP and Configure PHP-FPM<\/h3>\n<p><strong>Install PHP<\/strong><\/p>\n<p>PHP (Hypertext Preprocessor) is a server-side language used to make dynamic web pages. It\u2019s popular with developers worldwide. In the LAMP stack for Ubuntu 22.04, PHP 8.3 is included by default.<\/p>\n<p>Some projects may need different PHP versions, which can be installed and managed through PHP-FPM. However, Ubuntu 22.04&#8217;s default repositories offer only limited PHP versions.<\/p>\n<p>To install other PHP versions, such as PHP 7.4, you can add a trusted repository like ppa:ondrej\/php. Follow these steps to add this repository and install multiple PHP versions:<\/p>\n<p>Add the ppa:ondrej\/php repository:<\/p>\n<pre><code class=\"language-javascript\"><strong># add-apt-repository ppa:ondrej\/php<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38494 size-full\" title=\"Add repository and install multiple PHP version\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-1.png\" alt=\"Add repository and install multiple PHP version\" width=\"512\" height=\"476\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-1-300x279.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Update the package index to include this repository:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt update<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38495 size-full\" title=\"Update the package index\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-1.png\" alt=\"Update the package index\" width=\"512\" height=\"223\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-1-300x131.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Install PHP and PHP-FPM<\/strong><\/p>\n<p>PHP-FPM (FastCGI Process Manager) helps manage PHP processes efficiently.<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install -y php php-fpm<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38496 size-full\" title=\"Install PHP\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-1.png\" alt=\"Install PHP\" width=\"512\" height=\"268\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-1-300x157.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Install Common PHP Extensions<\/strong><\/p>\n<p>You can install frequently used <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/application\/php-hosting\" target=\"_blank\" rel=\"noopener\">PHP<\/a> extensions with the following command:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install -y php-cli libapache2-mod-php php-mysql php-mbstring php-bcmath php-zip php-gd php-curl php-xml<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38497 size-full\" title=\"Install PHP Extensions\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-1.png\" alt=\"Install PHP Extensions\" width=\"512\" height=\"355\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-1-300x208.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Here&#8217;s what each extension does:<\/p>\n<p><strong>php-mysql:<\/strong> Allows PHP to interact with MySQL databases.<\/p>\n<p><strong>libapache2-mod-php:<\/strong> Let Apache run PHP scripts.<\/p>\n<p><strong>php-mbstring:<\/strong> Adds support for UTF-8 text formats.<\/p>\n<p><strong>php-bcmath:<\/strong> Provides support for precise math calculations.<\/p>\n<p><strong>php-zip:<\/strong> Adds ZIP file support for PHP.<\/p>\n<p><strong>php-gd:<\/strong> Enables image processing in PHP.<\/p>\n<p><strong>php-curl:<\/strong> Allows URL transfers in PHP applications.<\/p>\n<p><strong>php-xml:<\/strong> Adds XML support in PHP.<\/p>\n<p><strong>Install Optional PHP Packages<\/strong><\/p>\n<p>Here are some optional PHP packages you can install if needed for your setup.<\/p>\n<p><strong>PHP-CLI<\/strong><\/p>\n<p>To run PHP scripts from the command line, install the php-cli package:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install php-cli<\/strong><\/code><\/pre>\n<p><strong>PHP-CGI<\/strong><\/p>\n<p>To run PHP scripts without the Apache PHP module, install php-cgi:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install php-cgi<\/strong><\/code><\/pre>\n<p><strong>PHP-MySQL<\/strong><\/p>\n<p>To connect PHP with MySQL, install php-mysql:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install php-MySQL<\/strong><\/code><\/pre>\n<p><strong>PHP-PgSQL<\/strong><\/p>\n<p>To connect PHP with <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/postgresql-hosting\" target=\"_blank\" rel=\"noopener\">PostgreSQL<\/a>, install php-pgsql:<\/p>\n<pre><code class=\"language-javascript\"><strong># apt install php-pgsql<\/strong><\/code><\/pre>\n<p>Check the PHP Version<\/p>\n<p>To see which version of PHP is installed, run:<\/p>\n<pre><code class=\"language-javascript\"><strong># php -v<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38498 size-full\" title=\"Check version of installed PHP\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-1.png\" alt=\"Check version of installed PHP\" width=\"512\" height=\"137\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-1-300x80.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Start and Enable PHP-FPM<\/strong><\/p>\n<p>For example, if you installed PHP 8.3, start PHP-FPM with:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl start php8.3-fpm<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38499 size-full\" title=\"Start and enable PHP\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-1.png\" alt=\"Start and enable PHP\" width=\"512\" height=\"81\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-1-300x47.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>To make PHP-FPM start automatically on boot:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl enable php8.3-fpm<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38500 size-full\" title=\"Make PHP start automatically\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-1.png\" alt=\"Make PHP start automatically\" width=\"512\" height=\"126\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-1-300x74.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>To check if PHP-FPM is running:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl status php8.3-fpm<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38501 size-full\" title=\"Check if PHP is running\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-1.png\" alt=\"Check if PHP is running\" width=\"512\" height=\"275\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-1-300x161.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Configure PHP-FPM<\/strong><\/p>\n<p>PHP-FPM helps PHP <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/applications\" target=\"_blank\" rel=\"noopener\">applications<\/a> run faster by using memory-based pools. Follow these steps to set up PHP-FPM with Apache and adjust the pool settings to manage resources efficiently.<\/p>\n<p><strong>Enable the required Apache modules.<\/strong><\/p>\n<p>You need to run the following command to enable the Apache modules.<\/p>\n<pre><code class=\"language-javascript\"><strong># a2enmod proxy_fcgi setenvif<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38502 size-full\" title=\"Enable the required Apache modules\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-1.png\" alt=\"Enable the required Apache modules\" width=\"512\" height=\"164\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-1-300x96.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>The command above activates these modules on your web server:<\/p>\n<p><strong>proxy_fcgi:<\/strong> Allows Apache to connect with PHP-FPM as a proxy.<\/p>\n<p><strong>setenvif:<\/strong> Sets environment variables to allow connections between Apache and PHP-FPM.<\/p>\n<p>If you have added or modified the configuration file, then you need to activate it by running the following command.<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl restart apache2<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-20.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38503 size-full\" title=\"Restart Apache\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-20.png\" alt=\"Restart Apache\" width=\"512\" height=\"84\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-20.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-20-300x49.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Enable the default PHP-FPM configuration.<\/strong><\/p>\n<p>You need to run the following command to enable the default PHP-FPM configuration.<\/p>\n<pre><code class=\"language-javascript\"><strong># a2enconf php8.3-fpm<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38504 size-full\" title=\"Enable the default PHP configuration\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-2.png\" alt=\"Enable the default PHP configuration\" width=\"512\" height=\"126\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-2-300x74.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>You need to restart the Apache service to apply the changes that you have made.<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl restart apache2<\/strong><\/code><\/pre>\n<p>Switch to the PHP-FPM pool configurations directory.<\/p>\n<pre><code class=\"language-javascript\"><strong># cd \/etc\/php\/8.3\/fpm\/pool.d\/<\/strong><\/code><\/pre>\n<p>Open the default www.conf PHP-FPM pool configuration.<\/p>\n<pre><code class=\"language-javascript\"><strong># nano \/etc\/php\/8.3\/fpm\/pool.d\/www.conf<\/strong><\/code><\/pre>\n<p>Verify that the default PHP-FPM pool name www.<\/p>\n<p><strong>[www]<\/strong><\/p>\n<p>Search and verify the following variables are set to www-data to enable PHP-FPM to use the default web server user profile.<\/p>\n<p><strong>user = www-data<\/strong><\/p>\n<p><strong>group = www-data<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38505 size-full\" title=\"Search and verify www-data variables\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-2.png\" alt=\"Search and verify www-data variables\" width=\"493\" height=\"512\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-2.png 493w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-2-289x300.png 289w\" sizes=\"(max-width: 493px) 100vw, 493px\" \/><\/a><\/p>\n<p><strong>listen.owner = www-data<\/strong><\/p>\n<p><strong>listen.group = www-data<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38508 size-full\" title=\"Search and verify www-data variables\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-3.png\" alt=\"Search and verify www-data variables\" width=\"512\" height=\"487\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-3-300x285.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<div class=\"accu-top-cta-space\"><\/div>\n<div style=\"display: flex; justify-content: center;\">\n<div class=\"save-card1\"><a class=\"save-btn1\" href=\"https:\/\/accuweb.cloud\/register\">Register Here \u2192<\/a><\/div>\n<\/div>\n<div class=\"accu-bottom-cta-space\"><\/div>\n<div class=\"accu-extra-top-space\"><\/div>\n<p>Locate these pool settings and adjust them based on your server needs:<\/p>\n<p><strong>pm:<\/strong> Defines the process manager. Setting it to &#8220;dynamic&#8221; lets <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/application\/php-hosting\" target=\"_blank\" rel=\"noopener\">PHP<\/a> adjust the number of processes as needed.<\/p>\n<p><strong>pm.start_servers:<\/strong> Sets the number of PHP child processes that start with the server. The default is 2.<\/p>\n<p><strong>pm.max_children:<\/strong> Limits the total number of PHP child processes that can run at once. The default is 5.<\/p>\n<p><strong>pm.min_spare_servers: <\/strong>Sets the minimum number of idle PHP processes. The default is 1.<\/p>\n<p><strong>pm.max_spare_servers:<\/strong> Sets the maximum number of idle PHP processes. The default is 3.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38509 size-full\" title=\"Locate Pool settings\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-3.png\" alt=\"Locate Pool settings\" width=\"512\" height=\"486\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-3-300x285.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>pm.max_requests:<\/strong> Caps the number of requests a PHP process can handle before it resets.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38510 size-full\" title=\"Caps the number of requests\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-2.png\" alt=\"Caps the number of requests\" width=\"512\" height=\"214\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-2-300x125.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Save and close the file.<\/p>\n<p>Restart the PHP-FPM service to make your changes take effect.<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl restart php8.3-fpm<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38511 size-full\" title=\"Restart the PHP service\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-2.png\" alt=\"Restart the PHP service\" width=\"512\" height=\"137\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-2-300x80.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Configure Apache with PHP-FPM<\/strong><\/p>\n<p>Apache can connect to PHP-FPM using the mod_proxy_fcgi module, which communicates through a UNIX socket or the default TCP port 9000. Here\u2019s how to set up an Apache virtual host to work with PHP-FPM.<\/p>\n<p><strong>Remove Default Apache Configuration Files<\/strong><\/p>\n<p>Delete the default Apache virtual host configuration files:<\/p>\n<pre><code class=\"language-javascript\"><strong># rm -rf \/etc\/apache2\/sites-enabled\/000-default.conf &amp;&amp; rm -rf \/etc\/apache2\/sites-available\/000-default.conf<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38512 size-full\" title=\"Delete the default Apache\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-2.png\" alt=\"Delete the default Apache\" width=\"512\" height=\"115\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-2-300x67.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Create a New Apache Virtual Host File<\/strong><\/p>\n<p>Create a new configuration file for your domain in \/etc\/apache2\/site-available\/, e.g., demovpstest.com.conf:<\/p>\n<pre><code class=\"language-javascript\"><strong># nano \/etc\/apache2\/sites-available\/demovpstest.com.conf<\/strong><\/code><\/pre>\n<p>Step 3: Add Virtual Host Configurations<\/p>\n<p>Replace demovpstest.com with your domain and add these configurations:<\/p>\n<pre><code class=\"language-javascript\"><strong>&lt;VirtualHost *:80&gt;<\/strong>\r\n<strong>ServerAdmin webmaster@demovpstest.com<\/strong>\r\n<strong>ServerName demovpstest.com<\/strong>\r\n<strong>DocumentRoot \/var\/www\/demovpstest.com<\/strong>\r\n<strong>&lt;Directory \/var\/www\/demovpstest.com&gt;<\/strong>\r\n<strong>Options Indexes FollowSymLinks<\/strong>\r\n<strong>AllowOverride All<\/strong>\r\n<strong>Require all granted<\/strong>\r\n<strong>&lt;\/Directory&gt;<\/strong>\r\n<strong>&lt;FilesMatch \\.php$&gt;<\/strong>\r\n<strong>SetHandler \"proxy:unix:\/var\/run\/php\/php8.3-fpm.sock|fcgi:\/\/localhost\/\"<\/strong>\r\n<strong>&lt;\/FilesMatch&gt;<\/strong>\r\n<strong>ErrorLog ${APACHE_LOG_DIR}\/demovpstest.com_error.log<\/strong>\r\n<strong>CustomLog ${APACHE_LOG_DIR}\/demovpstest.com_access.log combined<\/strong>\r\n<strong>&lt;\/VirtualHost&gt;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38513 size-full\" title=\"Replace demovpstest.com with your domain\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-2.png\" alt=\"Replace demovpstest.com with your domain\" width=\"512\" height=\"388\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-2-300x227.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Explanation:<\/strong><\/p>\n<p>This setup creates a new Apache virtual host that listens on HTTP port 80 and serves web content for your domain, demovpstest.com. All <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/application\/php-hosting\" target=\"_blank\" rel=\"noopener\">PHP<\/a> file requests are handled by PHP-FPM through the \/var\/run\/php\/php8.3-fpm.sock UNIX socket.<\/p>\n<p><strong>VirtualHost *:80:<\/strong> Listens on HTTP port 80.<\/p>\n<p><strong>DocumentRoot:<\/strong> You can set the root folder for your site\u2019s files.<\/p>\n<p><strong>&lt;FilesMatch \\.php$&gt;: <\/strong>Forwards PHP requests to PHP-FPM using the \/var\/run\/php\/php8.3-fpm.sock socket.<\/p>\n<p><strong>ErrorLog and CustomLog:<\/strong> You can add custom paths for logs.<\/p>\n<p>Save and close the file.<\/p>\n<p><strong>Enable the New Virtual Host Configuration<\/strong><\/p>\n<p>Enable your new site configuration:<\/p>\n<pre><code class=\"language-javascript\"><strong># a2ensite demovpstest.com.conf<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38514 size-full\" title=\"Enable your new site configuration\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-2.png\" alt=\"Enable your new site configuration\" width=\"512\" height=\"130\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-2-300x76.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Then, we need to reload the Apache service. Run the following command to reload the Apache service.<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl reload apache2<\/strong><\/code><\/pre>\n<p><strong>Test Apache Configuration<\/strong><\/p>\n<p>Check for syntax errors:<\/p>\n<pre><code class=\"language-javascript\"><strong># apache2ctl configtest<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38515 size-full\" title=\"Check for syntax errors\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-2.png\" alt=\"Check for syntax errors\" width=\"512\" height=\"130\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-2-300x76.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>You are getting a warning message because DocumentRoot has not been created yet. Rest the Syntex is good. To fix it, we need to create it. Let\u2019s do that.<\/p>\n<p><strong>Create the Web Root Directory<\/strong><\/p>\n<p>Create the directory for your site:<\/p>\n<pre><code class=\"language-javascript\"><strong># mkdir -p \/var\/www\/demovpstest.com<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38516 size-full\" title=\"Create the directory\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-2.png\" alt=\"Create the directory\" width=\"512\" height=\"84\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-2-300x49.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Create a PHP Test File<\/strong><\/p>\n<p>Make a test file called phpinfo.php to check the PHP setup:<\/p>\n<pre><code class=\"language-javascript\"><strong># nano \/var\/www\/demovpstest.com\/phpinfo.php<\/strong><\/code><\/pre>\n<p>Add the following content:<\/p>\n<pre><code class=\"language-javascript\"><strong>&lt;?php<\/strong>\r\n<strong>phpinfo();<\/strong>\r\n<strong>?&gt;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38517 size-full\" title=\"Create a PHP test file\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-2.png\" alt=\"Create a PHP test file\" width=\"512\" height=\"150\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-2-300x88.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Save and close the file.<\/p>\n<p><strong>Restart Apache<\/strong><\/p>\n<p>Restart Apache to apply changes:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl restart apache2<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-22.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38518 size-full\" title=\"Restart Apache\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-22.png\" alt=\"Restart Apache\" width=\"512\" height=\"98\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-22.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-22-300x57.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Verify in the Browser<\/strong><\/p>\n<p>Open a web browser and visit http:\/\/domainname.com\/phpinfo.php or http:\/\/server-ip-address\/phpinfo.php to confirm your PHP setup.<\/p>\n<p>Here, we have used http:\/\/demovpstest.com\/phpinfo.php to confirm the PHP setup. This should display PHP version information and installed modules.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38519 size-full\" title=\"Verify in the browser\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-4.png\" alt=\"Verify in the browser\" width=\"512\" height=\"494\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-4.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-4-300x289.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Secure the Server<\/strong><\/p>\n<p>Ubuntu 22.04 servers on AccuWeb.Cloud comes with Uncomplicated Firewall (UFW) enabled by default. Apache uses HTTP port 80 to deliver web content, while other LAMP stack services use internal ports like <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\">MySQL<\/a> (3306) and PHP-FPM (9000).<\/p>\n<p>Follow these steps to configure the firewall to allow connections on port 80 (HTTP) and set up HTTPS connections on port 443.<\/p>\n<p><strong>Configure the Firewall<\/strong><\/p>\n<p><strong>Check the Firewall Status<\/strong><\/p>\n<p>Check if UFW is active:<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw status<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38520 size-full\" title=\"Check the firewall status\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-4.png\" alt=\"Check the firewall status\" width=\"512\" height=\"241\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-4.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-4-300x141.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>List Available UFW Application Profiles<\/strong><\/p>\n<p>View available profiles to confirm that the Apache profile is present:<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw app list<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38521 size-full\" title=\"List available ufw application profiles\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-3.png\" alt=\"List available ufw application profiles\" width=\"512\" height=\"185\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-3-300x108.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Allow Apache Connections<\/strong><\/p>\n<p>Allow both HTTP and HTTPS connections for Apache:<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw allow \"Apache Full\"<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-23.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38523 size-full\" title=\"Allow Apache connections\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-23.png\" alt=\"Allow Apache connections\" width=\"512\" height=\"125\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-23.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-23-300x73.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Now, you need to reload the firewall to apply the new rules that you have added:<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw reload<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38524 size-full\" title=\"Reload the firewall\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-5.png\" alt=\"Reload the firewall\" width=\"512\" height=\"121\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-5.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-1-5-300x71.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Verify UFW Rules<\/strong><\/p>\n<p>Check that the Apache rules are applied:<\/p>\n<pre><code class=\"language-javascript\"><strong># ufw status<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38525 size-full\" title=\"Verify ufw rules\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-5.png\" alt=\"Verify ufw rules\" width=\"512\" height=\"258\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-5.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-2-5-300x151.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>This ensures your server can securely handle HTTP and HTTPS connections.<\/p>\n<h3 id=\"Generate-Trusted-Let-Encrypt-SSL-Certificates\" class=\"ac-h3\">Generate Trusted Let&#8217;s Encrypt SSL Certificates<\/h3>\n<p><strong>Install Certbot<\/strong><\/p>\n<p>Install the Certbot tool for Let&#8217;s Encrypt using Snap:<\/p>\n<pre><code class=\"language-javascript\"><strong># snap install certbot - classic<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38526 size-full\" title=\"Install Certbot\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-4.png\" alt=\"Install Certbot\" width=\"512\" height=\"157\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-4.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-3-4-300x92.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Request an SSL Certificate<\/strong><\/p>\n<p>Get a new SSL certificate for your domain. Replace demovpstest.com with your domain and admin@demovpstest.com with your email:<\/p>\n<pre><code class=\"language-javascript\"><strong># certbot --apache -d demovpstest.com -m admin@demovpstest.com --agree-tos<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38527 size-full\" title=\"Request an SSL certificate\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-3.png\" alt=\"Request an SSL certificate\" width=\"512\" height=\"505\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-4-3-300x296.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Test Automatic Renewal<\/strong><\/p>\n<p>Check if the automatic renewal process for the SSL certificate works:<\/p>\n<pre><code class=\"language-javascript\"><strong># certbot renew --dry-run<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38528 size-full\" title=\"Test automatic renewal\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-3.png\" alt=\"Test automatic renewal\" width=\"512\" height=\"424\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-5-3-300x248.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Restart Apache<\/strong><\/p>\n<p>Restart the Apache web server to apply your SSL settings:<\/p>\n<pre><code class=\"language-javascript\"><strong># systemctl restart apache2<\/strong><\/code><\/pre>\n<p>Once you install the Let\u2019s Encrypt SSL Certificate on your domain and it points to your Accuweb.Cloud <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/compute\/cloud-vps\" target=\"_blank\" rel=\"noopener\">Elastic VPS<\/a>, the SSL certificate warning message will be removed from your website, and it will show that your website is secure.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38529 size-full\" title=\"Restart Apache\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-3.png\" alt=\"Restart Apache\" width=\"512\" height=\"493\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-6-3-300x289.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Test the LAMP Stack Installation<\/strong><\/p>\n<p>Follow these steps to create a new table in your content_database MySQL database so your PHP application can show the message &#8220;Hello World! Greetings from AccuWeb.Cloud&#8221; when accessed in a web browser.<\/p>\n<p>Log in to MySQL<\/p>\n<p>Access the MySQL console using the dbadmin user you created earlier:<\/p>\n<pre><code class=\"language-javascript\"><strong># mysql -u accuadmin -p<\/strong><\/code><\/pre>\n<div class=\"main-tooltip-only-btn\"><a class=\"tooltip-link\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\"><button class=\"tooltip-btn\">Check Our MySQL Hosting <i class=\"fa-solid fa-arrow-right-long\"><\/i><br \/>\n<\/button><\/a><\/div>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38530 size-full\" title=\"Log in to MySQL\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-3.png\" alt=\"Log in to MySQL\" width=\"512\" height=\"237\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-7-3-300x139.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Enter the password for the dbadmin user when prompted.<\/p>\n<p><strong>Select the Sample Database<\/strong><\/p>\n<p>Switch to the accutest_db database:<\/p>\n<pre><code class=\"language-javascript\"><strong>USE accutest_db;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38531 size-full\" title=\"Select the sample database\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-3.png\" alt=\"Select the sample database\" width=\"512\" height=\"232\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-8-3-300x136.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Create a New Table<\/strong><\/p>\n<p>Create a table named messages with two columns, content_id and content, to store your data:<\/p>\n<pre><code class=\"language-javascript\"><strong>CREATE TABLE IF NOT EXISTS messages (<\/strong>\r\n<strong>content_id INT AUTO_INCREMENT PRIMARY KEY,<\/strong>\r\n<strong>content VARCHAR(255) NOT NULL<\/strong>\r\n<strong>);<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38532 size-full\" title=\"Create a new table\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-3.png\" alt=\"Create a new table\" width=\"512\" height=\"322\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-9-3-300x189.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>This creates a new table with:<\/p>\n<p><strong>content_id: <\/strong>A unique number that increases automatically for each new entry.<\/p>\n<p><strong>content:<\/strong> A text field that can hold up to 255 characters.<\/p>\n<p><strong>Insert Data<\/strong><\/p>\n<p>Add a message to the messages table that you want to display on the web page:<\/p>\n<pre><code class=\"language-javascript\"><strong>INSERT INTO messages (content) VALUES ('Hello World! Greetings from Accuweb.Cloud');<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38533 size-full\" title=\"Insert Data\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-3.png\" alt=\"Insert Data\" width=\"512\" height=\"375\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-3.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-10-3-300x220.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Check Table Data<\/strong><\/p>\n<p>View all the data in the table to make sure your message was added:<\/p>\n<pre><code class=\"language-javascript\"><strong>SELECT * FROM messages;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38534 size-full\" title=\"Check table data\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-2.png\" alt=\"Check table data\" width=\"512\" height=\"471\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-2.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-11-2-300x276.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Exit MySQL<\/strong><\/p>\n<p>Exit the <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\">MySQL<\/a> console:<\/p>\n<pre><code class=\"language-javascript\"><strong>EXIT;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38535 size-full\" title=\"Exit MySQL\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12-1.png\" alt=\"Exit MySQL\" width=\"512\" height=\"494\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-12-1-300x289.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Create a PHP File<\/strong><\/p>\n<p>Create a new PHP file named accuweb-setup.php in your web root directory \/var\/www\/demovpstest.com:<\/p>\n<pre><code class=\"language-javascript\"><strong># nano \/var\/www\/demovpstest.com\/accuweb-setup.php<\/strong><\/code><\/pre>\n<p>Add the following code to the file:<\/p>\n<pre><code class=\"language-javascript\"><strong>&lt;?php<\/strong>\r\n<strong>$hostname = \"localhost\";<\/strong>\r\n<strong>$username = \"accuadmin\";<\/strong>\r\n<strong>$password = \"Strong##Password123\";<\/strong>\r\n<strong>$dbname = \"accutest_db\";<\/strong>\r\n<strong>\/\/ Establish Connection<\/strong>\r\n<strong>$conn = new mysqli($hostname, $username, $password, $dbname);<\/strong>\r\n<strong>\/\/ Check connection<\/strong>\r\n<strong>if ($conn-&gt;connect_error) {<\/strong>\r\n<strong>die(\"Connection Failed: \" . $conn-&gt;connect_error);<\/strong>\r\n<strong>}<\/strong>\r\n<strong>$sql = \"SELECT content FROM messages\";<\/strong>\r\n<strong>$result = $conn-&gt;query($sql);<\/strong>\r\n<strong>if ($result-&gt;num_rows &gt; 0) {<\/strong>\r\n<strong>$row = $result-&gt;fetch_assoc();<\/strong>\r\n<strong>echo \"&lt;h2 style='color: blue; text-align: center; margin-bottom: 15px;'&gt;\"<\/strong>\r\n<strong>. htmlspecialchars($row[\"content\"]) . \"&lt;\/h2&gt;\";<\/strong>\r\n<strong>} else {<\/strong>\r\n<strong>echo \"&lt;h1&gt;No records found.&lt;\/h1&gt;\";<\/strong>\r\n<strong>}<\/strong>\r\n<strong>$conn-&gt;close();<\/strong>\r\n<strong>?&gt;<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38536 size-full\" title=\"Create a PHP file\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13-1.png\" alt=\"Create a PHP file\" width=\"512\" height=\"463\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-13-1-300x271.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p>Save and Close the File.<\/p>\n<p>This PHP code connects to the MySQL database and displays the message table&#8217;s content. If there are no records, it will show &#8220;No records found,&#8221; or if the connection fails, it will show &#8220;Connection Failed.&#8221;<\/p>\n<p><strong>Set Permissions<\/strong><\/p>\n<p>Give the Apache user www-data full access to your web root directory:<\/p>\n<pre><code class=\"language-javascript\"><strong># chown -R www-data:www-data \/var\/www\/demovpstest.com\/<\/strong><\/code><\/pre>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38537 size-full\" title=\"Set permissions\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14-1.png\" alt=\"Set permissions\" width=\"512\" height=\"103\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-14-1-300x60.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<p><strong>Test Your Application<\/strong><\/p>\n<p>Open your web browser and go to https:\/\/domainname.com\/phpinfo.php or https:\/\/server-ip-address\/phpinfo.php to check if your PHP application displays the message &#8220;Hello World! Greetings from AccuWeb.Cloud&#8221; from your <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\">MySQL database.<\/a><\/p>\n<p>Here, we have used https:\/\/demovpstest.com\/accuweb-setup.php to check if the PHP application displays the same message.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"acc-blog-image aligncenter wp-image-38538 size-full\" title=\"Test your application\" src=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15-1.png\" alt=\"Test your application\" width=\"512\" height=\"234\" srcset=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15-1.png 512w, https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/unnamed-15-1-300x137.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<h2 id=\"Conclusion\" class=\"ac-h2\">Conclusion:<\/h2>\n<p>We set up Apache, <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/database\/mariadb-hosting\" target=\"_blank\" rel=\"noopener\">MariaDB<\/a>, and PHP (a LAMP stack) on an Ubuntu 22.04 server. We also created example applications to test how all parts of the LAMP stack work together and to run the apps securely on the server. With the LAMP setup, you\u2019re ready to start building web <a class=\"ac-link-text\" href=\"https:\/\/accuweb.cloud\/applications\" target=\"_blank\" rel=\"noopener\">applications.<\/a><\/p>\n<div class=\"accu-top-cta-space\"><\/div>\n<div style=\"display: flex; justify-content: center;\">\n<div class=\"save-card1\"><a class=\"save-btn1\" href=\"https:\/\/accuweb.cloud\/register\">Register Here \u2192<\/a><\/div>\n<\/div>\n<div class=\"accu-top-cta-space\"><\/div>\n<h3 id=\"FAQs\" class=\"ac-h3\">People Also Ask(And You Should Too!)<\/h3>\n<p><strong>Q) What is the difference between LAMP and LEMP stack on Ubuntu 22.04?<\/strong><\/p>\n<p>A) The LAMP stack uses <b>Apache<\/b> as the web server, while the LEMP stack replaces Apache with <b>Nginx<\/b> (\u201cEngine-X\u201d). Both can run on Ubuntu 22.04, but Apache is known for wide compatibility and ease of setup, whereas Nginx offers better performance under high traffic.<\/p>\n<p><strong>Q) Is MariaDB better than MySQL for LAMP on Ubuntu 22.04?<\/strong><\/p>\n<p>A) Yes, in most cases. <b>MariaDB<\/b> is a drop-in replacement for MySQL, offering faster performance, improved features, and open-source community-driven development. Since Ubuntu 22.04 prioritizes MariaDB in its repositories, it\u2019s often the recommended choice.<\/p>\n<p><strong>Q)\u00a0 Can I install LAMP on Ubuntu 22.04 without root access?<\/strong><\/p>\n<p>A) You\u2019ll need <b>sudo privileges<\/b> to install and configure LAMP, since package installation and service management require administrative access. Without it, you can only run a limited version inside containers or user-space environments.<\/p>\n<p><strong>Q) How do I test if my LAMP installation is working on Ubuntu 22.04?<\/strong><\/p>\n<p>A) Create a simple <b>PHP info file<\/b> inside \/var\/www\/html\/ with:<\/p>\n<p>&lt;?php phpinfo(); ?&gt;<\/p>\n<p>Then, open http:\/\/your-server-ip\/info.php in a browser. If you see PHP configuration details, your LAMP setup is working correctly.<\/p>\n<p><strong>Q) Can I secure my LAMP stack on Ubuntu 22.04?<\/strong><\/p>\n<p>A) Yes. Use <b>UFW firewall<\/b>, enable <b>SSL\/TLS with Let\u2019s Encrypt<\/b>, and configure <b>MariaDB with a root password<\/b>. Regular updates (sudo apt update &amp;&amp; sudo apt upgrade) also help secure your stack.<\/p>\n<p><strong>Q) Can I replace Apache with Nginx after installing LAMP?<\/strong><\/p>\n<p>A) Yes, but then it becomes a <b>LEMP stack<\/b>. You\u2019ll need to remove Apache and configure Nginx as the web server. This is common if you want higher performance under heavy traffic.<\/p>\n<p><strong>Q) Is LAMP still relevant in 2025 with modern stacks like MEAN or MERN?<\/strong><\/p>\n<p>A) Absolutely. LAMP remains one of the <b>most reliable, secure, and widely supported stacks<\/b>, especially for PHP-based applications like WordPress, Drupal, and Joomla. Modern stacks are popular, but LAMP is still the backbone of millions of websites.<\/p>\n<p><strong>Q) What is the minimum server requirement to install LAMP on Ubuntu 22.04?<\/strong><\/p>\n<p>A) At least <b>1 GB RAM<\/b>, <b>1 vCPU<\/b>, and <b>10 GB disk space<\/b> is recommended for a basic setup. For production websites, 2 GB RAM or more ensures smoother performance.<\/p>\n<p><strong>Q) What is the difference between LAMP and LEMP stack on Ubuntu 22.04?<\/strong><\/p>\n<p>A) The LAMP stack uses <b>Apache<\/b> as the web server, while the LEMP stack replaces Apache with <b>Nginx<\/b> (\u201cEngine-X\u201d). Both can run on Ubuntu 22.04, but Apache is known for wide compatibility and ease of setup, whereas Nginx offers better performance under high traffic.<\/p>\n<p><strong>Q) Is MariaDB better than MySQL for LAMP on Ubuntu 22.04?<\/strong><\/p>\n<p>A) Yes, in most cases. <b>MariaDB<\/b> is a drop-in replacement for MySQL, offering faster performance, improved features, and open-source community-driven development. Since Ubuntu 22.04 prioritizes MariaDB in its repositories, it\u2019s often the recommended choice.<\/p>\n<p><strong>Q) Can I install LAMP on Ubuntu 22.04 without root access?<\/strong><\/p>\n<p>A) You\u2019ll need <b>sudo privileges<\/b> to install and configure LAMP, since package installation and service management require administrative access. Without it, you can only run a limited version inside containers or user-space environments.<\/p>\n<p><strong>Q) How do I test if my LAMP installation is working on Ubuntu 22.04?<\/strong><\/p>\n<p>A) Create a simple <b>PHP info file<\/b> inside \/var\/www\/html\/ with:<\/p>\n<p>&lt;?php phpinfo(); ?&gt;<\/p>\n<p>Then, open http:\/\/your-server-ip\/info.php in a browser. If you see PHP configuration details, your LAMP setup is working correctly.<\/p>\n<p><strong>Q) Can I secure my LAMP stack on Ubuntu 22.04?<\/strong><\/p>\n<p>A) Yes. Use <b>UFW firewall<\/b>, enable <b>SSL\/TLS with Let\u2019s Encrypt<\/b>, and configure <b>MariaDB with a root password<\/b>. Regular updates (sudo apt update &amp;&amp; sudo apt upgrade) also help secure your stack.<\/p>\n<p><strong>Q) Can I replace Apache with Nginx after installing LAMP?<\/strong><\/p>\n<p>A) Yes, but then it becomes a <b>LEMP stack<\/b>. You\u2019ll need to remove Apache and configure Nginx as the web server. This is common if you want higher performance under heavy traffic.<\/p>\n<p><strong>Q) Is LAMP still relevant in 2025 with modern stacks like MEAN or MERN?<\/strong><\/p>\n<p>A) Absolutely. LAMP remains one of the <b>most reliable, secure, and widely supported stacks<\/b>, especially for PHP-based applications like WordPress, Drupal, and Joomla. Modern stacks are popular, but LAMP is still the backbone of millions of websites.<\/p>\n<p><strong>Q) What is the minimum server requirement to install LAMP on Ubuntu 22.04?<\/strong><\/p>\n<p>A) At least <b>1 GB RAM<\/b>, <b>1 vCPU<\/b>, and <b>10 GB disk space<\/b> is recommended for a basic setup. For production websites, 2 GB RAM or more ensures smoother performance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install LAMP on Ubuntu 22.04 TL;DR LAMP stands for Linux, Apache, MySQL\/MariaDB, and PHP, a common web server environment for hosting dynamic sites and apps. On Ubuntu 22.04, install Apache with sudo apt update &amp;&amp; sudo apt install apache2 to serve web pages. Install MySQL or MariaDB (sudo apt install mysql-server or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":42059,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[406],"tags":[202,204,203],"class_list":["post-38398","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-beginner-linux-guide","tag-lamp-stack","tag-ubuntu-22-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.10 (Yoast SEO v26.4) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Install LAMP Stack on Ubuntu 22.04 - Step-by-Step Guide<\/title>\n<meta name=\"description\" content=\"Learn how to install the LAMP stack on Ubuntu 22.04 with Apache, MySQL\/MariaDB, and PHP. Follow step-by-step commands for secure web server setup.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn how to install LAMP on Ubuntu 22.04\" \/>\n<meta property=\"og:description\" content=\"Learn how to install the LAMP stack on Ubuntu 22.04 with Apache, MySQL\/MariaDB, and PHP. Follow step-by-step commands for secure web server setup.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"AccuWeb.Cloud\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/accuwebhosting\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-13T12:26:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-22T06:29:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jilesh Patadiya\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@accuwebhosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jilesh Patadiya\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"27 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/\"},\"author\":{\"name\":\"Jilesh Patadiya\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/#\/schema\/person\/76a9ac67b9c767ef39dbe3c4e9427756\"},\"headline\":\"Learn how to install LAMP on Ubuntu 22.04\",\"datePublished\":\"2024-11-13T12:26:31+00:00\",\"dateModified\":\"2026-01-22T06:29:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/\"},\"wordCount\":3186,\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png\",\"keywords\":[\"Beginner Linux Guide\",\"LAMP Stack\",\"Ubuntu 22.04\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/\",\"url\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/\",\"name\":\"Install LAMP Stack on Ubuntu 22.04 - Step-by-Step Guide\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png\",\"datePublished\":\"2024-11-13T12:26:31+00:00\",\"dateModified\":\"2026-01-22T06:29:56+00:00\",\"description\":\"Learn how to install the LAMP stack on Ubuntu 22.04 with Apache, MySQL\/MariaDB, and PHP. Follow step-by-step commands for secure web server setup.\",\"breadcrumb\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage\",\"url\":\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png\",\"contentUrl\":\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png\",\"width\":1280,\"height\":720,\"caption\":\"Learn how to install LAMP on Ubuntu 22.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/accuweb.cloud\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learn how to install LAMP on Ubuntu 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/#website\",\"url\":\"https:\/\/accuweb.cloud\/blog\/\",\"name\":\"AccuWeb.Cloud\",\"description\":\"Cutting Edge Cloud Computing\",\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/accuweb.cloud\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/#organization\",\"name\":\"AccuWeb.Cloud\",\"url\":\"https:\/\/accuweb.cloud\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"contentUrl\":\"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"width\":156,\"height\":87,\"caption\":\"AccuWeb.Cloud\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/#\/schema\/person\/76a9ac67b9c767ef39dbe3c4e9427756\",\"name\":\"Jilesh Patadiya\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/94d41936196a27a133819bab474a9b7ab76c4034cad001b4499db6bc5e47a2af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/94d41936196a27a133819bab474a9b7ab76c4034cad001b4499db6bc5e47a2af?s=96&d=mm&r=g\",\"caption\":\"Jilesh Patadiya\"},\"description\":\"Jilesh Patadiya, the visionary Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.\",\"sameAs\":[\"https:\/\/accuweb.cloud\/blog\",\"https:\/\/www.facebook.com\/accuwebhosting\",\"https:\/\/www.instagram.com\/accuwebhosting\/\",\"https:\/\/www.linkedin.com\/company\/accuwebhosting\/\",\"https:\/\/x.com\/accuwebhosting\",\"https:\/\/www.youtube.com\/c\/Accuwebhosting\"],\"url\":\"https:\/\/accuweb.cloud\/blog\/author\/accuwebadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Install LAMP Stack on Ubuntu 22.04 - Step-by-Step Guide","description":"Learn how to install the LAMP stack on Ubuntu 22.04 with Apache, MySQL\/MariaDB, and PHP. Follow step-by-step commands for secure web server setup.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/","og_locale":"en_US","og_type":"article","og_title":"Learn how to install LAMP on Ubuntu 22.04","og_description":"Learn how to install the LAMP stack on Ubuntu 22.04 with Apache, MySQL\/MariaDB, and PHP. Follow step-by-step commands for secure web server setup.","og_url":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/","og_site_name":"AccuWeb.Cloud","article_author":"https:\/\/www.facebook.com\/accuwebhosting","article_published_time":"2024-11-13T12:26:31+00:00","article_modified_time":"2026-01-22T06:29:56+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png","type":"image\/png"}],"author":"Jilesh Patadiya","twitter_card":"summary_large_image","twitter_creator":"@accuwebhosting","twitter_misc":{"Written by":"Jilesh Patadiya","Est. reading time":"27 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#article","isPartOf":{"@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/"},"author":{"name":"Jilesh Patadiya","@id":"https:\/\/accuweb.cloud\/blog\/#\/schema\/person\/76a9ac67b9c767ef39dbe3c4e9427756"},"headline":"Learn how to install LAMP on Ubuntu 22.04","datePublished":"2024-11-13T12:26:31+00:00","dateModified":"2026-01-22T06:29:56+00:00","mainEntityOfPage":{"@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/"},"wordCount":3186,"publisher":{"@id":"https:\/\/accuweb.cloud\/blog\/#organization"},"image":{"@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png","keywords":["Beginner Linux Guide","LAMP Stack","Ubuntu 22.04"],"articleSection":["Tutorials"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/","url":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/","name":"Install LAMP Stack on Ubuntu 22.04 - Step-by-Step Guide","isPartOf":{"@id":"https:\/\/accuweb.cloud\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage"},"image":{"@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png","datePublished":"2024-11-13T12:26:31+00:00","dateModified":"2026-01-22T06:29:56+00:00","description":"Learn how to install the LAMP stack on Ubuntu 22.04 with Apache, MySQL\/MariaDB, and PHP. Follow step-by-step commands for secure web server setup.","breadcrumb":{"@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#primaryimage","url":"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png","contentUrl":"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/11\/Learn-how-to-install-LAMP-on-Ubuntu-22.04.png","width":1280,"height":720,"caption":"Learn how to install LAMP on Ubuntu 22.04"},{"@type":"BreadcrumbList","@id":"https:\/\/accuweb.cloud\/blog\/learn-how-to-install-lamp-on-ubuntu-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/accuweb.cloud\/blog\/"},{"@type":"ListItem","position":2,"name":"Learn how to install LAMP on Ubuntu 22.04"}]},{"@type":"WebSite","@id":"https:\/\/accuweb.cloud\/blog\/#website","url":"https:\/\/accuweb.cloud\/blog\/","name":"AccuWeb.Cloud","description":"Cutting Edge Cloud Computing","publisher":{"@id":"https:\/\/accuweb.cloud\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/accuweb.cloud\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/accuweb.cloud\/blog\/#organization","name":"AccuWeb.Cloud","url":"https:\/\/accuweb.cloud\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","contentUrl":"https:\/\/accuweb.cloud\/blog\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","width":156,"height":87,"caption":"AccuWeb.Cloud"},"image":{"@id":"https:\/\/accuweb.cloud\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/accuweb.cloud\/blog\/#\/schema\/person\/76a9ac67b9c767ef39dbe3c4e9427756","name":"Jilesh Patadiya","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/94d41936196a27a133819bab474a9b7ab76c4034cad001b4499db6bc5e47a2af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/94d41936196a27a133819bab474a9b7ab76c4034cad001b4499db6bc5e47a2af?s=96&d=mm&r=g","caption":"Jilesh Patadiya"},"description":"Jilesh Patadiya, the visionary Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.","sameAs":["https:\/\/accuweb.cloud\/blog","https:\/\/www.facebook.com\/accuwebhosting","https:\/\/www.instagram.com\/accuwebhosting\/","https:\/\/www.linkedin.com\/company\/accuwebhosting\/","https:\/\/x.com\/accuwebhosting","https:\/\/www.youtube.com\/c\/Accuwebhosting"],"url":"https:\/\/accuweb.cloud\/blog\/author\/accuwebadmin\/"}]}},"modified_by":"Jilesh Patadiya","_links":{"self":[{"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/posts\/38398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/comments?post=38398"}],"version-history":[{"count":44,"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/posts\/38398\/revisions"}],"predecessor-version":[{"id":42910,"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/posts\/38398\/revisions\/42910"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/media\/42059"}],"wp:attachment":[{"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/media?parent=38398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/categories?post=38398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/accuweb.cloud\/blog\/wp-json\/wp\/v2\/tags?post=38398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}