DEV Community

Cover image for Install LAMP Stack on System KALI Linux Version 2022.2
abdalshafiealmajdoup
abdalshafiealmajdoup

Posted on

Install LAMP Stack on System KALI Linux Version 2022.2

linux #software #kali_Linux

Install LAMP Stack on System KALI Linux Version 2022.2

A LAMP Stack is a set of open-source software that can be used to create websites and web applications.
LAMP is an acronym, and these stacks typically consist of:

  • Linux operating system.
  • Apache HTTP server.
  • MySQL relational database management system.
  • PHP programming language.
  • PhpMyAdmin

" note important " ==> { Install the LAMP stack on Kali Linux is different from Ubuntu } .

** Please Focus Step by step **

  1. Update System.
    sudo apt update && sudo apt full upgrade -y

  2. install php , mysql server ,apache2
    sudo apt -y install wget php php-cgi php-mysqli php-pear php-mbstring libapache2-mod-php php-common php-phpseclib php-mysql

  3. install phpMyAdmin last version
    wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
    tar xvf phpMyAdmin-5.0.4-all-languages.tar.gz

** now add commands configuration files **

  • sudo mv phpMyAdmin-*/ /usr/share/phpmyadmin
  • sudo mkdir -p /var/lib/phpmyadmin/tmp
  • sudo chown -R www-data:www-data /var/lib/phpmyadmin
  • sudo mkdir /etc/phpmyadmin/
  • sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
  • sudo nano /usr/share/phpmyadmin/config.inc.php
  • $cfg['blowfish_secret'] = 'H2TxcGXxflSd8JwrXVlh6KW4s2rER63i';
  • $cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';
  • sudo nano /etc/apache2/conf-enabled/phpmyadmin.conf

  • add commands in file

Alias /phpmyadmin /usr/share/phpmyadmin

Options SymLinksIfOwnerMatch
DirectoryIndex index.php


AddType application/x-httpd-php .php


SetHandler application/x-httpd-php

php_value include_path .
php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
php_admin_value mbstring.func_overload 0



AddType application/x-httpd-php .php


SetHandler application/x-httpd-php

php_value include_path .
php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
php_admin_value mbstring.func_overload 0

Authorize for setup




AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup

Require valid-user

Disallow web access to directories that don't need it


Require all denied


Require all denied


Require all denied

  • sudo systemctl restart apache2
  • systemctl status apache2
  • sudo mysql -u root
  • systemctl restart mysql
  • CREATE USER 'admin'@'%' IDENTIFIED BY 'admin4321';
  • GRANT ALL PRIVILEGES ON . TO 'admin'@'%' WITH GRANT OPTION;
  • CREATE DATABASE database_name ;
  • EXIT;
  • now login in PhpMyAdmin :
    http://localhost/phpmyadmin/index.php

                    ***** Done *****
    

Top comments (0)