Dexter Evil Clone.

Alchemiclabs.ca


Welcome Demo

If you want to use MariaDB instead of MySQL in your LAMP stack on Debian, follow the steps below:

Step 1: Install Debian

  • Follow the same steps as mentioned earlier to install Debian on your server.

Step 2: Update the System

  • Update and upgrade the system as before:
    sudo apt update
    sudo apt upgrade

Step 3: Install Apache Web Server

  • Install Apache using the package manager:

    sudo apt install apache2
  • Start the Apache service and enable it to start on boot:

    sudo systemctl start apache2
    sudo systemctl enable apache2

Step 4: Install MariaDB Database Server

  • Install MariaDB server and client packages:

    sudo apt install mariadb-server mariadb-client
  • During the installation, you will be prompted to set the root password for MariaDB. Choose a strong password and remember it.

  • Start the MariaDB service and enable it to start on boot:

    sudo systemctl start mariadb
    sudo systemctl enable mariadb
  • Secure your MariaDB installation by running the security script:

    sudo mysql_secure_installation

Step 5: Install PHP

  • Install PHP and necessary modules:

    sudo apt install php libapache2-mod-php php-mysql
  • After installation, restart Apache for the PHP module to be loaded:

    sudo systemctl restart apache2

Step 6: Test PHP

  • Create a PHP info file to check if PHP is working correctly:

    echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/phpinfo.php
  • Open a web browser and access http://your_server_ip/phpinfo.php. You should see the PHP info page displaying various PHP configuration details.

Step 7: Configure Firewall (Optional)

  • If you have a firewall installed (e.g., UFW), open ports 80 (HTTP) and 443 (HTTPS) to allow web traffic:
    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
    sudo ufw enable

Step 8: Optional Steps

  • You may want to install additional PHP modules or other tools, depending on your specific requirements. Common modules include php-cli, php-gd, php-curl, etc.
  • If you plan to host multiple websites, consider setting up virtual hosts in Apache.

That's it! With these steps, you have now set up a LAMP server using Debian with MariaDB as the database server. You can proceed to deploy web applications or host websites on your server. Remember to keep your system and software up-to-date and maintain security best practices.