LAMP Stack for PI: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 25: Line 25:
===MySQL===
===MySQL===
<source lang="bash">
<source lang="bash">
apt install mariadb-server-10.3/stable
apt install mariadb-server-10.3/stable
apt install phpmyadmin/stable
apt install phpmyadmin/stable
sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php
sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php
systemctl restart apache2
systemctl restart apache2
</source>
<source lang="sql">
CREATE SCHEMA IF NOT EXISTS chorke_boot_dev;
CREATE USER 'chorke_boot_dev'@'%' IDENTIFIED BY 'chorke_boot_dev';
GRANT ALL PRIVILEGES ON chorke_boot_dev.* TO 'chorke_boot_dev'@'%';
DROP USER 'chorke_boot_dev'@'%'
</source>
</source>

Revision as of 21:40, 18 August 2019

A 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.

Install

Apache

apt install apache2/stable
SERVER_NAME=localhost &&
cat > /etc/apache2/conf-available/servername.conf << EOF
ServerName $SERVER_NAME
EOF
a2enconf servername
systemctl reload apache2
apachectl -t

PHP

apt install php7.3-fpm/stable libapache2-mod-php7.3/stable
a2enmod proxy_fcgi setenvif
a2enconf php7.3-fpm
a2enmod php7.3
systemctl restart apache2

MySQL

apt install mariadb-server-10.3/stable
apt install phpmyadmin/stable
sed -i "s/|\s*\((count(\$analyzed_sql_results\['select_expr'\]\)/| (\1)/g" /usr/share/phpmyadmin/libraries/sql.lib.php
systemctl restart apache2
CREATE SCHEMA IF NOT EXISTS chorke_boot_dev;
CREATE USER 'chorke_boot_dev'@'%' IDENTIFIED BY 'chorke_boot_dev';
GRANT ALL PRIVILEGES ON chorke_boot_dev.* TO 'chorke_boot_dev'@'%';
DROP USER 'chorke_boot_dev'@'%'