{"id":156,"date":"2024-05-25T19:32:15","date_gmt":"2024-05-26T01:32:15","guid":{"rendered":"https:\/\/www.7softinteractive.net\/?p=156"},"modified":"2024-05-27T00:20:30","modified_gmt":"2024-05-27T06:20:30","slug":"fedora-lamp-stack","status":"publish","type":"post","link":"https:\/\/www.7softinteractive.net\/?p=156","title":{"rendered":"Fedora Lamp Stack"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Title: How to Set Up a LAMP Stack on Fedora Linux<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Introduction<\/strong><\/p>\n\n\n\n<p>A LAMP stack (Linux, Apache, MySQL\/MariaDB, PHP) is a popular setup for web development. This guide will walk you through the steps to install and configure a LAMP stack on your Fedora Linux system.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step 1: Update Your System<\/strong><\/p>\n\n\n\n<p>Open a terminal and update your system packages to ensure you have the latest software versions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update -y\nsudo dnf upgrade -y<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step 2: Install Apache<\/strong><\/p>\n\n\n\n<p>Apache is the web server component of the LAMP stack. Install and start Apache with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y httpd\nsudo systemctl start httpd\nsudo systemctl enable httpd<\/code><\/pre>\n\n\n\n<p>Verify Apache is running by visiting <code>http:\/\/localhost<\/code> in your web browser. You should see the Apache test page.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step 3: Install MariaDB (MySQL)<\/strong><\/p>\n\n\n\n<p>MariaDB is a popular database server. Install and start MariaDB with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y mariadb-server\nsudo systemctl start mariadb\nsudo systemctl enable mariadb<\/code><\/pre>\n\n\n\n<p>Run the security script to secure your MariaDB installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>Follow the prompts to set the root password and secure your installation.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step 4: Install PHP<\/strong><\/p>\n\n\n\n<p>PHP is the server-side scripting language used to develop dynamic web content. Install PHP and necessary modules with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y php php-mysqlnd php-fpm\nsudo systemctl start php-fpm\nsudo systemctl enable php-fpm<\/code><\/pre>\n\n\n\n<p>Restart Apache to load the PHP module:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart httpd<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step 5: Configure Firewall<\/strong><\/p>\n\n\n\n<p>If you have a firewall enabled, allow HTTP and HTTPS traffic:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo firewall-cmd --permanent --add-service=http\nsudo firewall-cmd --permanent --add-service=https\nsudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step 6: Test PHP<\/strong><\/p>\n\n\n\n<p>Create a PHP info file to test your PHP configuration. Create the file in the web root directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"&lt;?php phpinfo(); ?&gt;\" | sudo tee \/var\/www\/html\/info.php<\/code><\/pre>\n\n\n\n<p>Visit <code>http:\/\/localhost\/info.php<\/code> in your web browser. You should see a PHP info page showing your PHP configuration.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Step 7: Secure Your LAMP Stack<\/strong><\/p>\n\n\n\n<p><strong>1. Configure Apache:<\/strong><\/p>\n\n\n\n<p>Edit the Apache configuration file to improve security:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre>\n\n\n\n<p>Add or modify the following settings:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ServerTokens Prod\nServerSignature Off\nTraceEnable Off<\/code><\/pre>\n\n\n\n<p><strong>2. Configure PHP:<\/strong><\/p>\n\n\n\n<p>Edit the PHP configuration file to enhance security:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/php.ini<\/code><\/pre>\n\n\n\n<p>Modify the following settings:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>expose_php = Off<\/code><\/pre>\n\n\n\n<p><strong>3. Restart Services:<\/strong><\/p>\n\n\n\n<p>Restart Apache and PHP-FPM to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart httpd\nsudo systemctl restart php-fpm<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Conclusion<\/strong><\/p>\n\n\n\n<p>Congratulations! You have successfully set up a LAMP stack on your Fedora Linux system. You can now start developing your web applications using Apache, MariaDB, and PHP. If you have any questions or run into issues, feel free to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Title: How to Set Up a LAMP Stack on Fedora Linux Introduction A LAMP stack (Linux, Apache, MySQL\/MariaDB, PHP) is a popular setup for web development. This guide will walk you through the steps to install and configure a LAMP stack on your Fedora Linux system. Step 1: Update Your System Open a terminal and<\/p>\n","protected":false},"author":2,"featured_media":144,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,3],"tags":[],"class_list":["post-156","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development-environment","category-linux"],"_links":{"self":[{"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=156"}],"version-history":[{"count":2,"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":173,"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions\/173"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=\/wp\/v2\/media\/144"}],"wp:attachment":[{"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.7softinteractive.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}