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 &rarr /lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/mysqld.service &rarr /lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service &rarr /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
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
With this the installation of LAMP Stack comes to an end.
Comments ( 2 )
#apt update
and try again, If you still face issue let us know.
#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
The following additional packages will be installed:
apache2-data php7.0-common php7.0-json php7.0-opcache php7.0-readline
Suggested packages:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear
The following NEW packages will be installed:
apache2 apache2-data mariadb-server php7.0 php7.0-cli php7.0-common
php7.0-fpm php7.0-gd php7.0-json php7.0-mbstring php7.0-mcrypt php7.0-mysql
php7.0-opcache php7.0-readline
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,713 kB of archives.
After this operation, 17.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://deb.parrotsec.org/parrot stable/main amd64 apache2-data all 2.4.29-2
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:2 http://deb.parrotsec.org/parrot stable/main amd64 apache2 amd64 2.4.29-2
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:3 http://deb.parrotsec.org/parrot stable/main amd64 mariadb-server all 1:10.1.29-6
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:4 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-common amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:5 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-json amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:6 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-opcache amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:7 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-readline amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:8 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-cli amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:9 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-fpm amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:10 http://deb.parrotsec.org/parrot stable/main amd64 php7.0 all 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:11 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-gd amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:12 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-mbstring amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:13 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-mcrypt amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
Err:14 http://deb.parrotsec.org/parrot stable/main amd64 php7.0-mysql amd64 7.0.29-1
404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/a/apache2/apache2-data_2.4.29-2_all.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/a/apache2/apache2_2.4.29-2_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/m/mariadb-10.1/mariadb-server_10.1.29-6_all.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-common_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-json_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-opcache_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-readline_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-cli_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-fpm_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0_7.0.29-1_all.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-gd_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-mbstring_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-mcrypt_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Failed to fetch http://deb.parrotsec.org/parrot/pool/main/p/php7.0/php7.0-mysql_7.0.29-1_amd64.deb 404 Not Found [IP: 2400:6180:100:d0::842:4001 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?