Setting Up LAMP (Linux, Apache, MariaDB and PHP) on Fedora 24 Server

Follow these instructions to install LAMP (Linux, Apache, MariaDB, and PHP) on a Fedora 24 server. LAMP stack provides a complete web development environment with Linux as the operating system, Apache as the web server, MariaDB as the database, and PHP for server-side scripting.

Prerequisites: Ensure you have a fresh Fedora 24 server installation with root or sudo access and an active internet connection.

Step 1: Update System

First, update your system packages to ensure you have the latest versions ?

sudo dnf update -y

Step 2: Install Apache Web Server

Install and configure Apache HTTP server ?

sudo dnf install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd

Configure firewall to allow HTTP traffic ?

sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --add-service=https --permanent
sudo firewall-cmd --reload

Step 3: Install MariaDB Database Server

Install MariaDB server and client packages ?

sudo dnf install mariadb-server mariadb -y
sudo systemctl start mariadb
sudo systemctl enable mariadb

Secure your MariaDB installation by setting a root password ?

sudo mysql_secure_installation

Step 4: Install PHP

Install PHP with necessary modules for web development ?

sudo dnf install php php-mysqlnd php-fpm php-opcache php-gd php-xml php-mbstring -y

Restart Apache to load PHP modules ?

sudo systemctl restart httpd

Step 5: Test LAMP Installation

Create a PHP info file to verify the installation ?

sudo vi /var/www/html/info.php

Add the following PHP code to test your setup ?

<?php
phpinfo();
?>

Now open your web browser and navigate to http://your_server_ip/info.php to see the PHP information page.

Configuration Summary

Component Service Name Configuration File Default Port
Apache httpd /etc/httpd/conf/httpd.conf 80, 443
MariaDB mariadb /etc/my.cnf 3306
PHP - /etc/php.ini -

Optional: Using Control Panels

For easier management, you can install web-based control panels like Webmin ?

# Download and install Webmin
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.910-1.noarch.rpm
sudo dnf install webmin-1.910-1.noarch.rpm -y

Conclusion

You now have a fully functional LAMP stack on Fedora 24 with Apache serving web pages, MariaDB managing databases, and PHP processing server-side scripts. This environment is ready to host dynamic websites and web applications. Remember to secure your installation with proper firewall rules and regular updates.

Updated on: 2026-03-15T10:39:56+05:30

437 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements