How to install LAMP Stack on Parrot 3.9

To install LAMP Stack on Parrot 3.9

LAMP stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP. It is really simple to install the LAMP stack on Parrot OS and this article covers the ground on the same process. 

 

Installing LAMP Stack 

Since Parrot OS is a Linux distro, you shall proceed by installing Apache, MariaDB and PHP by running the following command.

[root@parrot][/home/user/Desktop]
#apt-get install apache2 mariadb-server php7.0 php7.0-cli php7.0-fpm php7.0-mbstring php7.0-mysql php7.0-gd php7.0-mcrypt 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
apache2 is already the newest version (2.4.29-1).
apache2 set to manually installed.
The following additional packages will be installed:
  libconfig-inifiles-perl mariadb-client-10.1 mariadb-client-core-10.1
  mariadb-common mariadb-server-10.1 mariadb-server-core-10.1
Suggested packages:
  netcat-openbsd tinyca
The following NEW packages will be installed:
  libconfig-inifiles-perl mariadb-server
The following packages will be upgraded:
  mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common
  mariadb-server-10.1 mariadb-server-core-10.1 php
6 upgraded, 2 newly installed, 0 to remove and 686 not upgraded.

.
.
.
.
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
mariadb.service is a disabled or a static unit, not starting it.
Setting up mariadb-server (1:10.1.29-6) ...
Processing triggers for menu (2.1.47+b1) ...
Configuring sandbox profiles....
Sandbox profiles updated!

 

 

Once the installation is done, you shall start and enable the Apache service by making use of the following command.

[root@parrot][/home/user/Desktop]
#systemctl start apache2
[root@parrot]?[/home/user/Desktop]
#systemctl enable apache2
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
insserv: warning: current start runlevel(s) (empty) of script `apache2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `apache2' overrides LSB defaults (0 1 6).

 

Once the command is enabled, you shall check the status of it.

[root@parrot]?[/home/user/Desktop]
#systemctl status apache2
   apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: 
   Active: active (running) since Sat 2017-12-02 11:19:56 IST; 27s ago
 Main PID: 5466 (apache2)
    Tasks: 7 (limit: 19660)
   CGroup: /system.slice/apache2.service
           ??5466 /usr/sbin/apache2 -k start
           ??5468 /usr/sbin/apache2 -k start
           ??5469 /usr/sbin/apache2 -k start
           ??5470 /usr/sbin/apache2 -k start
           ??5471 /usr/sbin/apache2 -k start
           ??5472 /usr/sbin/apache2 -k start
           ??5473 /usr/sbin/apache2 -k start

Dec 02 11:19:55 parrot systemd[1]: Starting The Apache HTTP Server...
Dec 02 11:19:56 parrot apachectl[5455]: AH00558: apache2: Could not reliably det
Dec 02 11:19:56 parrot systemd[1]: Started The Apache HTTP Server.

 

And then, do the same for the MariaDB service by making use of the following command.

[root@parrot]?[/home/user/Desktop]
#systemctl start mariadb
[root@parrot]?[/home/user/Desktop]
#systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.

 

And finally check the status of it by running the following command.

[root@parrot]?[/home/user/Desktop]
#systemctl status mariadb
   mariadb.service - MariaDB database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: 
   Active: active (running) since Sat 2017-12-02 11:18:56 IST; 27s ago
 Main PID: 5385 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 26 (limit: 19660)
   CGroup: /system.slice/mariadb.service
           ??5385 /usr/sbin/mysqld

Dec 02 11:18:55 parrot systemd[1]: Starting MariaDB database server...
Dec 02 11:18:56 parrot mysqld[5385]: 2017-12-02 11:18:56 139700562080640 [Note] 
Dec 02 11:18:56 parrot systemd[1]: Started MariaDB database server.
...skipping...
? mariadb.service - MariaDB database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: 
   Active: active (running) since Sat 2017-12-02 11:18:56 IST; 27s ago
 Main PID: 5385 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 26 (limit: 19660)
   CGroup: /system.slice/mariadb.service
           ??5385 /usr/sbin/mysqld

Dec 02 11:18:55 parrot systemd[1]: Starting MariaDB database server...
Dec 02 11:18:56 parrot mysqld[5385]: 2017-12-02 11:18:56 139700562080640 [Note] 
Dec 02 11:18:56 parrot systemd[1]: Started MariaDB database server.
~
~
~
~
~
~
~
~
~
~
~

 

And once it is completed, you can check the version of the PHP which you have just installed.

[root@parrot]?[/var/www/html]
#php -v
PHP 7.0.22-3 (cli) (built: Aug 23 2017 05:51:41) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.22-3, Copyright (c) 1999-2017, by Zend Technologies

 

 

Once it is done, you shall check and see if your Apache server is working. Open your browser and navigate to http://yourIP
NEW

 

You shall now check your PHP functionality. Move into your Apache document root and create a test.php file.

[root@parrot]?[/var/www/html]
#vim info.php
<?php
phpinfo();
?>
[root@parrot]?[/var/www/html]
#systemctl restart apache2

 

You shall now verify it from your browser. Navigate to your browser http://yourIP/info.php
PHP

With this the installation of LAMP Stack comes to an end. 
 


Thank you! for using Linux Help.

You find this tutorial helpful? Share with your friends to keep it alive.
For more help topics browse our website www.linuxhelp.com
Be the first to comment, we value your suggestions. For further queries please comment below.

Tags: LAMP Parrot OS
user image Author :  Matthew