{"id":1123,"date":"2023-06-08T07:10:40","date_gmt":"2023-06-08T07:10:40","guid":{"rendered":"https:\/\/www.dedicatedcore.com\/blog\/?p=1123"},"modified":"2024-10-23T08:14:21","modified_gmt":"2024-10-23T08:14:21","slug":"install-lamp-stack-almalinux","status":"publish","type":"post","link":"https:\/\/www.dedicatedcore.com\/blog\/install-lamp-stack-almalinux\/","title":{"rendered":"How to Install LAMP Stack on AlmaLinux"},"content":{"rendered":"<p>A basic stage in hosting websites and web applications is setting up a LAMP (Linux, Apache, MySQL, PHP) stack. The stable and open-source Linux distro AlmaLinux is a great option for this. We&#8217;ll walk you through setting up a LAMP stack on AlmaLinux in this blog. So your web server is operational, up and running. For those managing server needs in India, dedicated server solutions offer a practical and <a href=\"https:\/\/www.dedicatedcore.com\/dedicated-server-india\/\" target=\"_blank\" rel=\"noopener\">economical choice<\/a> for reliable performance.<\/p>\n<p>Open-source Linux OS AlmaLinux will take the role of CentOS. Which is about to approach End-of-Life (EOL) and will no longer get updates. Comparing AlmaLinux, and CentOS you&#8217;ll find that AlmaLinux is a direct substitute for CentOS. Having a simpler installation method and a longer lifespan. Explore options for top-tier VPS hosting with cPanel for 2024,\u00a0 with <a href=\"https:\/\/www.dedicatedcore.com\/cheap-cpanel-vps-hosting-license\/\" target=\"_blank\" rel=\"noopener\">safety standards<\/a> that provide a blend of powerful features and user-friendly management tools.<\/p>\n<p>The set of open-source server software used to handle static and dynamic websites is known by the name LAMP. If you have the right user permissions, you can follow this instruction to set up your server.<\/p>\n<p><iframe loading=\"lazy\" title=\"How To Install LAMP on Alma Linux, Cloud Linux and Rocky Linux | LAMP Installation | LAMP Stack\" width=\"719\" height=\"404\" src=\"https:\/\/www.youtube.com\/embed\/bq353jJ6eFA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p><strong>The LAMP Stands As:<\/strong><\/p>\n<p>L: is the operating system Linux.<br \/>\nA: The web server Apache.<br \/>\nM: The database management system (DBMS) is MariaDB or MySQL.<br \/>\nP: is the backend PHP coding language used in website development and maintenance.<\/p>\n<h2>Install Lamp Stack on AlmaLinux<\/h2>\n<p>Before installing the lamp stack if you want to understand in detail about LAMP that creates <a href=\"https:\/\/www.dedicatedcore.com\/blog\/lamp-stack-details\/\" target=\"_blank\" rel=\"noopener\">dynamic and robust<\/a> web applications, our detailed guide on the LAMP stack.<\/p>\n<h3>Step 1: Set up Apache.<\/h3>\n<p>Since the AppStream AlmaLinux repository contains all of the essential software, it is not necessary to implement a separate repository to deploy the LAMP Stack on AlmaLinux. Enter the following command in your terminal to open it and log in as the root user.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo su -<\/pre>\n<h3>Step 2: Install the Apache Web Server by using the Command below.<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dnf install -y httpd<\/pre>\n<h3>Step 3: After the Apache Installation is Finished, the httpd service needs to be Started and Enabled.<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">systemctl start httpd\r\n\r\nsystemctl enable httpd<\/pre>\n<p>You can verify that your Apache web server is installed and operating properly by looking up the HTTP service status and making sure it is listening on port 80 by default. To find out the current state of your HTTP service, run the following command.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">service httpd status<\/pre>\n<p>If everything is set up properly, your output should be like the sample below.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1126\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/start-httpd-service.png\" alt=\"command to start and enable httpd service\" width=\"800\" height=\"210\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/start-httpd-service.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/start-httpd-service-300x79.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/start-httpd-service-150x39.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/start-httpd-service-768x202.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/start-httpd-service-100x26.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/start-httpd-service-700x184.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h3>Step 4: Next, use these Commands to Enable HTTP and HTTPS Traffic over your Firewall.<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">firewall-cmd --permanent --zone=public --add-service=http\r\n\r\nfirewall-cmd --permanent --zone=public --add-service=https<\/pre>\n<p>Use the following command to restart your firewall so that the new firewall rules take effect.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">firewall-cmd --reload<\/pre>\n<p>Installing the Apache Web Server has gone well.<\/p>\n<h3>Set up MySQL.<\/h3>\n<p>The AppStream AlmaLinux repository will work for the MySQL installation. To swiftly install the MySQL database management system, use the following command.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dnf install -y mysql mysql-server<\/pre>\n<p>Once the installation is finished, type the following lines into your terminal to start and enable the mysqld service to run every time the system boots up.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">systemctl start mysqld\r\n\r\nsystemctl enable mysqld<\/pre>\n<p>It is advised that you take extra precautions to protect your server from malevolent users. Use the following command in your terminal to prevent frequent attacks on your MySQL database server.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mysql_secure_installation<\/pre>\n<p>Additional configuration steps will be offered to you; generate your DBMS password and then respond with y to all of the prompts. MySQL has been installed safely and successfully.<\/p>\n<p>Use the following command to log in.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mysql -u root -p<\/pre>\n<h2>Installing PHP 8.0 on AlmaLinux 8<\/h2>\n<p>At the time of posting, PHP 8.0 is the most recent version compatible with AlmaLinux. Use the following command to update the system packages and install PHP 8.0 on AlmaLinux.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dnf update<\/pre>\n<p>Next, look through the AppStream AlmaLinux repository&#8217;s PHP module versions that are available.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dnf module list php<\/pre>\n<p>The accessible PHP versions\u2014in this case, PHP 8.0\u2014are contained in the output. To enable the PHP 8.0 module, use the following command.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dnf module enable php:8.0<\/pre>\n<p>Lastly, run the following command to install PHP on your AlmaLinux system along with a few of the suggested extensions.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dnf install php php-fpm php-zip php-intl php-opcache php-gd php-mbstring php-gd php-xml php-mysqlnd<\/pre>\n<h3>Run an Installation Test<\/h3>\n<p>After the LAMP stack installation on AlmaLinux is complete. Verify that Apache, MySQL, and PHP are configured. The following commands can be used to determine whether the installation was successful. Success is defined by seeing if they return the appropriate versions.<\/p>\n<h4>Details For Apache<\/h4>\n<p>To find out the version of Apache, use this command.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">httpd -v<\/pre>\n<p>The version is displayed in the output example below.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1127\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/service-httpd-status-command.png\" alt=\"command to check status of http service\" width=\"800\" height=\"130\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/service-httpd-status-command.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/service-httpd-status-command-300x49.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/service-httpd-status-command-150x24.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/service-httpd-status-command-768x125.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/service-httpd-status-command-100x16.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/service-httpd-status-command-700x114.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h4>Details for PHP<\/h4>\n<p>The command to verify the PHP version is provided here.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">php -v<\/pre>\n<p>This is an example of the output.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1128\" src=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/httpd-v-command-apache-version.png\" alt=\"command shows the apache version\" width=\"800\" height=\"169\" srcset=\"https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/httpd-v-command-apache-version.png 800w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/httpd-v-command-apache-version-300x63.png 300w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/httpd-v-command-apache-version-150x32.png 150w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/httpd-v-command-apache-version-768x162.png 768w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/httpd-v-command-apache-version-100x21.png 100w, https:\/\/www.dedicatedcore.com\/blog\/wp-content\/uploads\/httpd-v-command-apache-version-700x148.png 700w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/strong><\/p>\n<h4>Details For SQL<\/h4>\n<p>The MySQL version can be verified by using the following command.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mysql --version<\/pre>\n<p>This is an example of an output.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">mysql Ver 8.0.30 for Linux on x86_64 (Source distribution)<\/pre>\n<p>If every command yields an output similar to the one shown above, your LAMP stack is correctly deployed and operational.<\/p>\n<h3>Final Thought on Install LAMP Stack on AlmaLinux<\/h3>\n<p>You are now prepared to launch and host websites and web applications. With Apache handling your web content. MySQL handles your databases, and PHP drives your dynamic web applications. With this adaptable configuration, you can investigate the realm of web development on a reliable and safe platform.<\/p>\n<p>This process of installing the LAMP stack on AlmaLinux with this detailed tutorial. Install Apache Web Server, MySQL client and software, and PHP version 8.0 by following this method. Installing and configuring LsyncD or setting up an FTP server. Accounts are further factors to take into mind. Looking for the tools to <a href=\"https:\/\/www.dedicatedcore.com\/blog\/install-whm-cpanel-almalinux\/\" target=\"_blank\" rel=\"noopener\">manage server settings<\/a>, and performance? Installing WebHost Manager (WHM) will help as cPanel allows DNS settings from a single dashboard.<\/p>\n<p>For your website hosting requirements, DedicatedCore provides VPS Hosting. Also provides Cloud Dedicated Servers and Dedicated Servers. Being able to install the LAMP stack on AlmaLinux puts you ahead of the game when it comes to website hosting.<\/p>\n<h3>Frequently Asked Questions (FAQ)<\/h3>\n<p><strong>1. What is LAMP?<\/strong><\/p>\n<p>Linux, Apache, MySQL, and PHP are the four software components. For creating a web development environment LAMP is been used.<\/p>\n<p><strong>2. How can I verify LAMP Stack Installation?<\/strong><\/p>\n<p>You can verify the Lamp stack installation by running the Lamp stack script test.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A basic stage in hosting websites and web applications is setting up a LAMP (Linux, Apache, MySQL, PHP) stack. The stable and open-source Linux distro&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1154,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/1123"}],"collection":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/comments?post=1123"}],"version-history":[{"count":21,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/1123\/revisions"}],"predecessor-version":[{"id":2499,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/posts\/1123\/revisions\/2499"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media\/1154"}],"wp:attachment":[{"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/media?parent=1123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/categories?post=1123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dedicatedcore.com\/blog\/wp-json\/wp\/v2\/tags?post=1123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}