{"id":16959,"date":"2023-11-03T07:45:07","date_gmt":"2023-11-03T07:45:07","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=16959"},"modified":"2023-11-03T07:50:47","modified_gmt":"2023-11-03T07:50:47","slug":"how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2023\/11\/03\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04\/","title":{"rendered":"How To Install Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu 22.04"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"357\" src=\"https:\/\/www.appservgrid.com\/paw92\/wp-content\/uploads\/2023\/11\/image-1.png\" alt=\"\" class=\"wp-image-16961\" srcset=\"https:\/\/www.appservgrid.com\/paw92\/wp-content\/uploads\/2023\/11\/image-1.png 750w, https:\/\/www.appservgrid.com\/paw92\/wp-content\/uploads\/2023\/11\/image-1-300x143.png 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"introduction\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#introduction\"><strong>Introduction<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#introduction\"><\/a><\/h3>\n\n\n\n<p>A \u201cLAMP\u201d stack is a group of open source software that is typically installed together in order to enable a server to host dynamic websites and web apps written in PHP. This term is an acronym which represents the&nbsp;<strong>L<\/strong>inux operating system with the&nbsp;<strong>A<\/strong>pache web server. The site data is stored in a&nbsp;<strong>M<\/strong>ySQL database, and dynamic content is processed by&nbsp;<strong>P<\/strong>HP.<\/p>\n\n\n\n<p>In this guide, you\u2019ll set up a LAMP stack on an Ubuntu 22.04 server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#prerequisites\"><strong>Prerequisites<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#prerequisites\"><\/a><\/h2>\n\n\n\n<p>In order to complete this tutorial, you will need to have an Ubuntu 22.04 server with a non-root&nbsp;<code>sudo<\/code>-enabled user account and a basic firewall. This can be configured using our&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/initial-server-setup-with-ubuntu-22-04\">initial server setup guide for Ubuntu 22.04<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1-installing-apache-and-updating-the-firewall\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-1-installing-apache-and-updating-the-firewall\"><strong>Step 1 \u2014 Installing Apache and Updating the Firewall<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-1-installing-apache-and-updating-the-firewall\"><\/a><\/h2>\n\n\n\n<p>The Apache web server is among the most popular web servers in the world. It\u2019s well documented, has an active community of users, and has been in wide use for much of the history of the web, which makes it a great choice for hosting a website.<\/p>\n\n\n\n<p>Start by updating the package manager cache. If this is the first time you\u2019re using&nbsp;<code>sudo<\/code>&nbsp;within this session, you\u2019ll be prompted to provide your user\u2019s password to confirm you have the right privileges to manage system packages with&nbsp;<code>apt<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n<\/code><\/pre>\n\n\n\n<p>Then, install Apache with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install apache2\n<\/code><\/pre>\n\n\n\n<p>You\u2019ll be prompted to confirm Apache\u2019s installation. Confirm by pressing&nbsp;<code>Y<\/code>, then&nbsp;<code>ENTER<\/code>.<\/p>\n\n\n\n<p>Once the installation is finished, you\u2019ll need to adjust your firewall settings to allow HTTP traffic. Ubuntu\u2019s default firewall configuration tool is called Uncomplicated Firewall (UFW). It has different application profiles that you can leverage. To list all currently available UFW application profiles, execute this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw app list\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>OutputAvailable applications:\n  <mark>Apache<\/mark>\n  <mark>Apache Full<\/mark>\n  <mark>Apache Secure<\/mark>\n  OpenSSH\n<\/code><\/pre>\n\n\n\n<p>Here\u2019s what each of these profiles mean:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Apache<\/strong>: This profile opens only port&nbsp;<code>80<\/code>&nbsp;(normal, unencrypted web traffic).<\/li>\n\n\n\n<li><strong>Apache Full<\/strong>: This profile opens both port&nbsp;<code>80<\/code>&nbsp;(normal, unencrypted web traffic) and port&nbsp;<code>443<\/code>&nbsp;(TLS\/SSL encrypted traffic).<\/li>\n\n\n\n<li><strong>Apache Secure<\/strong>: This profile opens only port&nbsp;<code>443<\/code>&nbsp;(TLS\/SSL encrypted traffic).<\/li>\n<\/ul>\n\n\n\n<p>For now, it\u2019s best to allow only connections on port&nbsp;<code>80<\/code>, since this is a fresh Apache installation and you don\u2019t yet have a TLS\/SSL certificate configured to allow for HTTPS traffic on your server.<\/p>\n\n\n\n<p>To only allow traffic on port&nbsp;<code>80<\/code>, use the&nbsp;<code>Apache<\/code>&nbsp;profile:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow in \"Apache\"\n<\/code><\/pre>\n\n\n\n<p>Verify the change with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw status\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>OutputStatus: active\n\nTo                         Action      From\n--                         ------      ----\nOpenSSH                    ALLOW       Anywhere                                \n<mark>Apache                     ALLOW       Anywhere<\/mark>                  \nOpenSSH (v6)               ALLOW       Anywhere (v6)                    \n<mark>Apache (v6)                ALLOW       Anywhere (v6)<\/mark>     \n\n<\/code><\/pre>\n\n\n\n<p>Traffic on port&nbsp;<code>80<\/code>&nbsp;is now allowed through the firewall.<\/p>\n\n\n\n<p>You can do a spot check right away to verify that everything went as planned by visiting your server\u2019s public IP address in your web browser (view the note under the next heading to find out what your public IP address is if you do not have this information already):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/<mark>your_server_ip<\/mark>\n<\/code><\/pre>\n\n\n\n<p>The default Ubuntu 22.04 Apache web page is there for informational and testing purposes. Below is an example of the Apache default web page:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/LampStack-2204-apache-landing\" alt=\"Ubuntu 22.04 Apache default web page with an overview of your default configuration settings\"\/><\/figure>\n\n\n\n<p>If you can view this page, your web server is correctly installed and accessible through your firewall.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-to-find-your-server-s-public-ip-address\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#how-to-find-your-server-s-public-ip-address\"><strong>How To Find your Server\u2019s Public IP Address<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#how-to-find-your-server-s-public-ip-address\"><\/a><\/h3>\n\n\n\n<p>If you do not know what your server\u2019s public IP address is, there are a number of ways to find it. Usually, this is the address you use to connect to your server through SSH.<\/p>\n\n\n\n<p>There are a few different ways to do this from the command line. First, you could use the&nbsp;<code>iproute2<\/code>&nbsp;tools to get your IP address by typing this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip addr show ens3 | grep inet | awk '{ print $2; }' | sed 's\/\\\/.*$\/\/'\n<\/code><\/pre>\n\n\n\n<p>This will give you two or three lines back. They are all correct addresses, but your computer may only be able to use one of them, so feel free to try each one.<\/p>\n\n\n\n<p>An alternative method is to use the&nbsp;<code>curl<\/code>&nbsp;utility to contact an outside party to tell you how it sees your server. This is done by asking a specific server what your IP address is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl http:\/\/icanhazip.com\n<\/code><\/pre>\n\n\n\n<p>Whichever method you choose, type in your IP address into your web browser to verify that your server is running.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-installing-mysql\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-2-installing-mysql\"><strong>Step 2 \u2014 Installing MySQL<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-2-installing-mysql\"><\/a><\/h2>\n\n\n\n<p>Now that you have a web server up and running, you need to install the database system to be able to store and manage data for your site. MySQL is a popular database management system used within PHP environments.<\/p>\n\n\n\n<p>Again, use&nbsp;<code>apt<\/code>&nbsp;to acquire and install this software:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install mysql-server\n<\/code><\/pre>\n\n\n\n<p>When prompted, confirm installation by typing&nbsp;<code>Y<\/code>, and then&nbsp;<code>ENTER<\/code>.<\/p>\n\n\n\n<p>When the installation is finished, it\u2019s recommended that you run a security script that comes pre-installed with MySQL. This script will remove some insecure default settings and lock down access to your database system.<\/p>\n\n\n\n<p><strong>Warning<\/strong>: As of July 2022, an error will occur when you run the&nbsp;<code>mysql_secure_installation<\/code>&nbsp;script without some further configuration. The reason is that this script will attempt to set a password for the installation\u2019s&nbsp;<strong>root<\/strong>&nbsp;MySQL account but, by default on Ubuntu installations, this account is not configured to connect using a password.<\/p>\n\n\n\n<p>Prior to July 2022, this script would silently fail after attempting to set the&nbsp;<strong>root<\/strong>&nbsp;account password and continue on with the rest of the prompts. However, as of this writing the script will return the following error after you enter and confirm a password:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output ... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.\n\nNew password:\n<\/code><\/pre>\n\n\n\n<p>This will lead the script into a recursive loop which you can only get out of by closing your terminal window.<\/p>\n\n\n\n<p>Because the&nbsp;<code>mysql_secure_installation<\/code>&nbsp;script performs a number of other actions that are useful for keeping your MySQL installation secure, it\u2019s still recommended that you run it before you begin using MySQL to manage your data. To avoid entering this recursive loop, though, you\u2019ll need to first adjust how your&nbsp;<strong>root<\/strong>&nbsp;MySQL user authenticates.<\/p>\n\n\n\n<p>First, open up the MySQL prompt:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql\n<\/code><\/pre>\n\n\n\n<p>Then run the following&nbsp;<code>ALTER USER<\/code>&nbsp;command to change the&nbsp;<strong>root<\/strong>&nbsp;user\u2019s authentication method to one that uses a password. The following example changes the authentication method to&nbsp;<code>mysql_native_password<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<mark>password<\/mark>';\n<\/code><\/pre>\n\n\n\n<p>After making this change, exit the MySQL prompt:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit\n<\/code><\/pre>\n\n\n\n<p>Following that, you can run the&nbsp;<code>mysql_secure_installation<\/code>&nbsp;script without issue.<\/p>\n\n\n\n<p>Start the interactive script by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation\n<\/code><\/pre>\n\n\n\n<p>This will ask if you want to configure the&nbsp;<code>VALIDATE PASSWORD PLUGIN<\/code>.<\/p>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;Enabling this feature is something of a judgment call. If enabled, passwords which don\u2019t match the specified criteria will be rejected by MySQL with an error. It is safe to leave validation disabled, but you should always use strong, unique passwords for database credentials.<\/p>\n\n\n\n<p>Answer&nbsp;<code>Y<\/code>&nbsp;for yes, or anything else to continue without enabling.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>VALIDATE PASSWORD PLUGIN can be used to test passwords\nand improve security. It checks the strength of password\nand allows the users to set only those passwords which are\nsecure enough. Would you like to setup VALIDATE PASSWORD plugin?\n\nPress y|Y for Yes, any other key for No:\n<\/code><\/pre>\n\n\n\n<p>If you answer \u201cyes\u201d, you\u2019ll be asked to select a level of password validation. Keep in mind that if you enter&nbsp;<code>2<\/code>&nbsp;for the strongest level, you will receive errors when attempting to set any password which does not contain numbers, upper and lowercase letters, and special characters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>There are three levels of password validation policy:\n\nLOW    Length &gt;= 8\nMEDIUM Length &gt;= 8, numeric, mixed case, and special characters\nSTRONG Length &gt;= 8, numeric, mixed case, special characters and dictionary              file\n\nPlease enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: <mark>1<\/mark>\n<\/code><\/pre>\n\n\n\n<p>Regardless of whether you chose to set up the&nbsp;<code>VALIDATE PASSWORD PLUGIN<\/code>, your server will next ask you to select and confirm a password for the MySQL&nbsp;<strong>root<\/strong>&nbsp;user. This is not to be confused with the&nbsp;<strong>system root<\/strong>. The&nbsp;<strong>database root<\/strong>&nbsp;user is an administrative user with full privileges over the database system. Even though the default authentication method for the MySQL root user doesn\u2019t involve using a password,&nbsp;<strong>even when one is set<\/strong>, you should define a strong password here as an additional safety measure.<\/p>\n\n\n\n<p>If you enabled password validation, you\u2019ll be shown the password strength for the root password you just entered and your server will ask if you want to continue with that password. If you are happy with your current password, enter&nbsp;<code>Y<\/code>&nbsp;for \u201cyes\u201d at the prompt:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Estimated strength of the password: <mark>100<\/mark> \nDo you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : <mark>y<\/mark>\n<\/code><\/pre>\n\n\n\n<p>For the rest of the questions, press&nbsp;<code>Y<\/code>&nbsp;and hit the&nbsp;<code>ENTER<\/code>&nbsp;key at each prompt. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MySQL immediately respects the changes you have made.<\/p>\n\n\n\n<p>When you\u2019re finished, test whether you\u2019re able to log in to the MySQL console by typing:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql\n<\/code><\/pre>\n\n\n\n<p>This will connect to the MySQL server as the administrative database user&nbsp;<strong>root<\/strong>, which is inferred by the use of&nbsp;<code>sudo<\/code>&nbsp;when running this command. Below is an example output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>OutputWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 10\nServer version: 8.0.28-0ubuntu4 (Ubuntu)\n\nCopyright (c) 2000, 2022, Oracle and\/or its affiliates.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql&gt; \n<\/code><\/pre>\n\n\n\n<p>To exit the MySQL console, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit\n<\/code><\/pre>\n\n\n\n<p>Notice that you didn\u2019t need to provide a password to connect as the&nbsp;<strong>root<\/strong>&nbsp;user, even though you have defined one when running the&nbsp;<code>mysql_secure_installation<\/code>&nbsp;script. That is because the default authentication method for the administrative MySQL user is&nbsp;<code>unix_socket<\/code>&nbsp;instead of&nbsp;<code>password<\/code>. Even though this might seem like a security concern, it makes the database server more secure because the only users allowed to log in as the&nbsp;<strong>root<\/strong>&nbsp;MySQL user are the system users with sudo privileges connecting from the console or through an application running with the same privileges. In practical terms, that means you won\u2019t be able to use the administrative database&nbsp;<strong>root<\/strong>&nbsp;user to connect from your PHP application. Setting a password for the&nbsp;<strong>root<\/strong>&nbsp;MySQL account works as a safeguard, in case the default authentication method is changed from&nbsp;<code>unix_socket<\/code>&nbsp;to&nbsp;<code>password<\/code>.<\/p>\n\n\n\n<p>For increased security, it\u2019s best to have dedicated user accounts with less expansive privileges set up for every database, especially if you plan on having multiple databases hosted on your server.<\/p>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;There are some older versions of PHP that&nbsp;<a href=\"https:\/\/www.php.net\/manual\/en\/ref.pdo-mysql.php\">doesn\u2019t support<\/a>&nbsp;<code>caching_sha2_password<\/code>, the default authentication method for MySQL 8. For that reason, when creating database users for PHP applications on MySQL 8, you may need to configure your application to use the&nbsp;<code>mysql_native_password<\/code>&nbsp;plug-in instead. This tutorial will demonstrate how to do that in&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-6-%E2%80%94-testing-database-connection-from-php-(optional)\">Step 6<\/a>.<\/p>\n\n\n\n<p>Your MySQL server is now installed and secured. Next, you\u2019ll install PHP, the final component in the LAMP stack.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3-installing-php\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-3-installing-php\"><strong>Step 3 \u2014 Installing PHP<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-3-installing-php\"><\/a><\/h2>\n\n\n\n<p>You have Apache installed to serve your content and MySQL installed to store and manage your data. PHP is the component of our setup that will process code to display dynamic content to the final user. In addition to the&nbsp;<code>php<\/code>&nbsp;package, you\u2019ll need&nbsp;<code>php-mysql<\/code>, a PHP module that allows PHP to communicate with MySQL-based databases. You\u2019ll also need&nbsp;<code>libapache2-mod-php<\/code>&nbsp;to enable Apache to handle PHP files. Core PHP packages will automatically be installed as dependencies.<\/p>\n\n\n\n<p>To install these packages, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install php libapache2-mod-php php-mysql\n<\/code><\/pre>\n\n\n\n<p>Once the installation is finished, run the following command to confirm your PHP version:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -v\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>OutputPHP 8.1.2 (cli) (built: Mar  4 2022 18:13:46) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.1.2, Copyright (c) Zend Technologies\n    with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies\n<\/code><\/pre>\n\n\n\n<p>At this point, your LAMP stack is fully operational, but before testing your setup with a PHP script, it\u2019s best to set up a proper&nbsp;<a href=\"https:\/\/httpd.apache.org\/docs\/current\/vhosts\/\">Apache Virtual Host<\/a>&nbsp;to hold your website\u2019s files and folders.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-4-creating-a-virtual-host-for-your-website\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-4-creating-a-virtual-host-for-your-website\"><strong>Step 4 \u2014 Creating a Virtual Host for your Website<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-4-creating-a-virtual-host-for-your-website\"><\/a><\/h2>\n\n\n\n<p>When using the Apache web server, you can create&nbsp;<em>virtual hosts<\/em>&nbsp;(similar to server blocks in Nginx) to encapsulate configuration details and host more than one domain from a single server. In this guide, we\u2019ll set up a domain called&nbsp;<strong>your_domain<\/strong>, but you should&nbsp;<strong>replace this with your own domain name<\/strong>.<\/p>\n\n\n\n<p><strong>Note<\/strong>: In case you are using DigitalOcean as DNS hosting provider, check out our&nbsp;<a href=\"https:\/\/www.digitalocean.com\/docs\/networking\/dns\/how-to\/manage-records\/#a-records\">product documentation<\/a>&nbsp;for detailed instructions on how to set up a new domain name and point it to your server.<\/p>\n\n\n\n<p>Apache on Ubuntu 22.04 has one virtual host enabled by default that is configured to serve documents from the&nbsp;<code>\/var\/www\/html<\/code>&nbsp;directory. While this works well for a single site, it can become unwieldy if you are hosting multiple sites. Instead of modifying&nbsp;<code>\/var\/www\/html<\/code>, we\u2019ll create a directory structure within&nbsp;<code>\/var\/www<\/code>&nbsp;for the&nbsp;<strong>your_domain<\/strong>&nbsp;site, leaving&nbsp;<code>\/var\/www\/html<\/code>&nbsp;in place as the default directory to be served if a client request doesn\u2019t match any other sites.<\/p>\n\n\n\n<p>Create the directory for&nbsp;<strong>your_domain<\/strong>&nbsp;as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir \/var\/www\/<mark>your_domain<\/mark>\n<\/code><\/pre>\n\n\n\n<p>Next, assign ownership of the directory with the&nbsp;<code>$USER<\/code>&nbsp;environment variable, which will reference your current system user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown -R $USER:$USER \/var\/www\/<mark>your_domain<\/mark>\n<\/code><\/pre>\n\n\n\n<p>Then, open a new configuration file in Apache\u2019s&nbsp;<code>sites-available<\/code>&nbsp;directory using your preferred command-line editor. Here, we\u2019ll use&nbsp;<code>nano<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/sites-available\/<mark>your_domain<\/mark>.conf\n<\/code><\/pre>\n\n\n\n<p>This will create a new blank file. Add in the following bare-bones configuration with your own domain name:<\/p>\n\n\n\n<p>\/etc\/apache2\/sites-available\/your_domain.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;VirtualHost *:80&gt;\n    ServerName <mark>your_domain<\/mark>\n    ServerAlias www.<mark>your_domain<\/mark> \n    ServerAdmin webmaster@localhost\n    DocumentRoot \/var\/www\/<mark>your_domain<\/mark>\n    ErrorLog ${APACHE_LOG_DIR}\/error.log\n    CustomLog ${APACHE_LOG_DIR}\/access.log combined\n&lt;\/VirtualHost&gt;\n<\/code><\/pre>\n\n\n\n<p>Save and close the file when you\u2019re done. If you\u2019re using&nbsp;<code>nano<\/code>, do that by pressing&nbsp;<code>CTRL+X<\/code>, then&nbsp;<code>Y<\/code>&nbsp;and&nbsp;<code>ENTER<\/code>.<\/p>\n\n\n\n<p>With this&nbsp;<code>VirtualHost<\/code>&nbsp;configuration, we\u2019re telling Apache to serve&nbsp;<code><mark>your_domain<\/mark><\/code>&nbsp;using&nbsp;<code>\/var\/www\/<mark>your_domain<\/mark><\/code>&nbsp;as the web root directory. If you\u2019d like to test Apache without a domain name, you can remove or comment out the options&nbsp;<code>ServerName<\/code>&nbsp;and&nbsp;<code>ServerAlias<\/code>&nbsp;by adding a pound sign (<code>#<\/code>) the beginning of each option\u2019s lines.<\/p>\n\n\n\n<p>Now, use&nbsp;<code>a2ensite<\/code>&nbsp;to enable the new virtual host:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2ensite <mark>your_domain<\/mark>\n<\/code><\/pre>\n\n\n\n<p>You might want to disable the default website that comes installed with Apache. This is required if you\u2019re not using a custom domain name, because in this case Apache\u2019s default configuration would override your virtual host. To disable Apache\u2019s default website, type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2dissite 000-default\n<\/code><\/pre>\n\n\n\n<p>To make sure your configuration file doesn\u2019t contain syntax errors, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apache2ctl configtest\n<\/code><\/pre>\n\n\n\n<p>Finally, reload Apache so these changes take effect:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload apache2\n<\/code><\/pre>\n\n\n\n<p>Your new website is now active, but the web root&nbsp;<code>\/var\/www\/<mark>your_domain<\/mark><\/code>&nbsp;is still empty. Create an&nbsp;<code>index.html<\/code>&nbsp;file in that location to test that the virtual host works as expected:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/var\/www\/<mark>your_domain<\/mark>\/index.html\n<\/code><\/pre>\n\n\n\n<p>Include the following content in this file:<\/p>\n\n\n\n<p>\/var\/www\/your_domain\/index.html<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;<mark>your_domain<\/mark> website&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;h1&gt;Hello World!&lt;\/h1&gt;\n\n    &lt;p&gt;This is the landing page of &lt;strong&gt;<mark>your_domain<\/mark>&lt;\/strong&gt;.&lt;\/p&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n\n\n\n<p>Save and close the file, then go to your browser and access your server\u2019s domain name or IP address:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/<mark>server_domain_or_IP<\/mark>\n<\/code><\/pre>\n\n\n\n<p>Your web page should reflect the contents in the file you just edited:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/lemp_ubuntu2004\/landing_page.png\" alt=\"Apache virtual host test landing page that reveals your HTML code to the user\"\/><\/figure>\n\n\n\n<p>You can leave this file in place as a temporary landing page for your application until you set up an&nbsp;<code>index.php<\/code>&nbsp;file to replace it. Once you do that, remember to remove or rename the&nbsp;<code>index.html<\/code>&nbsp;file from your document root, as it would take precedence over an&nbsp;<code>index.php<\/code>&nbsp;file by default.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a-note-about-directoryindex-on-apache\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#a-note-about-directoryindex-on-apache\"><strong>A Note About&nbsp;<code>DirectoryIndex<\/code>&nbsp;on Apache<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#a-note-about-directoryindex-on-apache\"><\/a><\/h3>\n\n\n\n<p>With the default&nbsp;<code>DirectoryIndex<\/code>&nbsp;settings on Apache, a file named&nbsp;<code>index.html<\/code>&nbsp;will always take precedence over an&nbsp;<code>index.php<\/code>&nbsp;file. This is useful for setting up maintenance pages in PHP applications, by creating a temporary&nbsp;<code>index.html<\/code>&nbsp;file containing an informative message to visitors. Because this page will take precedence over the&nbsp;<code>index.php<\/code>&nbsp;page, it will then become the landing page for the application. Once maintenance is over, the&nbsp;<code>index.html<\/code>&nbsp;is renamed or removed from the document root, bringing back the regular application page.<\/p>\n\n\n\n<p>In case you want to change this behavior, you\u2019ll need to edit the&nbsp;<code>\/etc\/apache2\/mods-enabled\/dir.conf<\/code>&nbsp;file and modify the order in which the&nbsp;<code>index.php<\/code>&nbsp;file is listed within the&nbsp;<code>DirectoryIndex<\/code>&nbsp;directive:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/mods-enabled\/dir.conf\n<\/code><\/pre>\n\n\n\n<p>\/etc\/apache2\/mods-enabled\/dir.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;IfModule mod_dir.c&gt;\n        DirectoryIndex <mark>index.php<\/mark> index.html index.cgi index.pl index.xhtml index.htm\n&lt;\/IfModule&gt;\n<\/code><\/pre>\n\n\n\n<p>After saving and closing the file, you\u2019ll need to reload Apache so the changes take effect:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload apache2\n<\/code><\/pre>\n\n\n\n<p>In the next step, we\u2019ll create a PHP script to test that PHP is correctly installed and configured on your server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-5-testing-php-processing-on-your-web-server\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-5-testing-php-processing-on-your-web-server\"><strong>Step 5 \u2014 Testing PHP Processing on your Web Server<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-5-testing-php-processing-on-your-web-server\"><\/a><\/h2>\n\n\n\n<p>Now that you have a custom location to host your website\u2019s files and folders, create a PHP test script to confirm that Apache is able to handle and process requests for PHP files.<\/p>\n\n\n\n<p>Create a new file named&nbsp;<code>info.php<\/code>&nbsp;inside your custom web root folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/var\/www\/<mark>your_domain<\/mark>\/info.php\n<\/code><\/pre>\n\n\n\n<p>This will open a blank file. Add the following text, which is valid PHP code, inside the file:<\/p>\n\n\n\n<p>\/var\/www\/your_domain\/info.php<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&lt;?php<\/strong>\nphpinfo();\n<\/code><\/pre>\n\n\n\n<p>When you are finished, save and close the file.<\/p>\n\n\n\n<p>To test this script, go to your web browser and access your server\u2019s domain name or IP address, followed by the script name, which in this case is&nbsp;<code>info.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/<mark>server_domain_or_IP<\/mark>\/info.php\n<\/code><\/pre>\n\n\n\n<p>Here is an example of the default PHP web page:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/LampStack-2204-php-landing\" alt=\"Ubuntu 22.04 PHP web page revealing pertinent information about the current PHP version and settings\"\/><\/figure>\n\n\n\n<p>This page provides information about your server from the perspective of PHP. It is useful for debugging and to ensure that your settings are being applied correctly.<\/p>\n\n\n\n<p>If you see this page in your browser, then your PHP installation is working as expected.<\/p>\n\n\n\n<p>After checking the relevant information about your PHP server through that page, it\u2019s best to remove the file you created as it contains sensitive information about your PHP environment and your Ubuntu server. Use&nbsp;<code>rm<\/code>&nbsp;to do so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo rm \/var\/www\/<mark>your_domain<\/mark>\/info.php\n<\/code><\/pre>\n\n\n\n<p>You can always recreate this page if you need to access the information again later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-6-testing-database-connection-from-php-optional\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-6-testing-database-connection-from-php-optional\"><strong>Step 6 \u2014 Testing Database Connection from PHP (Optional)<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#step-6-testing-database-connection-from-php-optional\"><\/a><\/h2>\n\n\n\n<p>If you want to test whether PHP is able to connect to MySQL and execute database queries, you can create a test table with test data and query for its contents from a PHP script. Before you do that, you need to create a test database and a new MySQL user properly configured to access it.<\/p>\n\n\n\n<p>Create a database named&nbsp;<strong>example_database<\/strong>&nbsp;and a user named&nbsp;<strong>example_user<\/strong>. You can replace these names with different values.<\/p>\n\n\n\n<p>First, connect to the MySQL console using the&nbsp;<strong>root<\/strong>&nbsp;account:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql\n<\/code><\/pre>\n\n\n\n<p>To create a new database, run the following command from your MySQL console:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE <mark>example_database<\/mark>;\n<\/code><\/pre>\n\n\n\n<p>Now create a new user and grant them full privileges on the custom database you\u2019ve just created.<\/p>\n\n\n\n<p>The following command creates a new user named&nbsp;<code><mark>example_user<\/mark><\/code>&nbsp;that authenticates with the&nbsp;<code>caching_sha2_password<\/code>&nbsp;method. We\u2019re defining this user\u2019s password as&nbsp;<code><mark>password<\/mark><\/code>, but you should replace this value with a secure password of your own choosing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE USER '<mark>example_user<\/mark>'@'%' IDENTIFIED BY '<mark>password<\/mark>';\n<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: The previous&nbsp;<code>ALTER USER<\/code>&nbsp;statement sets the&nbsp;<strong>root<\/strong>&nbsp;MySQL user to authenticate with the&nbsp;<code>caching_sha2_password<\/code>&nbsp;plugin.&nbsp;<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/upgrading-from-previous-series.html#upgrade-caching-sha2-password\">Per the official MySQL documentation<\/a>,&nbsp;<code>caching_sha2_password<\/code>&nbsp;is MySQL\u2019s preferred authentication plugin, as it provides more secure password encryption than the older, but still widely used,&nbsp;<code>mysql_native_password<\/code>.<\/p>\n\n\n\n<p>However, some versions of PHP don\u2019t work reliably with&nbsp;<code>caching_sha2_password<\/code>.&nbsp;<a href=\"https:\/\/php.watch\/articles\/PHP-7.4-MySQL-8-server-gone-away-fix\">PHP has reported that this issue was fixed as of PHP 7.4<\/a>, but if you encounter an error when trying to log in to phpMyAdmin later on, you may want to set&nbsp;<strong>root<\/strong>&nbsp;to authenticate with&nbsp;<code>mysql_native_password<\/code>&nbsp;instead:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<mark>password<\/mark>';<\/code><\/pre>\n\n\n\n<p>Now give this user permission over the&nbsp;<code>example_database<\/code>&nbsp;database:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GRANT ALL ON <mark>example_database<\/mark>.* TO '<mark>example_user<\/mark>'@'%';\n<\/code><\/pre>\n\n\n\n<p>This will give the&nbsp;<strong>example_user<\/strong>&nbsp;user full privileges over the&nbsp;<strong>example_database<\/strong>&nbsp;database, while preventing this user from creating or modifying other databases on your server.<\/p>\n\n\n\n<p>Now exit the MySQL shell with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit\n<\/code><\/pre>\n\n\n\n<p>Test if the new user has the proper permissions by logging in to the MySQL console again, this time using the custom user credentials:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u <mark>example_user<\/mark> -p\n<\/code><\/pre>\n\n\n\n<p>Notice the&nbsp;<code>-p<\/code>&nbsp;flag in this command, which will prompt you for the password used when creating the&nbsp;<strong>example_user<\/strong>&nbsp;user. After logging in to the MySQL console, confirm that you have access to the&nbsp;<strong>example_database<\/strong>&nbsp;database:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SHOW DATABASES;\n<\/code><\/pre>\n\n\n\n<p>This will give you the following output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output+--------------------+\n| Database           |\n+--------------------+\n| <mark>example_database<\/mark>   |\n| information_schema |\n+--------------------+\n2 rows in set (0.000 sec)\n<\/code><\/pre>\n\n\n\n<p>Next, create a test table named&nbsp;<strong>todo_list<\/strong>. From the MySQL console, run the following statement:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE <mark>example_database<\/mark>.<mark>todo_list<\/mark> (\n\titem_id INT AUTO_INCREMENT,\n\tcontent VARCHAR(255),\n\tPRIMARY KEY(item_id)\n);\n<\/code><\/pre>\n\n\n\n<p>Insert a few rows of content in the test table. Repeat the next command a few times, using different values, to populate your test table:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>INSERT INTO <mark>example_database<\/mark>.<mark>todo_list<\/mark> (content) VALUES (\"<mark>My first important item<\/mark>\");\n<\/code><\/pre>\n\n\n\n<p>To confirm that the data was successfully saved to your table, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM <mark>example_database<\/mark>.<mark>todo_list<\/mark>;\n<\/code><\/pre>\n\n\n\n<p>The following is the output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output+---------+--------------------------+\n| item_id | content                  |\n+---------+--------------------------+\n|       1 | My first important item  |\n|       2 | My second important item |\n|       3 | My third important item  |\n|       4 | and this one more thing  |\n+---------+--------------------------+\n4 rows in set (0.000 sec)\n\n<\/code><\/pre>\n\n\n\n<p>After confirming that you have valid data in your test table, exit the MySQL console:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit\n<\/code><\/pre>\n\n\n\n<p>Now you can create the PHP script that will connect to MySQL and query for your content. Create a new PHP file in your custom web root directory using your preferred editor:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nano \/var\/www\/<mark>your_domain<\/mark>\/<mark>todo_list.php<\/mark>\n<\/code><\/pre>\n\n\n\n<p>The following PHP script connects to the MySQL database and queries for the content of the&nbsp;<strong>todo_list<\/strong>&nbsp;table, exhibiting the results in a list. If there\u2019s a problem with the database connection, it will throw an exception.<\/p>\n\n\n\n<p>Add this content into your&nbsp;<code>todo_list.php<\/code>&nbsp;script, remembering to replace the&nbsp;<code><mark>example_user<\/mark><\/code>&nbsp;and&nbsp;<code><mark>password<\/mark><\/code>&nbsp;with your own:<\/p>\n\n\n\n<p>\/var\/www\/your_domain\/todo_list.php<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>&lt;?php<\/strong>\n$user = \"<mark>example_user<\/mark>\";\n$password = \"<mark>password<\/mark>\";\n$database = \"<mark>example_database<\/mark>\";\n$table = \"<mark>todo_list<\/mark>\";\n\ntry {\n  $db = new PDO(\"mysql:host=localhost;dbname=$database\", $user, $password);\n  echo \"&lt;h2&gt;TODO&lt;\/h2&gt;&lt;ol&gt;\"; \n  foreach($db-&gt;query(\"SELECT content FROM $table\") as $row) {\n    echo \"&lt;li&gt;\" . $row&#91;'content'] . \"&lt;\/li&gt;\";\n  }\n  echo \"&lt;\/ol&gt;\";\n} catch (PDOException $e) {\n    print \"Error!: \" . $e-&gt;getMessage() . \"&lt;br\/&gt;\";\n    die();\n}\n<\/code><\/pre>\n\n\n\n<p>Save and close the file when you\u2019re done editing.<\/p>\n\n\n\n<p>You can now access this page in your web browser by visiting the domain name or public IP address configured for your website, followed by&nbsp;<code>\/todo_list.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:\/\/<mark>your_domain_or_IP<\/mark>\/todo_list.php\n<\/code><\/pre>\n\n\n\n<p>This web page should reveal the content you\u2019ve inserted in your test table to your visitor:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/assets.digitalocean.com\/articles\/lemp_debian10\/todo_list.png\" alt=\"Example PHP todo list web page in the browser\"\/><\/figure>\n\n\n\n<p>That means your PHP environment is ready to connect and interact with your MySQL server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#conclusion\"><strong>Conclusion<\/strong><\/a><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04#conclusion\"><\/a><\/h2>\n\n\n\n<p>In this guide, you\u2019ve built a flexible foundation for serving PHP websites and applications to your visitors, using Apache as a web server and MySQL as a database system.<\/p>\n\n\n\n<p>As an immediate next step, you should ensure that connections to your web server are secured, by serving them via HTTPS. In order to accomplish that, you can use&nbsp;<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-22-04\">Let\u2019s Encrypt<\/a>&nbsp;to secure your site with a free TLS\/SSL certificate.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction A \u201cLAMP\u201d stack is a group of open source software that is typically installed together in order to enable a server to host dynamic websites and web apps written in PHP. This term is an acronym which represents the&nbsp;Linux operating system with the&nbsp;Apache web server. The site data is stored in a&nbsp;MySQL database, and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2023\/11\/03\/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How To Install Linux, Apache, MySQL, PHP (LAMP) Stack on Ubuntu 22.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16959","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/16959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=16959"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/16959\/revisions"}],"predecessor-version":[{"id":16963,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/16959\/revisions\/16963"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=16959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=16959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=16959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}